Skip to content

Commit

Permalink
release: v3.18.2
Browse files Browse the repository at this point in the history
  • Loading branch information
xZetsubou authored and newt-sc committed Nov 2, 2024
1 parent 182235d commit 0f00940
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* [v3.18.2](https://github.com/newt-sc/a4kSubtitles/releases/tag/service.subtitles.a4ksubtitles%2Fservice.subtitles.a4ksubtitles-3.18.2):
* SubSource: Fix foreign languages

* [v3.18.1](https://github.com/newt-sc/a4kSubtitles/releases/tag/service.subtitles.a4ksubtitles%2Fservice.subtitles.a4ksubtitles-3.18.1):
* Fix IMDB ID not found

Expand Down
17 changes: 17 additions & 0 deletions a4kSubtitles/services/subsource.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,20 @@
__search = __api + "searchMovie"
__download = __api + "downloadSub/"

ss_to_code = {
"Big 5 code": "zh",
"Brazilian Portuguese": "pt-BR",
"Bulgarian": "bg",
"Chinese BG code": "zh",
"Farsi/Persian": "fa",
"Chinese(Simplified)": "zh-Hans",
"Chinese(Traditional)": "zh-Hant",
"French(France)": "fr-FR",
"Icelandic": "is",
"Spanish(Latin America)": "es-419",
"Spanish(Spain)": "es-ES"
}

def build_search_requests(core, service_name, meta):
def get_movie(response):
results = response.json()
Expand Down Expand Up @@ -58,6 +72,9 @@ def map_result(result):
name = result.get("releaseName", "")
lang = result.get("lang")

if lang in ss_to_code:
lang = core.kodi.xbmc.convertLanguage(ss_to_code[lang], core.kodi.xbmc.ENGLISH_NAME)

if lang not in meta.languages:
return None

Expand Down
5 changes: 4 additions & 1 deletion addon.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="service.subtitles.a4ksubtitles"
name="a4kSubtitles"
version="3.18.1"
version="3.18.2"
provider-name="Unknown">
<requires>
<import addon="script.module.requests"/>
Expand All @@ -27,6 +27,9 @@ Supports: OpenSubtitles, BSPlayer, Podnadpisi.NET, SubDL, Addic7ed
<screenshot>screenshot-03.png</screenshot>
</assets>
<news>
[v3.18.2]:
* SubSource: Fix foreign languages

[v3.18.1]:
* Fix IMDB ID not found

Expand Down
5 changes: 4 additions & 1 deletion packages/addons.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<addons>
<addon id="service.subtitles.a4ksubtitles"
name="a4kSubtitles"
version="3.18.1"
version="3.18.2"
provider-name="Unknown">
<requires>
<import addon="script.module.requests"/>
Expand All @@ -30,6 +30,9 @@ Supports: OpenSubtitles, BSPlayer, Podnadpisi.NET, SubDL, Addic7ed
<screenshot>screenshot-03.png</screenshot>
</assets>
<news>
[v3.18.2]:
* SubSource: Fix foreign languages

[v3.18.1]:
* Fix IMDB ID not found

Expand Down
2 changes: 1 addition & 1 deletion packages/addons.xml.crc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f25ab410db7f2fa919a10fba60723f58f8742576
e03a251d45a110a157656eb8241273cee119ff32

0 comments on commit 0f00940

Please sign in to comment.