mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-11-29 20:45:11 +00:00
feat(providers): let a service name the metadata provider its catalogue resolves through
This commit is contained in:
@@ -489,3 +489,21 @@ def test_a_3d_video_stays_3d_through_export_and_import(tmp_path: Path) -> None:
|
||||
svc = ImportService(import_ctx(), "EXAMPLE", "movie-1", str(export))
|
||||
movie = next(iter(svc.get_titles()))
|
||||
assert svc.get_tracks(movie).videos[0].stereo
|
||||
|
||||
|
||||
class ProviderService:
|
||||
ANIME = True
|
||||
METADATA_PROVIDER = "tmdb"
|
||||
session = SimpleNamespace(headers={})
|
||||
|
||||
|
||||
def test_the_service_metadata_provider_survives_export_and_import(tmp_path: Path) -> None:
|
||||
export = tmp_path / "export.json"
|
||||
title = make_title()
|
||||
runner = make_dl()
|
||||
runner.export_service = cast(Any, ProviderService())
|
||||
|
||||
runner.write_export(export, title, title.tracks.videos[0])
|
||||
|
||||
movie = list(ImportService(import_ctx(), "EXAMPLE", "movie-1", str(export)).get_titles())[0]
|
||||
assert (movie.metadata_provider, movie.anime) == ("tmdb", True)
|
||||
|
||||
Reference in New Issue
Block a user