Skip to content

Commit

Permalink
fix: mismatched config entry/params handling related with steam importer
Browse files Browse the repository at this point in the history
  • Loading branch information
yao-yun committed Feb 11, 2025
1 parent b276510 commit 9679205
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
7 changes: 5 additions & 2 deletions journal/importers/steam.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from enum import Enum
from typing import Iterable, List, TypedDict
from datetime import datetime, timedelta

Expand Down Expand Up @@ -41,6 +42,7 @@ class MetaData(TypedDict):
fetch_owned: bool
last_play_to_ctime: bool # False: use current time
shelf_filter: List[ShelfType]
owned_filter: str
ignored_appids: List[str]
steam_tz: str
total: int
Expand All @@ -60,6 +62,7 @@ class MetaData(TypedDict):
"fetch_owned": True,
"last_play_to_ctime": True,
"shelf_filter": [ShelfType.COMPLETE, ShelfType.DROPPED, ShelfType.PROGRESS, ShelfType.WISHLIST],
"owned_filter": "played_free",
"ignored_appids": [],
"steam_tz": "UTC",
"total": 0,
Expand Down Expand Up @@ -180,9 +183,9 @@ def get_owned_games(self, estimate_shelf_type: bool = True) -> Iterable[RawGameM
"key": self.metadata["steam_apikey"],
"steamid": str(self.metadata["steam_id"]),
"include_appinfo": False,
"include_played_free_games": True,
"include_played_free_games": self.metadata["owned_filter"] != "no_free",
"appids_filter": [],
"include_free_sub": True,
"include_free_sub": self.metadata["owned_filter"] == "all_free",
"language": "en", # appinfo not used, so this is no use
"include_extended_appinfo": False,
}
Expand Down
2 changes: 1 addition & 1 deletion users/templates/users/data.html
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@
<div class="form-section">
<b>{% trans 'Override' %}</b>
<label class="checkbox-group">
<input type="checkbox" role="switch" name="allow_reverse_override">
<input type="checkbox" role="switch" name="shelf_type_reversion">
{% trans 'Allow reverse override of status (e.g. playing -> want to, or played -> playing)' %}
</label>
</div>
Expand Down
5 changes: 3 additions & 2 deletions users/views/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,11 @@ def import_steam(request):

SteamImporter.create(
user=request.user,
shelf_type_reversion = bool(request.POST.get("shelf_type_reversion", False)),
shelf_type_reversion = bool(request.POST.get("shelf_type_reversion")),
fetch_wishlist = fetch_wishlist,
fetch_owned = fetch_owned,
last_play_to_ctime = bool(request.POST.get("last_play_to_ctime", True)),
last_play_to_ctime = bool(request.POST.get("mark_date") != "current_time"),
owned_filter = request.POST.get("owned_filter", "played_free"),
shelf_filter = shelf_filter,
ignored_appids = ignored_appids,
steam_tz = tz_str,
Expand Down

0 comments on commit 9679205

Please sign in to comment.