From f29d256058f81985e041bdefc1b459d9d051c27b Mon Sep 17 00:00:00 2001 From: Jesse Bannon Date: Sat, 10 Sep 2022 22:12:18 -0700 Subject: [PATCH] case where no entries present --- src/ytdl_sub/entries/entry_parent.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ytdl_sub/entries/entry_parent.py b/src/ytdl_sub/entries/entry_parent.py index 13062449..c2af6341 100644 --- a/src/ytdl_sub/entries/entry_parent.py +++ b/src/ytdl_sub/entries/entry_parent.py @@ -18,6 +18,12 @@ class EntryParent(BaseEntry): def _get_children_entry_variables_to_add( self, child_entries: List[TChildEntry] ) -> Dict[str, str | int]: + """ + Adds source variables to the child entry derived from the parent entry. + """ + if not child_entries: + return {} + return {"playlist_max_upload_year": max(entry.upload_year for entry in child_entries)} # pylint: enable=no-self-use