Skip to content

Commit a23df4c

Browse files
Fix last added to playlist bug (#11994)
1 parent 7685ca3 commit a23df4c

File tree

1 file changed

+6
-1
lines changed
  • packages/discovery-provider/src/tasks/entity_manager/entities

1 file changed

+6
-1
lines changed

packages/discovery-provider/src/tasks/entity_manager/entities/playlist.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,12 @@ def populate_playlist_record_metadata(
718718
for track_obj in playlist_record.playlist_contents["track_ids"]:
719719
if track_obj["time"] > last_added_to:
720720
last_added_to = track_obj["time"]
721-
playlist_record.last_added_to = datetime.utcfromtimestamp(last_added_to)
721+
try:
722+
playlist_record.last_added_to = datetime.utcfromtimestamp(last_added_to)
723+
except ValueError:
724+
params.logger.error(
725+
f"playlist.py | EntityManager | Invalid last_added_to timestamp: {last_added_to}"
726+
)
722727

723728
playlist_record.updated_at = block_datetime
724729
playlist_record.metadata_multihash = metadata_cid

0 commit comments

Comments
 (0)