2 Commits

Author SHA1 Message Date
7ec9432d7b change version 2025-08-25 22:14:19 +02:00
044d49a9dc fix error when add 2025-08-25 22:13:23 +02:00
3 changed files with 8 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
package constants package constants
const Version = "0.0.4b" const Version = "0.0.4c"
const ApiVersion = 1 const ApiVersion = 1

View File

@@ -4,6 +4,7 @@ import (
"cloudsave/pkg/remote/client" "cloudsave/pkg/remote/client"
"cloudsave/pkg/repository" "cloudsave/pkg/repository"
"cloudsave/pkg/tools/archive" "cloudsave/pkg/tools/archive"
"errors"
"fmt" "fmt"
"io" "io"
"os" "os"
@@ -134,6 +135,9 @@ func (s *Service) MakeBackup(gameID string) error {
src, err := s.repo.ReadBlob(id) src, err := s.repo.ReadBlob(id)
if err != nil { if err != nil {
if errors.Is(err, repository.ErrNotFound) {
return nil
}
return err return err
} }
if v, ok := src.(io.Closer); ok { if v, ok := src.(io.Closer); ok {

View File

@@ -313,6 +313,9 @@ func (l *LazyRepository) ReadBlob(id Identifier) (io.ReadSeekCloser, error) {
slog.Debug("loading read buffer...", "id", id) slog.Debug("loading read buffer...", "id", id)
dst, err := os.OpenFile(filepath.Join(path, "data.tar.gz"), os.O_RDONLY, 0) dst, err := os.OpenFile(filepath.Join(path, "data.tar.gz"), os.O_RDONLY, 0)
if err != nil { if err != nil {
if errors.Is(err, os.ErrNotExist) {
return nil, fmt.Errorf("failed to open blob: %w", ErrNotFound)
}
return nil, fmt.Errorf("failed to open blob: %w", err) return nil, fmt.Errorf("failed to open blob: %w", err)
} }