use override in test

This commit is contained in:
Jesse Bannon 2023-03-30 09:03:18 -07:00
parent db9eb91a4e
commit fe27c226df
2 changed files with 7 additions and 9 deletions

View file

@ -443,14 +443,10 @@ class BaseUrlDownloader(BaseDownloader[BaseDownloaderOptionsT], ABC):
): ):
yield entry_child yield entry_child
def _download_url_metadata( def _download_url_metadata(self, url: str) -> Tuple[List[EntryParent], List[Entry]]:
self, collection_url: UrlValidator
) -> Tuple[List[EntryParent], List[Entry]]:
""" """
Downloads only info.json files and forms EntryParent trees Downloads only info.json files and forms EntryParent trees
""" """
url = self.overrides.apply_formatter(collection_url.url)
with self._separate_download_archives(): with self._separate_download_archives():
entry_dicts = YTDLP.extract_info_via_info_json( entry_dicts = YTDLP.extract_info_via_info_json(
working_directory=self.working_directory, working_directory=self.working_directory,
@ -494,7 +490,11 @@ class BaseUrlDownloader(BaseDownloader[BaseDownloaderOptionsT], ABC):
"""The function to perform the download of all media entries""" """The function to perform the download of all media entries"""
# download the bottom-most urls first since they are top-priority # download the bottom-most urls first since they are top-priority
for collection_url in reversed(self.collection.urls.list): for collection_url in reversed(self.collection.urls.list):
parents, orphan_entries = self._download_url_metadata(collection_url=collection_url) # URLs can be empty. If they are, then skip
if not (url := self.overrides.apply_formatter(collection_url.url)):
continue
parents, orphan_entries = self._download_url_metadata(url=url)
# TODO: Encapsulate this logic into its own class # TODO: Encapsulate this logic into its own class
self._url_state = URLDownloadState( self._url_state = URLDownloadState(

View file

@ -115,9 +115,7 @@ class TestPrebuiltTVShowPresets:
}, },
} }
if is_many_urls: if is_many_urls:
preset_dict = dict( preset_dict["overrides"]["url2"] = "https://url.number.2.here"
preset_dict, **{"download": {"urls": [{"url": "https://url.number.2.here"}]}}
)
subscription = Subscription.from_dict( subscription = Subscription.from_dict(
config=config, config=config,