From 9523d631b08313c69e61a1e377d5f90e33b0bd5b Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Wed, 15 Jul 2026 15:48:34 -0400 Subject: [PATCH] [scrobbles] Rename email_scrobble_board_game to scrobble_board_game_from_bgstats --- PROJECT.org | 23 ++++++++++++----------- vrobbler/apps/scrobbles/importers/imap.py | 4 ++-- vrobbler/apps/scrobbles/models.py | 4 ++-- vrobbler/apps/scrobbles/scrobblers.py | 2 +- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/PROJECT.org b/PROJECT.org index 6f31a49..e1580da 100644 --- a/PROJECT.org +++ b/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: diff --git a/vrobbler/apps/scrobbles/importers/imap.py b/vrobbler/apps/scrobbles/importers/imap.py index 54f7a45..5d71d9e 100644 --- a/vrobbler/apps/scrobbles/importers/imap.py +++ b/vrobbler/apps/scrobbles/importers/imap.py @@ -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 ) diff --git a/vrobbler/apps/scrobbles/models.py b/vrobbler/apps/scrobbles/models.py index d7550fc..6ebab4a 100644 --- a/vrobbler/apps/scrobbles/models.py +++ b/vrobbler/apps/scrobbles/models.py @@ -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: diff --git a/vrobbler/apps/scrobbles/scrobblers.py b/vrobbler/apps/scrobbles/scrobblers.py index ddb2ae5..495fffe 100644 --- a/vrobbler/apps/scrobbles/scrobblers.py +++ b/vrobbler/apps/scrobbles/scrobblers.py @@ -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", [])