mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-22 11:50:14 +00:00
delete playlists of channel when deleting channel, #118
This commit is contained in:
parent
49cd272557
commit
1cbe0bbfc0
@ -224,6 +224,13 @@ class YoutubeChannel:
|
||||
if not response.ok:
|
||||
print(response.text)
|
||||
|
||||
def delete_playlists(self):
|
||||
"""delete all indexed playlist from es"""
|
||||
all_playlists = self.get_indexed_playlists()
|
||||
for playlist in all_playlists:
|
||||
playlist_id = playlist["playlist_id"]
|
||||
YoutubePlaylist(playlist_id).delete_metadata()
|
||||
|
||||
def delete_channel(self):
|
||||
"""delete channel and all videos"""
|
||||
print(f"deleting {self.channel_id} and all matching media files")
|
||||
@ -239,7 +246,8 @@ class YoutubeChannel:
|
||||
print(f"no videos found for {folder_path}")
|
||||
|
||||
ThumbManager().delete_chan_thumb(self.channel_id)
|
||||
|
||||
print("delete indexed playlists")
|
||||
self.delete_playlists()
|
||||
print("delete indexed videos")
|
||||
self.delete_es_videos()
|
||||
url = self.ES_URL + "/ta_channel/_doc/" + self.channel_id
|
||||
|
Loading…
Reference in New Issue
Block a user