Skip to content

Commit

Permalink
Merge pull request #3077 from metabrainz/playlists-service-status
Browse files Browse the repository at this point in the history
Playlist status: Don't overwrite playlist timestamp with older date
  • Loading branch information
MonkeyDo authored Dec 13, 2024
2 parents 5538b9b + 403218c commit 2aa41e6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions listenbrainz/webserver/views/status_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ def get_playlists_timestamp():
return last_updated
for playlist in playlists:
source_patch = playlist.additional_metadata["algorithm_metadata"]["source_patch"]
if source_patch in last_updated:
# playlists are sorted by created date in descending order
# don't overwrite the previously set timestamp for that playlist patch
continue
last_updated_ts = int(playlist.last_updated.timestamp())
last_updated[source_patch] = last_updated_ts
cache.set(cache_key, last_updated, PLAYLIST_CACHE_TIME)
Expand Down

0 comments on commit 2aa41e6

Please sign in to comment.