mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-26 09:37:25 +00:00
delete unsupported subtitle archive files from cache
This commit is contained in:
parent
3e4a75aeca
commit
8acb488fba
4 changed files with 8 additions and 4 deletions
|
@ -255,4 +255,5 @@ class SubsSabBzProvider(Provider):
|
|||
return self.process_archive_subtitle_files(ZipFile(archive_stream), language, video, link, fps, num_cds)
|
||||
else:
|
||||
logger.error('Ignore unsupported archive %r', request.headers)
|
||||
region.delete(cache_key)
|
||||
return []
|
||||
|
|
|
@ -277,4 +277,5 @@ class SubsUnacsProvider(Provider):
|
|||
return self.process_archive_subtitle_files(SevenZipFile(archive_stream), language, video, link, fps, num_cds)
|
||||
else:
|
||||
logger.error('Ignore unsupported archive %r', request.headers)
|
||||
region.delete(cache_key)
|
||||
return []
|
||||
|
|
|
@ -25,13 +25,13 @@ from .utils import FIRST_THOUSAND_OR_SO_USER_AGENTS as AGENT_LIST
|
|||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class YavkaNetSubtitle(Subtitle):
|
||||
"""YavkaNet Subtitle."""
|
||||
provider_name = 'yavkanet'
|
||||
|
||||
def __init__(self, langauge, filename, type, video, link, fps):
|
||||
super(YavkaNetSubtitle, self).__init__(langauge)
|
||||
self.langauge = langauge
|
||||
def __init__(self, language, filename, type, video, link, fps):
|
||||
super(YavkaNetSubtitle, self).__init__(language)
|
||||
self.filename = filename
|
||||
self.page_link = link
|
||||
self.type = type
|
||||
|
@ -66,7 +66,7 @@ class YavkaNetSubtitle(Subtitle):
|
|||
|
||||
if ((video_filename == subtitle_filename) or
|
||||
(self.single_file is True and video_filename in self.notes.upper())):
|
||||
matches.add('hash')
|
||||
matches.add('hash')
|
||||
|
||||
if video.year and self.year == video.year:
|
||||
matches.add('year')
|
||||
|
@ -212,4 +212,5 @@ class YavkaNetProvider(Provider):
|
|||
return self.process_archive_subtitle_files(ZipFile(archive_stream), language, video, link, fps)
|
||||
else:
|
||||
logger.error('Ignore unsupported archive %r', request.headers)
|
||||
region.delete(cache_key)
|
||||
return []
|
||||
|
|
|
@ -178,6 +178,7 @@ class YifySubtitlesProvider(Provider):
|
|||
self._process_archive(ZipFile(archive_stream), subtitle)
|
||||
else:
|
||||
logger.error('Ignore unsupported archive %r', request.headers)
|
||||
region.delete(cache_key)
|
||||
|
||||
def _process_archive(self, archive_stream, subtitle):
|
||||
for file_name in archive_stream.namelist():
|
||||
|
|
Loading…
Reference in a new issue