Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RareGameSlim: fix uploading save games when there aren't any on the remote #453

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions rare/models/base_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

@dataclass
class RareSaveGame:
file: SaveGameFile
file: Optional[SaveGameFile]
status: SaveGameStatus = SaveGameStatus.NO_SAVE
dt_local: Optional[datetime] = None
dt_remote: Optional[datetime] = None
Expand Down Expand Up @@ -236,8 +236,8 @@ def latest_save(self) -> Optional[RareSaveGame]:

@property
def save_game_state(self) -> Tuple[SaveGameStatus, Tuple[Optional[datetime], Optional[datetime]]]:
if self.saves and self.save_path:
latest = self.latest_save
if self.save_path:
latest = s if (s := self.latest_save) is not None else RareSaveGame(None)
# lk: if the save path wasn't known at startup, dt_local will be None
# In that case resolve the save again before returning
latest.status, (latest.dt_local, latest.dt_remote) = self.core.check_savegame_state(
Expand Down
Loading