add description

This commit is contained in:
Jesse Bannon 2022-09-17 00:17:50 -07:00
parent 7d908827f1
commit 600adcf0a8
3 changed files with 11 additions and 14 deletions

View file

@ -10,6 +10,7 @@ from typing import final
from yt_dlp.utils import sanitize_filename
from ytdl_sub.entries.variables.kwargs import DESCRIPTION
from ytdl_sub.entries.variables.kwargs import TITLE
from ytdl_sub.entries.variables.kwargs import WEBPAGE_URL
@ -93,7 +94,7 @@ class BaseEntryVariables:
str
The description if it exists. Otherwise, returns an emtpy string.
"""
return self.kwargs_get("description", "")
return self.kwargs_get(DESCRIPTION, "")
# pylint: enable=no-member

View file

@ -68,20 +68,15 @@ class EntryParent(BaseEntry):
}
def _parent_variables(self, parent_type: str) -> Dict:
if parent_type == ParentType.SOURCE:
return {
SOURCE_ENTRY: self._kwargs,
SOURCE_TITLE: self.title,
SOURCE_WEBPAGE_URL: self.webpage_url,
SOURCE_UID: self.uid,
SOURCE_DESCRIPTION: self.description,
}
def _(source_key: str, playlist_key: str) -> str:
return playlist_key if parent_type == ParentType.SOURCE else source_key
return {
PLAYLIST_ENTRY: self._kwargs,
PLAYLIST_TITLE: self.title,
PLAYLIST_WEBPAGE_URL: self.webpage_url,
PLAYLIST_UID: self.uid,
PLAYLIST_DESCRIPTION: self.description,
_(SOURCE_ENTRY, PLAYLIST_ENTRY): self._kwargs,
_(SOURCE_TITLE, PLAYLIST_TITLE): self.title,
_(SOURCE_WEBPAGE_URL, PLAYLIST_WEBPAGE_URL): self.webpage_url,
_(SOURCE_UID, PLAYLIST_UID): self.uid,
_(SOURCE_DESCRIPTION, PLAYLIST_DESCRIPTION): self.description,
}
def _get_entry_children_variable_list(self, variable_name: str) -> List[str | int]:

View file

@ -36,4 +36,5 @@ PLAYLIST_UID = _("playlist_uid")
EXT = _("ext")
TITLE = _("title")
DESCRIPTION = _("description")
WEBPAGE_URL = _("webpage_url")