From 18b715e0ed3578dbd780481635c00c9d56c7697b Mon Sep 17 00:00:00 2001 From: Isaac Date: Fri, 29 Jul 2022 15:10:14 +0000 Subject: [PATCH] Add playlist id offset to legacy indexing --- discovery-provider/src/tasks/playlists.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/discovery-provider/src/tasks/playlists.py b/discovery-provider/src/tasks/playlists.py index 52544cd021a..d10047710fd 100644 --- a/discovery-provider/src/tasks/playlists.py +++ b/discovery-provider/src/tasks/playlists.py @@ -16,6 +16,7 @@ ) logger = logging.getLogger(__name__) +MIN_PLAYLIST_ID = 400000 def playlist_state_update( @@ -63,7 +64,7 @@ def playlist_state_update( ) # parse playlist event to add metadata to record - playlist_record = parse_playlist_event( + playlist_record: Playlist = parse_playlist_event( self, update_task, entry, @@ -72,6 +73,9 @@ def playlist_state_update( block_timestamp, session, ) + if playlist_record.playlist_id > MIN_PLAYLIST_ID: + logger.info(f"index.py | playlists.py | Playlist {playlist_record.playlist_id} is above the playlist ID offset {MIN_PLAYLIST_ID}. Skipping transaction.") + continue # process playlist record if playlist_record is not None: