diff --git a/custom_libs/subliminal_patch/providers/animetosho.py b/custom_libs/subliminal_patch/providers/animetosho.py index 1fb791e86..9cd3d80b9 100644 --- a/custom_libs/subliminal_patch/providers/animetosho.py +++ b/custom_libs/subliminal_patch/providers/animetosho.py @@ -141,7 +141,8 @@ class AnimeToshoProvider(Provider, ProviderSubtitleArchiveMixin): for subtitle_file in subtitle_files: hex_id = format(subtitle_file['id'], '08x') - lang = Language.fromalpha3b(subtitle_file['info']['lang']) + # Animetosho assumes missing languages as english as fallback when not specified. + lang = Language.fromalpha3b(subtitle_file['info'].get('lang', 'eng')) # For Portuguese and Portuguese Brazilian they both share the same code, the name is the only # identifier AnimeTosho provides. Also, some subtitles does not have name, in this case it could diff --git a/custom_libs/subliminal_patch/providers/embeddedsubtitles.py b/custom_libs/subliminal_patch/providers/embeddedsubtitles.py index 002f439b7..2d8a492c7 100644 --- a/custom_libs/subliminal_patch/providers/embeddedsubtitles.py +++ b/custom_libs/subliminal_patch/providers/embeddedsubtitles.py @@ -112,7 +112,11 @@ class EmbeddedSubtitlesProvider(Provider): # Default is True container.FFMPEG_STATS = False - tags.LANGUAGE_FALLBACK = self._fallback_lang if self._unknown_as_fallback and self._fallback_lang else None + tags.LANGUAGE_FALLBACK = ( + self._fallback_lang + if self._unknown_as_fallback and self._fallback_lang + else None + ) logger.debug("Language fallback set: %s", tags.LANGUAGE_FALLBACK) def initialize(self): @@ -194,7 +198,7 @@ class EmbeddedSubtitlesProvider(Provider): def download_subtitle(self, subtitle: EmbeddedSubtitle): try: path = self._get_subtitle_path(subtitle) - except KeyError: # TODO: add MustGetBlacklisted support + except KeyError: # TODO: add MustGetBlacklisted support logger.error("Couldn't get subtitle path") return None @@ -229,6 +233,7 @@ class EmbeddedSubtitlesProvider(Provider): timeout=self._timeout, fallback_to_convert=True, basename_callback=_basename_callback, + progress_callback=lambda d: logger.debug("Progress: %s", d), ) # Add the extracted paths to the containter path key self._cached_paths[container.path] = extracted diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 38d3e3f76..b8b546e04 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -9,12 +9,12 @@ "version": "1.0.0", "license": "GPL-3", "dependencies": { - "@mantine/core": "^7.11.0", - "@mantine/dropzone": "^7.11.0", - "@mantine/form": "^7.11.0", - "@mantine/hooks": "^7.11.0", - "@mantine/modals": "^7.11.0", - "@mantine/notifications": "^7.11.0", + "@mantine/core": "^7.11.1", + "@mantine/dropzone": "^7.11.1", + "@mantine/form": "^7.11.1", + "@mantine/hooks": "^7.11.1", + "@mantine/modals": "^7.11.1", + "@mantine/notifications": "^7.11.1", "@tanstack/react-query": "^5.40.1", "@tanstack/react-table": "^8.19.2", "axios": "^1.6.8", @@ -2967,9 +2967,9 @@ } }, "node_modules/@mantine/core": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@mantine/core/-/core-7.11.0.tgz", - "integrity": "sha512-yw2Llww9mw8rDWZtucdEuvkqqjHdreUibos7JCUpejL721FW1Tn9L91nsxO/YQFSS7jn4Q0CP+1YbQ/PMULmwA==", + "version": "7.11.1", + "resolved": "https://registry.npmjs.org/@mantine/core/-/core-7.11.1.tgz", + "integrity": "sha512-qEwe5ijBe3MWOg4yerJ+HXMugIBtS1Bbqbdnfrg2cuHXr+2paqu8SQMzldtzqfiLsRajOtkokOkY67jUJOacCA==", "dependencies": { "@floating-ui/react": "^0.26.9", "clsx": "^2.1.1", @@ -2979,7 +2979,7 @@ "type-fest": "^4.12.0" }, "peerDependencies": { - "@mantine/hooks": "7.11.0", + "@mantine/hooks": "7.11.1", "react": "^18.2.0", "react-dom": "^18.2.0" } @@ -2996,23 +2996,23 @@ } }, "node_modules/@mantine/dropzone": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@mantine/dropzone/-/dropzone-7.11.0.tgz", - "integrity": "sha512-8vZgm8+NlBrQFJlWckaoqz55zjk8GVX0GDn1bZUunUtIJ5uv/wJPAInq3IlRdzvWVfz5MA+4oxd32fa5oxsBSA==", + "version": "7.11.1", + "resolved": "https://registry.npmjs.org/@mantine/dropzone/-/dropzone-7.11.1.tgz", + "integrity": "sha512-Jvn+ikhT1GtQq3EMAYWK+1lk6CVDeB1Ykok7oUjTWPZDYAcQkLDNfPpFLqrbPPYSMav0u67zzaq9fUVTYVVhew==", "dependencies": { "react-dropzone-esm": "15.0.1" }, "peerDependencies": { - "@mantine/core": "7.11.0", - "@mantine/hooks": "7.11.0", + "@mantine/core": "7.11.1", + "@mantine/hooks": "7.11.1", "react": "^18.2.0", "react-dom": "^18.2.0" } }, "node_modules/@mantine/form": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@mantine/form/-/form-7.11.0.tgz", - "integrity": "sha512-BmkzRp57O1zZuxCYH76w6zeBNhczq7OeRtkG/zvMo35BJp1K5u8eetN3AC1WwkGLmrNid2BCIsvTFHDP9DYnaQ==", + "version": "7.11.1", + "resolved": "https://registry.npmjs.org/@mantine/form/-/form-7.11.1.tgz", + "integrity": "sha512-d14Rrx4Yid3/sDPvRHt5mYK37PWedflwbxWO0vJ98qpYFUGunw9pTm7dmPNoUoj4fHGX9b0F+TWuM4zXs2wAwg==", "dependencies": { "fast-deep-equal": "^3.1.3", "klona": "^2.0.6" @@ -3022,43 +3022,43 @@ } }, "node_modules/@mantine/hooks": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@mantine/hooks/-/hooks-7.11.0.tgz", - "integrity": "sha512-T3472GhUXFhuhXUHlxjHv0wfb73lFyNuaw631c7Ddtgvewq0WKtNqYd7j/Zz/k02DuS3r0QXA7e12/XgqHBZjg==", + "version": "7.11.1", + "resolved": "https://registry.npmjs.org/@mantine/hooks/-/hooks-7.11.1.tgz", + "integrity": "sha512-28WS/U6QL4jaIHf1uFpny5Tglu9MoyyM4bWLmIcAQHtOD3YHpuNvs9OTWLqKAQs6VN+kydlxvjvT+w1LBWEpQg==", "peerDependencies": { "react": "^18.2.0" } }, "node_modules/@mantine/modals": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@mantine/modals/-/modals-7.11.0.tgz", - "integrity": "sha512-I4bxdXirLNvVbmVcS9lhU9z1bknE8XlteGeSxAZ00SLUk9EowG+AX/9nK0TrSG2GBNDX82fFxp2z98/o7bTw5w==", + "version": "7.11.1", + "resolved": "https://registry.npmjs.org/@mantine/modals/-/modals-7.11.1.tgz", + "integrity": "sha512-SDHhpt7O+Y8rTW5RaXFqIIjuD87efUqhC5kxqLyRsuivQ+tk4gMY37R5gR8o0yC6vifKBzjjYVFeeGTLocRTBg==", "peerDependencies": { - "@mantine/core": "7.11.0", - "@mantine/hooks": "7.11.0", + "@mantine/core": "7.11.1", + "@mantine/hooks": "7.11.1", "react": "^18.2.0", "react-dom": "^18.2.0" } }, "node_modules/@mantine/notifications": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@mantine/notifications/-/notifications-7.11.0.tgz", - "integrity": "sha512-UtAHJoSi4s+lfVZrkUDWMlg6j0w1LZaiMEOBMG9p5MV5dP38W75LeCy2cio2Znji2S5YzXaZolOkHBT5ZONKAw==", + "version": "7.11.1", + "resolved": "https://registry.npmjs.org/@mantine/notifications/-/notifications-7.11.1.tgz", + "integrity": "sha512-4MpuePstpWvCwiEX75oUAdxp3SXWsiq0+fd4zb5YMu+CaqiaDbUIOupEpi/uCez3lYhY0ojHyjNgYsqZ7cy1Fg==", "dependencies": { - "@mantine/store": "7.11.0", + "@mantine/store": "7.11.1", "react-transition-group": "4.4.5" }, "peerDependencies": { - "@mantine/core": "7.11.0", - "@mantine/hooks": "7.11.0", + "@mantine/core": "7.11.1", + "@mantine/hooks": "7.11.1", "react": "^18.2.0", "react-dom": "^18.2.0" } }, "node_modules/@mantine/store": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@mantine/store/-/store-7.11.0.tgz", - "integrity": "sha512-zPmOpdFgvkUqYKSK7NNKbhgXsh2QPw51m3iypTaj0mw+rZbk3WSH9vZvaEx59X0QG+ahwUg2/HezbjfXFUbvrA==", + "version": "7.11.1", + "resolved": "https://registry.npmjs.org/@mantine/store/-/store-7.11.1.tgz", + "integrity": "sha512-5xOompA7pADDvYlw6KEr0YIr95bdFI0W/KZizi8E/BKOLVUpku1UvqcClodq4U0Xjz5eZt/Jf3gEV9lyJbt8Zw==", "peerDependencies": { "react": "^18.2.0" } diff --git a/frontend/package.json b/frontend/package.json index 0d3c0546e..221d3a97d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -13,12 +13,12 @@ }, "private": true, "dependencies": { - "@mantine/core": "^7.11.0", - "@mantine/dropzone": "^7.11.0", - "@mantine/form": "^7.11.0", - "@mantine/hooks": "^7.11.0", - "@mantine/modals": "^7.11.0", - "@mantine/notifications": "^7.11.0", + "@mantine/core": "^7.11.1", + "@mantine/dropzone": "^7.11.1", + "@mantine/form": "^7.11.1", + "@mantine/hooks": "^7.11.1", + "@mantine/modals": "^7.11.1", + "@mantine/notifications": "^7.11.1", "@tanstack/react-query": "^5.40.1", "@tanstack/react-table": "^8.19.2", "axios": "^1.6.8", diff --git a/frontend/src/components/TextPopover.tsx b/frontend/src/components/TextPopover.tsx index 974c0d0c0..03dd58700 100644 --- a/frontend/src/components/TextPopover.tsx +++ b/frontend/src/components/TextPopover.tsx @@ -25,7 +25,7 @@ const TextPopover: FunctionComponent = ({ opened={hovered} label={text} {...tooltip} - style={{ textWrap: "pretty" }} + style={{ textWrap: "wrap" }} >
{children}
diff --git a/libs/fese-0.2.9.dist-info/RECORD b/libs/fese-0.2.9.dist-info/RECORD deleted file mode 100644 index e30fae26a..000000000 --- a/libs/fese-0.2.9.dist-info/RECORD +++ /dev/null @@ -1,13 +0,0 @@ -fese-0.2.9.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 -fese-0.2.9.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149 -fese-0.2.9.dist-info/METADATA,sha256=nJz9q6FwX7fqmsO3jgM0ZgV0gsCeILWoxVRUqCbJkFI,655 -fese-0.2.9.dist-info/RECORD,, -fese-0.2.9.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 -fese-0.2.9.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92 -fese-0.2.9.dist-info/top_level.txt,sha256=ra2BuARVEUZpk76YpHnjVoqjR2FxvzhCdmW2OyBWGzE,5 -fese/__init__.py,sha256=_YUpx7sq26ioEp5LZOEKa-0MrRHQUuRuDCs0EQ6Amv4,150 -fese/container.py,sha256=sLuxP0vlba4iGVohGfYtd-QcjQ-YxMU6lqMOM-Wtqlc,10340 -fese/disposition.py,sha256=hv4YmXpsvKmUdpeWvSrZkhKgtZLZ8t56dmwMddsqxus,2156 -fese/exceptions.py,sha256=VZaubpq8SPpkUGp28Ryebsf9YzqbKK62nni6YZgDPYI,372 -fese/stream.py,sha256=Hgf6-amksHpuhSoY6SL6C3q4YtGCuRHl4fusBWE9nBE,4866 -fese/tags.py,sha256=qKkcjJmCKgnXIbZ9x-nngCNYAfv5cbJZ4A6EP0ckZME,5454 diff --git a/libs/fese-0.2.9.dist-info/INSTALLER b/libs/fese-0.3.0.dist-info/INSTALLER similarity index 100% rename from libs/fese-0.2.9.dist-info/INSTALLER rename to libs/fese-0.3.0.dist-info/INSTALLER diff --git a/libs/fese-0.2.9.dist-info/LICENSE b/libs/fese-0.3.0.dist-info/LICENSE similarity index 100% rename from libs/fese-0.2.9.dist-info/LICENSE rename to libs/fese-0.3.0.dist-info/LICENSE diff --git a/libs/fese-0.2.9.dist-info/METADATA b/libs/fese-0.3.0.dist-info/METADATA similarity index 97% rename from libs/fese-0.2.9.dist-info/METADATA rename to libs/fese-0.3.0.dist-info/METADATA index 85f1cd160..8c8782450 100644 --- a/libs/fese-0.2.9.dist-info/METADATA +++ b/libs/fese-0.3.0.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: fese -Version: 0.2.9 +Version: 0.3.0 Summary: A library to extract FFmpeg subtitle streams Author-email: Vitiko Nogales Requires-Python: >=3.7 diff --git a/libs/fese-0.3.0.dist-info/RECORD b/libs/fese-0.3.0.dist-info/RECORD new file mode 100644 index 000000000..55deffc5a --- /dev/null +++ b/libs/fese-0.3.0.dist-info/RECORD @@ -0,0 +1,13 @@ +fese-0.3.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 +fese-0.3.0.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149 +fese-0.3.0.dist-info/METADATA,sha256=Y6rn3cPjHc2ySJrSnUAuXxahgSFs2YoAivSIgJqi40M,655 +fese-0.3.0.dist-info/RECORD,, +fese-0.3.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0 +fese-0.3.0.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91 +fese-0.3.0.dist-info/top_level.txt,sha256=ra2BuARVEUZpk76YpHnjVoqjR2FxvzhCdmW2OyBWGzE,5 +fese/__init__.py,sha256=_YUpx7sq26ioEp5LZOEKa-0MrRHQUuRuDCs0EQ6Amv4,150 +fese/container.py,sha256=zhUNLut9Tdy_oPa6gCophUekTQegGWbHdbd1prR5aHg,10443 +fese/disposition.py,sha256=hv4YmXpsvKmUdpeWvSrZkhKgtZLZ8t56dmwMddsqxus,2156 +fese/exceptions.py,sha256=VZaubpq8SPpkUGp28Ryebsf9YzqbKK62nni6YZgDPYI,372 +fese/stream.py,sha256=Hgf6-amksHpuhSoY6SL6C3q4YtGCuRHl4fusBWE9nBE,4866 +fese/tags.py,sha256=1v-CLuyEZ2tL-TVtOXY8nbo7a3jFwq6fTFDHtFjdnow,5554 diff --git a/libs/fese-0.2.9.dist-info/REQUESTED b/libs/fese-0.3.0.dist-info/REQUESTED similarity index 100% rename from libs/fese-0.2.9.dist-info/REQUESTED rename to libs/fese-0.3.0.dist-info/REQUESTED diff --git a/libs/fese-0.2.9.dist-info/WHEEL b/libs/fese-0.3.0.dist-info/WHEEL similarity index 65% rename from libs/fese-0.2.9.dist-info/WHEEL rename to libs/fese-0.3.0.dist-info/WHEEL index 98c0d20b7..5bea5450d 100644 --- a/libs/fese-0.2.9.dist-info/WHEEL +++ b/libs/fese-0.3.0.dist-info/WHEEL @@ -1,5 +1,5 @@ Wheel-Version: 1.0 -Generator: bdist_wheel (0.42.0) +Generator: setuptools (70.3.0) Root-Is-Purelib: true Tag: py3-none-any diff --git a/libs/fese-0.2.9.dist-info/top_level.txt b/libs/fese-0.3.0.dist-info/top_level.txt similarity index 100% rename from libs/fese-0.2.9.dist-info/top_level.txt rename to libs/fese-0.3.0.dist-info/top_level.txt diff --git a/libs/fese/container.py b/libs/fese/container.py index 21dfc20da..5f2c70371 100644 --- a/libs/fese/container.py +++ b/libs/fese/container.py @@ -54,7 +54,10 @@ def _ffmpeg_call(command, log_callback=None, progress_callback=None, timeout=100 if match: size, time_, bitrate, speed = match.groups() info = {"size": size, "time": time_, "bitrate": bitrate, "speed": speed} - progress_callback(info) + else: + info = {"size": "n/a", "time": "n/a", "bitrate": "n/a", "speed": "n/a"} + + progress_callback(info) if timeout is not None and time.time() - start > timeout: proc.kill() diff --git a/libs/fese/tags.py b/libs/fese/tags.py index b846fffea..3c4625eb1 100644 --- a/libs/fese/tags.py +++ b/libs/fese/tags.py @@ -192,4 +192,8 @@ _extra_languages = { "matches": ("pt-br", "pob", "pb", "brazilian", "brasil", "brazil"), "language_args": ("por", "BR"), }, + "fil": { + "matches": ("fil", "filipino"), + "language_args": ("tgl", "PH"), + }, } diff --git a/libs/version.txt b/libs/version.txt index 1eaf9a16a..823682624 100644 --- a/libs/version.txt +++ b/libs/version.txt @@ -10,7 +10,7 @@ charset-normalizer==3.3.2 deep-translator==1.11.4 dogpile.cache==1.3.2 dynaconf==3.2.4 -fese==0.2.9 +fese==0.3.0 ffsubsync==0.4.25 flask-cors==4.0.0 flask-migrate==4.0.5 diff --git a/tests/subliminal_patch/test_embeddedsubtitles.py b/tests/subliminal_patch/test_embeddedsubtitles.py index b7bfaa0a8..7326a368b 100644 --- a/tests/subliminal_patch/test_embeddedsubtitles.py +++ b/tests/subliminal_patch/test_embeddedsubtitles.py @@ -107,6 +107,13 @@ def fake_streams(): "tags": {"language": "eng", "title": "English"}, } ), + "tg": FFprobeSubtitleStream( + { + "index": 3, + "codec_name": "subrip", + "tags": {"language": "fil", "title": "Filipino"}, + } + ), "es_hi": FFprobeSubtitleStream( { "index": 3, @@ -192,6 +199,18 @@ def test_list_subtitles_hi_fallback_one_stream( assert subs[0].hearing_impaired == False +def test_list_subtitles_custom_language_from_fese( + video_single_language, fake_streams, mocker +): + with EmbeddedSubtitlesProvider(hi_fallback=True) as provider: + language = Language("tgl", "PH") + mocker.patch( + "subliminal_patch.providers.embeddedsubtitles._MemoizedFFprobeVideoContainer.get_subtitles", + return_value=[fake_streams["tg"]], + ) + assert provider.list_subtitles(video_single_language, {language}) + + def test_list_subtitles_hi_fallback_multiple_streams( video_single_language, fake_streams, mocker ):