mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Creating special exception for applicatoni/x-subrip mimetype.
This commit is contained in:
parent
d3074eb3d8
commit
1b4d4d7ad5
2 changed files with 5 additions and 2 deletions
|
|
@ -220,6 +220,9 @@ def _mimetype_suffix_map(path: Path, mimetype: str):
|
|||
return 'application/vnd.amazon.mobi8-ebook'
|
||||
if suffix.endswith('.obj'):
|
||||
return 'model/obj'
|
||||
if mimetype == 'application/x-subrip':
|
||||
# Fallback to old mimetype.
|
||||
return 'text/srt'
|
||||
return mimetype
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ async def test__upsert_files(test_session, make_files_structure, test_directory,
|
|||
assert_file_groups([
|
||||
{'primary_path': video_file, 'idempotency': idempotency, 'modification_datetime': foo_mtime, 'indexed': False,
|
||||
'files': [
|
||||
{'path': srt_file3, 'size': 951, 'suffix': '.en.srt', 'mimetype': 'application/x-subrip'},
|
||||
{'path': srt_file3, 'size': 951, 'suffix': '.en.srt', 'mimetype': 'text/srt'},
|
||||
{'path': video_file, 'size': 1056318, 'suffix': '.mp4', 'mimetype': 'video/mp4'},
|
||||
]},
|
||||
{'primary_path': bar, 'idempotency': idempotency, 'indexed': False,
|
||||
|
|
@ -210,7 +210,7 @@ async def test__upsert_files(test_session, make_files_structure, test_directory,
|
|||
assert_file_groups([
|
||||
{'primary_path': video_file, 'idempotency': idempotency, 'modification_datetime': foo_mtime, 'indexed': True,
|
||||
'files': [
|
||||
{'path': srt_file3, 'size': 951, 'suffix': '.en.srt', 'mimetype': 'application/x-subrip'},
|
||||
{'path': srt_file3, 'size': 951, 'suffix': '.en.srt', 'mimetype': 'text/srt'},
|
||||
{'path': video_file, 'size': 1056318, 'suffix': '.mp4', 'mimetype': 'video/mp4'},
|
||||
]},
|
||||
{'primary_path': bar, 'idempotency': idempotency, 'indexed': False,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue