fix mangled method naming
This commit is contained in:
parent
7358a0cdd5
commit
7e35b7488f
|
|
@ -153,7 +153,7 @@ class PendingList(PendingIndex):
|
|||
if entry["type"] == "video":
|
||||
to_add = self._add_video(entry["url"], entry["vid_type"])
|
||||
if to_add:
|
||||
self.__notify_add(
|
||||
self._notify_add(
|
||||
item_type="video",
|
||||
name=to_add["title"],
|
||||
idx=idx,
|
||||
|
|
@ -218,7 +218,7 @@ class PendingList(PendingIndex):
|
|||
|
||||
total = len(video_results)
|
||||
for idx, video_data in enumerate(video_results, start=1):
|
||||
to_add = self.__parse_channel_video(
|
||||
to_add = self._parse_channel_video(
|
||||
video_data, vid_type, channel_handler.json_data
|
||||
)
|
||||
if self.task and self.task.is_stopped():
|
||||
|
|
@ -228,14 +228,14 @@ class PendingList(PendingIndex):
|
|||
continue
|
||||
|
||||
self.missing_videos.append(to_add)
|
||||
self.__notify_add(
|
||||
self._notify_add(
|
||||
item_type="channel",
|
||||
name=channel_handler.json_data["channel_name"],
|
||||
idx=idx,
|
||||
total=total,
|
||||
)
|
||||
|
||||
def __parse_channel_video(
|
||||
def _parse_channel_video(
|
||||
self, video_data, vid_type, channel_json
|
||||
) -> dict | None:
|
||||
"""parse video of channel"""
|
||||
|
|
@ -300,7 +300,7 @@ class PendingList(PendingIndex):
|
|||
continue
|
||||
|
||||
self.missing_videos.append(to_add)
|
||||
self.__notify_add(
|
||||
self._notify_add(
|
||||
item_type="playlist",
|
||||
name=playlist.json_data["playlist_name"],
|
||||
idx=idx,
|
||||
|
|
@ -368,11 +368,11 @@ class PendingList(PendingIndex):
|
|||
to_add = {
|
||||
"youtube_id": video_data["id"],
|
||||
"title": video_data["title"],
|
||||
"vid_thumb_url": self.__extract_thumb(video_data),
|
||||
"vid_thumb_url": self._extract_thumb(video_data),
|
||||
"duration": get_duration_str(video_data.get("duration", 0)),
|
||||
"published": self.__extract_published(video_data),
|
||||
"published": self._extract_published(video_data),
|
||||
"timestamp": int(datetime.now().timestamp()),
|
||||
"vid_type": self.__extract_vid_type(video_data),
|
||||
"vid_type": self._extract_vid_type(video_data),
|
||||
"channel_name": video_data["channel"],
|
||||
"channel_id": video_data["channel_id"],
|
||||
"channel_indexed": video_data["channel_id"] in self.all_channels,
|
||||
|
|
@ -380,7 +380,7 @@ class PendingList(PendingIndex):
|
|||
|
||||
return to_add
|
||||
|
||||
def __extract_thumb(self, video_data) -> str | None:
|
||||
def _extract_thumb(self, video_data) -> str | None:
|
||||
"""extract thumb"""
|
||||
if "thumbnail" in video_data:
|
||||
return video_data["thumbnail"]
|
||||
|
|
@ -390,7 +390,7 @@ class PendingList(PendingIndex):
|
|||
|
||||
return None
|
||||
|
||||
def __extract_published(self, video_data) -> str | int | None:
|
||||
def _extract_published(self, video_data) -> str | int | None:
|
||||
"""build published date or timestamp"""
|
||||
timestamp = video_data.get("timestamp")
|
||||
if timestamp:
|
||||
|
|
@ -405,7 +405,7 @@ class PendingList(PendingIndex):
|
|||
|
||||
return published
|
||||
|
||||
def __extract_vid_type(self, video_data) -> str:
|
||||
def _extract_vid_type(self, video_data) -> str:
|
||||
"""build vid type"""
|
||||
if (
|
||||
"vid_type" in video_data
|
||||
|
|
@ -464,7 +464,7 @@ class PendingList(PendingIndex):
|
|||
|
||||
return len(self.missing_videos)
|
||||
|
||||
def __notify_add(
|
||||
def _notify_add(
|
||||
self, item_type: str, name: str, idx: int, total: int
|
||||
) -> None:
|
||||
"""notify"""
|
||||
|
|
|
|||
Loading…
Reference in New Issue