[scrobbles] Rename email_scrobble_board_game to scrobble_board_game_from_bgstats
This commit is contained in:
23
PROJECT.org
23
PROJECT.org
@ -592,17 +592,6 @@ Should look up past plays by =bggeek_id= first.
|
||||
|
||||
File: ~vrobbler/apps/boardgames/bgg.py~ (line 117)
|
||||
|
||||
** TODO [#C] Clean up naming of =bgsplay= parsing :importers:refactoring:
|
||||
:PROPERTIES:
|
||||
:ID: c751dbbc-464a-4e63-9fe3-e034303f7b54
|
||||
:END:
|
||||
|
||||
*** Description
|
||||
|
||||
We should rename `email_scrobble_board_game` to reflect the fact that it's just
|
||||
a helper method to create board game scrobbles given a json blob. It's
|
||||
independent of the email flow it was originally creatdd for
|
||||
|
||||
** TODO [#B] Is there way to create unique slugs for media instances :media_types:
|
||||
** TODO [#A] Update how board game scrobbles work :boardgames:
|
||||
|
||||
@ -619,6 +608,18 @@ The Edit log form should have from top to bottom:
|
||||
- Expansion ids (which should a multi-select widget of expansions for this game)
|
||||
- Location (which should be a drop down of BoardGameLocations for this user)
|
||||
|
||||
|
||||
** DONE [#C] Clean up naming of =bgsplay= parsing :importers:refactoring:
|
||||
:PROPERTIES:
|
||||
:ID: c751dbbc-464a-4e63-9fe3-e034303f7b54
|
||||
:END:
|
||||
|
||||
*** Description
|
||||
|
||||
We should rename `email_scrobble_board_game` to reflect the fact that it's just
|
||||
a helper method to create board game scrobbles given a json blob. It's
|
||||
independent of the email flow it was originally creatdd for
|
||||
|
||||
* Version 60.2 [1/1]
|
||||
** DONE Use FastCork to lookup wine data :drinks:wine:metadata:
|
||||
:PROPERTIES:
|
||||
|
||||
@ -6,7 +6,7 @@ from email.header import decode_header
|
||||
|
||||
from profiles.models import UserProfile
|
||||
from scrobbles.models import Scrobble
|
||||
from scrobbles.scrobblers import email_scrobble_board_game
|
||||
from scrobbles.scrobblers import scrobble_board_game_from_bgstats
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@ -87,7 +87,7 @@ def import_scrobbles_from_imap() -> list[Scrobble]:
|
||||
)
|
||||
continue
|
||||
|
||||
scrobbles_created = email_scrobble_board_game(
|
||||
scrobbles_created = scrobble_board_game_from_bgstats(
|
||||
parsed_json, profile.user_id
|
||||
)
|
||||
|
||||
|
||||
@ -550,11 +550,11 @@ class BGStatsImport(BaseFileImportMixin):
|
||||
try:
|
||||
import json
|
||||
|
||||
from scrobbles.scrobblers import email_scrobble_board_game
|
||||
from scrobbles.scrobblers import scrobble_board_game_from_bgstats
|
||||
|
||||
with open(self.upload_file_path, "r", encoding="utf-8") as f:
|
||||
parsed_json = json.load(f)
|
||||
scrobbles = email_scrobble_board_game(parsed_json, self.user_id)
|
||||
scrobbles = scrobble_board_game_from_bgstats(parsed_json, self.user_id)
|
||||
|
||||
self.record_log(scrobbles)
|
||||
except Exception as e:
|
||||
|
||||
@ -396,7 +396,7 @@ def manual_scrobble_board_game(
|
||||
return Scrobble.create_or_update(boardgame, user_id, scrobble_dict)
|
||||
|
||||
|
||||
def email_scrobble_board_game(
|
||||
def scrobble_board_game_from_bgstats(
|
||||
bgstat_data: dict[str, Any], user_id: int
|
||||
) -> list[Scrobble]:
|
||||
game_list: list = bgstat_data.get("games", [])
|
||||
|
||||
Reference in New Issue
Block a user