diff --git a/src/ytdl_sub/entries/entry_parent.py b/src/ytdl_sub/entries/entry_parent.py index 78ad5aad..24b227b0 100644 --- a/src/ytdl_sub/entries/entry_parent.py +++ b/src/ytdl_sub/entries/entry_parent.py @@ -69,7 +69,7 @@ class EntryParent(BaseEntry): def _parent_variables(self, parent_type: str) -> Dict: def _(source_key: str, playlist_key: str) -> str: - return playlist_key if parent_type == ParentType.SOURCE else source_key + return playlist_key if parent_type == ParentType.PLAYLIST else source_key return { _(SOURCE_ENTRY, PLAYLIST_ENTRY): self._kwargs, diff --git a/tests/unit/entries/conftest.py b/tests/unit/entries/conftest.py index af6239c1..9339b8f3 100644 --- a/tests/unit/entries/conftest.py +++ b/tests/unit/entries/conftest.py @@ -64,6 +64,7 @@ def mock_entry_to_dict( "title": "entry {title}", "title_sanitized": "entry {title}", "ext": ext, + "description": "", "extractor": extractor, "upload_date": upload_date, "upload_date_standardized": "2021-01-12", @@ -85,12 +86,22 @@ def mock_entry_to_dict( "thumbnail_ext": thumbnail_ext, "info_json_ext": "info.json", "webpage_url": webpage_url, - "playlist": "entry {title}", - "playlist_sanitized": "entry {title}", "playlist_index": 1, "playlist_index_padded": "01", "playlist_count": 1, "playlist_max_upload_year": 2021, + "playlist_max_upload_year_truncated": 21, + "playlist_title": "entry {title}", + "playlist_title_sanitized": "entry {title}", + "playlist_description": "", + "playlist_webpage_url": "https://yourname.here", + "source_count": 1, + "source_description": "", + "source_index": 1, + "source_index_padded": "01", + "source_title": "entry {title}", + "source_title_sanitized": "entry {title}", + "source_webpage_url": "https://yourname.here", } diff --git a/tests/unit/entries/test_youtube_entries.py b/tests/unit/entries/test_youtube_entries.py index 6dfcb8a9..67f7ea79 100644 --- a/tests/unit/entries/test_youtube_entries.py +++ b/tests/unit/entries/test_youtube_entries.py @@ -4,11 +4,6 @@ from ytdl_sub.entries.soundcloud import SoundcloudTrack from ytdl_sub.entries.youtube import YoutubeVideo -@pytest.fixture -def description(): - return "a description" - - @pytest.fixture def playlist_index(): return 1 @@ -49,7 +44,6 @@ def mock_youtube_video_to_dict( "track_title_sanitized": track_title, "artist": artist, "artist_sanitized": artist, - "description": description, } ) @@ -66,7 +60,6 @@ def mock_youtube_video_kwargs( "channel": channel, "track": track_title, "artist": artist, - "description": description, } )