From 3d451e47e5c66b7d9e010f94fa2496853f6eae26 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 22 Mar 2022 09:42:41 +0700 Subject: [PATCH] full playlist refresh and index for channel overwrites --- tubearchivist/home/src/download/yt_dlp_handler.py | 10 +++++++++- tubearchivist/home/src/index/channel.py | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tubearchivist/home/src/download/yt_dlp_handler.py b/tubearchivist/home/src/download/yt_dlp_handler.py index 74cd6f4..e540426 100644 --- a/tubearchivist/home/src/download/yt_dlp_handler.py +++ b/tubearchivist/home/src/download/yt_dlp_handler.py @@ -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) diff --git a/tubearchivist/home/src/index/channel.py b/tubearchivist/home/src/index/channel.py index 5991157..6caf02c 100644 --- a/tubearchivist/home/src/index/channel.py +++ b/tubearchivist/home/src/index/channel.py @@ -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",