full playlist refresh and index for channel overwrites

This commit is contained in:
simon 2022-03-22 09:42:41 +07:00
parent fc10fa62e8
commit 3d451e47e5
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
2 changed files with 10 additions and 1 deletions

View File

@ -94,7 +94,15 @@ class DownloadPostProcess:
def validate_playlists(self):
"""look for playlist needing to update"""
for id_c, channel_id in enumerate(self.download.channels):
playlists = YoutubeChannel(channel_id).get_indexed_playlists()
channel = YoutubeChannel(channel_id)
overwrites = self.pending.channel_overwrites.get(channel_id, False)
if overwrites and overwrites.get("index_playlists"):
# validate from remote
channel.index_channel_playlists()
continue
# validate from local
playlists = channel.get_indexed_playlists()
all_channel_playlist = [i["playlist_id"] for i in playlists]
self._validate_channel_playlist(all_channel_playlist, id_c)

View File

@ -246,6 +246,7 @@ class YoutubeChannel(YouTubeItem):
def index_channel_playlists(self):
"""add all playlists of channel to index"""
print(f"{self.youtube_id}: index all playlists")
mess_dict = {
"status": "message:playlistscan",
"level": "info",