From 048307e4299106ea2340bed72fce8207859d5fa9 Mon Sep 17 00:00:00 2001 From: Vitiko Date: Thu, 23 Dec 2021 19:45:26 -0400 Subject: Update embeddedsubtitles provider: use original_path instead of name --- libs/subliminal_patch/providers/embeddedsubtitles.py | 6 +++++- libs/subliminal_patch/video.py | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/subliminal_patch/providers/embeddedsubtitles.py b/libs/subliminal_patch/providers/embeddedsubtitles.py index aa8927fd6..d634eb735 100644 --- a/libs/subliminal_patch/providers/embeddedsubtitles.py +++ b/libs/subliminal_patch/providers/embeddedsubtitles.py @@ -142,7 +142,11 @@ class EmbeddedSubtitlesProvider(Provider): return subtitles def list_subtitles(self, video, languages): - return self.query(video.name, languages) + if not os.path.isfile(video.original_path): + logger.debug("Ignoring inexistent file: %s", video.original_path) + return [] + + return self.query(video.original_path, languages) def download_subtitle(self, subtitle): path = self._get_subtitle_path(subtitle) diff --git a/libs/subliminal_patch/video.py b/libs/subliminal_patch/video.py index 00260c058..b58c452be 100644 --- a/libs/subliminal_patch/video.py +++ b/libs/subliminal_patch/video.py @@ -28,3 +28,4 @@ class Video(Video_): self.external_subtitle_languages = set() self.streaming_service = streaming_service self.edition = edition + self.original_path = name -- cgit v1.2.3