[scrobbles] Auto set playback seconds

This commit is contained in:
2025-12-22 10:23:34 -05:00
parent a5d72ce4c3
commit 8fd0ed6e17
2 changed files with 12 additions and 1 deletions

View File

@ -92,7 +92,7 @@ fetching and simple saving.
:LOGBOOK: :LOGBOOK:
CLOCK: [2025-07-09 Wed 09:55]--[2025-07-09 Wed 10:15] => 0:20 CLOCK: [2025-07-09 Wed 09:55]--[2025-07-09 Wed 10:15] => 0:20
:END: :END:
* Backlog [1/21] * Backlog [2/24]
** TODO [#C] Create small utility to clean up tracks scrobbled with wonky playback times :vrobbler:personal:bug:music:scrobbles: ** TODO [#C] Create small utility to clean up tracks scrobbled with wonky playback times :vrobbler:personal:bug:music:scrobbles:
** TODO [#C] Move to using more robust mopidy-webhooks pacakge form pypi :utility:improvement: ** TODO [#C] Move to using more robust mopidy-webhooks pacakge form pypi :utility:improvement:
:PROPERTIES: :PROPERTIES:
@ -446,10 +446,18 @@ original intent of the scrobble.
It may also allow us to clean up junk scrobbles if the data was just horribly It may also allow us to clean up junk scrobbles if the data was just horribly
wrong. wrong.
** TODO [#A] When creating org-mode tasks, don't copy comments :vrobbler:bug:scrobbles:tasks:
** TODO [#A] Fix lookup of music tracks from Musicbrainz :vrobbler:bug:tracks:music: ** TODO [#A] Fix lookup of music tracks from Musicbrainz :vrobbler:bug:tracks:music:
:PROPERTIES:
:ID: 2bc1cc0b-6c4e-bc3d-e7c3-47df364df206
:END:
Turns out we're not looking up music tracks properly, again. Turns out we're not looking up music tracks properly, again.
** DONE [#B] Auto calc duration if no playback time seconds present :vrobbler:bug:scrobbles:personal:project:
:PROPERTIES:
:ID: e16228b2-b062-bd00-32e6-b2353e6406e9
:END:
** DONE [#A] Fix raw text webpage title not truncating to 254 chars :vrobbler:personal:bug:webpages: ** DONE [#A] Fix raw text webpage title not truncating to 254 chars :vrobbler:personal:bug:webpages:
:PROPERTIES: :PROPERTIES:
:ID: 13fa0efd-2c3f-dd07-deb2-62882096feff :ID: 13fa0efd-2c3f-dd07-deb2-62882096feff

View File

@ -702,6 +702,9 @@ class Scrobble(TimeStampedModel):
if self.media_obj: if self.media_obj:
self.media_type = self.MediaType(self.media_obj.__class__.__name__) self.media_type = self.MediaType(self.media_obj.__class__.__name__)
if (self.timestamp and self.stop_timestamp) and (not self.playback_position_seconds or self.playback_position_seconds <= 0):
self.playback_position_seconds = (self.stop_timestamp - self.timestamp).seconds
return super(Scrobble, self).save(*args, **kwargs) return super(Scrobble, self).save(*args, **kwargs)
def get_absolute_url(self): def get_absolute_url(self):