sessions / 9523d631b08313c69e61a1e377d5f90e33b0bd5b

/home/powellc/src/code.unbl.ink/secstate/vrobbler

author
Colin Powell <colin@unbl.ink>
recorded
2026-07-15 15:48:34 EDT
agent
opencode
message
Rename email_scrobble_board_game to scrobble_board_game_from_bgstats

prompt

Clean up bgstats function naming per task c751dbbc-464a-4e63-9fe3-e034303f7b54

diff

ignore whitespace

commit 9523d631b08313c69e61a1e377d5f90e33b0bd5bAuthor: Colin Powell <colin@unbl.ink>Date:   Wed Jul 15 15:48:34 2026 -0400    [scrobbles] Rename email_scrobble_board_game to scrobble_board_game_from_bgstatsNotes:    The function `email_scrobble_board_game` was originally created for parsing BG Stats JSON from email attachments via IMAP. However, it was later also used by `BGStatsImport` (a file upload importer), making the "email" prefix misleading. The function is a general helper that takes BG Stats JSON data and creates board game scrobbles — independent of any email flow.        Renamed to `scrobble_board_game_from_bgstats` to accurately reflect its purpose. Updated all 3 call sites: the definition in scrobblers.py, the file import in models.py, and the email import in imap.py.diff --git a/PROJECT.org b/PROJECT.orgindex 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.pyindex 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.pyindex 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.pyindex 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", [])