[tasks] Mark 868e2a91 scrobble lookup bug as done

This commit is contained in:
2026-08-07 20:24:44 -04:00
parent dc17a285c1
commit f04b7238b5

View File

@ -721,6 +721,52 @@ Added a `workouts` Django app so we can scrobble gym sessions.
- Templates, admin, DRF viewsets (`exercises`, `workout-routines`), MCP tools,
and `tests/workouts_tests/` (unit conversion, form round-trips, importer,
imperial POST) included.
** DONE [#B] Fix LookupError on scrobble start/long-plays views :bug:scrobbles:videos:
:PROPERTIES:
:ID: 868e2a91-c974-4656-a8ae-b90a1f94ae74
:END:
- `PLAY_AGAIN_MEDIA["channels"]` and `LONG_PLAY_MEDIA["papers"]` keyed models
by app labels that don't exist (`Channel` lives in `videos`, `Paper` in
`books`), so `scrobble_start`, `scrobble_longplay_finish`, and the long-plays
views raised `LookupError: No installed app with label 'channels'` for every
request.
- `scrobble_start` now special-cases `channels` to the `videos` app and skips
unknown app labels; a shared `get_long_play_media_model()` helper in
`scrobbles/utils.py` maps the `papers` label to `books` for the long-play
lookups.
- Also fixed `Channel.scrobble_for_user` which still used the pre-refactor
`Scrobble.create_or_update(media_object=...)` signature (would raise
`TypeError` once the lookup reached it).
- Fixed in commit `fbb1725d`; audited all other `apps.get_model` callers of
the media maps (`AUTO_FINISH_MEDIA` uses class-name values only, harmless).
Regression tests: channel/video start, long-plays view.
** DONE [#B] Add Flexify workout importer :workouts:importer:
:PROPERTIES:
:ID: 96c9fbf5-a0d5-4f09-a72c-bb491b7ece18
:END:
*** Description
Import gym sessions and routines from a Flexify backup.
- `import_flexify()` in `workouts/importer.py` reads a Flexify sqlite backup
(`data/flexify-example.sqlite`) plus an optional plans CSV
(`data/flexify-plans-example.csv`). Plans become `WorkoutRoutine`s with
`WorkoutRoutineExercise` planned-exercise rows; logged `gym_sets` are
clustered into sessions (gap > 60 min or plan change) and converted into
workout scrobbles.
- A curated `FLEXIFY_EXERCISE_ALIASES` map resolves Flexify exercise names to
the wrkout catalog, falling back to `find_or_create` for unmatched names.
- `python manage.py import_flexify --sqlite ... --csv ... --user ...` command.
- `scan_webdav_for_flexify()` watches `var/workouts/` on WebDAV (via the
existing import_from_webdav sweep), pairing a plans CSV with the sqlite
backup, and queues `process_workout_import` celery tasks.
- `WorkoutImport` model (`BaseFileImportMixin`, new `file_hash` field for
change detection), admin, DRF `workout-imports` viewset, planned-exercises
block on the routine detail template, and MCP routine dict update.
** DONE [#B] Add workouts app with exercise catalog and workout routines :workouts:feature:
** DONE [#A] When sharing a scrobble, share the log data too :bug:scrobbles:sharing:
:PROPERTIES:
:ID: 46de9f0e-2727-63f4-0845-e714dbbe4a45
@ -749,49 +795,6 @@ Added a `workouts` Django app so we can scrobble gym sessions.
cover body-composition metrics on Task scrobbles and `bodyweight_kg` on
Workout scrobbles.
** TODO [#B] Fix LookupError on scrobble start/long-plays views :bug:scrobbles:videos:
:PROPERTIES:
:ID: 868e2a91-c974-4656-a8ae-b90a1f94ae74
:END:
- `PLAY_AGAIN_MEDIA["channels"]` and `LONG_PLAY_MEDIA["papers"]` keyed models
by app labels that don't exist (`Channel` lives in `videos`, `Paper` in
`books`), so `scrobble_start`, `scrobble_longplay_finish`, and the long-plays
views raised `LookupError: No installed app with label 'channels'` for every
request.
- `scrobble_start` now special-cases `channels` to the `videos` app and skips
unknown app labels; a shared `get_long_play_media_model()` helper in
`scrobbles/utils.py` maps the `papers` label to `books` for the long-play
lookups.
- Also fixed `Channel.scrobble_for_user` which still used the pre-refactor
`Scrobble.create_or_update(media_object=...)` signature (would raise
`TypeError` once the lookup reached it).
** DONE [#B] Add Flexify workout importer :workouts:importer:
:PROPERTIES:
:ID: 96c9fbf5-a0d5-4f09-a72c-bb491b7ece18
:END:
*** Description
Import gym sessions and routines from a Flexify backup.
- `import_flexify()` in `workouts/importer.py` reads a Flexify sqlite backup
(`data/flexify-example.sqlite`) plus an optional plans CSV
(`data/flexify-plans-example.csv`). Plans become `WorkoutRoutine`s with
`WorkoutRoutineExercise` planned-exercise rows; logged `gym_sets` are
clustered into sessions (gap > 60 min or plan change) and converted into
workout scrobbles.
- A curated `FLEXIFY_EXERCISE_ALIASES` map resolves Flexify exercise names to
the wrkout catalog, falling back to `find_or_create` for unmatched names.
- `python manage.py import_flexify --sqlite ... --csv ... --user ...` command.
- `scan_webdav_for_flexify()` watches `var/workouts/` on WebDAV (via the
existing import_from_webdav sweep), pairing a plans CSV with the sqlite
backup, and queues `process_workout_import` celery tasks.
- `WorkoutImport` model (`BaseFileImportMixin`, new `file_hash` field for
change detection), admin, DRF `workout-imports` viewset, planned-exercises
block on the routine detail template, and MCP routine dict update.
** DONE [#B] Add workouts app with exercise catalog and workout routines :workouts:feature:
* Version 64.5 [1/1]
** DONE [#B] Clean up issues with org-mode notes :orgmode:notes:scrobbles:
:PROPERTIES: