mirror of
https://github.com/tubearchivist/tubearchivist-frontend.git
synced 2024-11-22 11:50:14 +00:00
clean up playlist subscribe notification
This commit is contained in:
parent
7516090e14
commit
82a71ed75d
@ -401,25 +401,24 @@ class PlaylistSubscription:
|
|||||||
all_youtube_ids = [i["youtube_id"] for i in all_indexed]
|
all_youtube_ids = [i["youtube_id"] for i in all_indexed]
|
||||||
|
|
||||||
new_thumbs = []
|
new_thumbs = []
|
||||||
counter = 1
|
for idx, playlist in enumerate(new_playlists):
|
||||||
for playlist in new_playlists:
|
|
||||||
url_type = playlist["type"]
|
url_type = playlist["type"]
|
||||||
playlist_id = playlist["url"]
|
playlist_id = playlist["url"]
|
||||||
if not url_type == "playlist":
|
if not url_type == "playlist":
|
||||||
print(f"{playlist_id} not a playlist, skipping...")
|
print(f"{playlist_id} not a playlist, skipping...")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
playlisr = YoutubePlaylist(
|
playlist_h = YoutubePlaylist(
|
||||||
playlist_id, all_youtube_ids=all_youtube_ids
|
playlist_id, all_youtube_ids=all_youtube_ids
|
||||||
)
|
)
|
||||||
if not playlisr.get_es_playlist():
|
if not playlist_h.get_es_playlist():
|
||||||
playlisr.get_playlist_dict()
|
playlist_h.get_playlist_dict()
|
||||||
playlisr.playlist_dict["playlist_subscribed"] = subscribed
|
playlist_h.playlist_dict["playlist_subscribed"] = subscribed
|
||||||
playlisr.upload_to_es()
|
playlist_h.upload_to_es()
|
||||||
playlisr.add_vids_to_playlist()
|
playlist_h.add_vids_to_playlist()
|
||||||
thumb = playlisr.playlist_dict["playlist_thumbnail"]
|
thumb = playlist_h.playlist_dict["playlist_thumbnail"]
|
||||||
new_thumbs.append((playlist_id, thumb))
|
new_thumbs.append((playlist_id, thumb))
|
||||||
self.channel_validate(playlisr)
|
self.channel_validate(playlist_h)
|
||||||
else:
|
else:
|
||||||
self.change_subscribe(playlist_id, subscribe_status=True)
|
self.change_subscribe(playlist_id, subscribe_status=True)
|
||||||
|
|
||||||
@ -428,12 +427,11 @@ class PlaylistSubscription:
|
|||||||
"status": "message:subplaylist",
|
"status": "message:subplaylist",
|
||||||
"level": "info",
|
"level": "info",
|
||||||
"title": "Subscribing to Playlists",
|
"title": "Subscribing to Playlists",
|
||||||
"message": f"Processing {counter} of {len(new_playlists)}",
|
"message": f"Processing {idx + 1} of {len(new_playlists)}",
|
||||||
}
|
}
|
||||||
RedisArchivist().set_message(
|
RedisArchivist().set_message(
|
||||||
"message:subplaylist", message=message
|
"message:subplaylist", message=message
|
||||||
)
|
)
|
||||||
counter = counter + 1
|
|
||||||
|
|
||||||
return new_thumbs
|
return new_thumbs
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user