Channel playlist index fix, #build

Changed:
- Fixed channel not indexing correctly for standalone playlist
This commit is contained in:
Simon
2024-05-16 19:54:08 +02:00

View File

@@ -9,6 +9,7 @@ from datetime import datetime
from home.src.download.thumbnails import ThumbManager
from home.src.es.connect import ElasticWrap, IndexPaginate
from home.src.index import channel
from home.src.index.generic import YouTubeItem
from home.src.index.video import YoutubeVideo
@@ -44,6 +45,7 @@ class YoutubePlaylist(YouTubeItem):
return
self.process_youtube_meta()
self._ensure_channel()
ids_found = self.get_local_vids()
self.get_entries(ids_found)
self.json_data["playlist_entries"] = self.all_members
@@ -69,6 +71,12 @@ class YoutubePlaylist(YouTubeItem):
"playlist_type": "regular",
}
def _ensure_channel(self):
"""make sure channel is indexed"""
channel_id = self.json_data["playlist_channel_id"]
channel_handler = channel.YoutubeChannel(channel_id)
channel_handler.build_json(upload=True)
def get_local_vids(self) -> list[str]:
"""get local video ids from youtube entries"""
entries = self.youtube_meta["entries"]