Skip to content

Commit

Permalink
[service.languagepreferencemanager] 1.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
rockrider69 committed Apr 7, 2024
1 parent a9b6d67 commit fad7187
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 20 deletions.
10 changes: 3 additions & 7 deletions service.languagepreferencemanager/addon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<addon
id="service.languagepreferencemanager"
name="Language Preference Manager"
version="1.0.3"
version="1.0.4"
provider-name="ace20022/scott967/rockrider69"
>
<requires>
Expand All @@ -17,12 +17,7 @@
<description lang="en_GB">Sets the audio and subtitle track according to your language preferences</description>
<disclaimer lang="en_GB">For bugs, requests or general questions visit the Language Preference Manager thread on the Kodi forum.</disclaimer>
<platform>all</platform>
<news>0.1.3 : Updated with changes required for Kodi 19 / Python 3 + Fixed Languages labels/tables, ConditionnalSubs to None, Custom settings
0.1.4BETA : Conditional Subtitles rules are re-assessed on-the-fly when toggling audio tracks
0.1.5 : Some minor optimisation
0.1.6 : Fix Custom CondSubs not working. Switch to ignore 'Signs' tracks. Add special 'Any' audio language code. Fix some typos
0.1.7BETA : New Keywords Blacklist to ignore chosen subtitles tracks based on name content.
1.0.0 : Mandatory clean-up to propose as candidate version for Kodi.tv addons repository.
<news>1.0.0 : Mandatory clean-up to propose as candidate version for Kodi.tv addons repository.
1.0.1 : Initial version for main Kodi.tv addons repository
1.0.2 : Fix 10sec latency on subs display and possible few lines lost - at video start or when switching audio.
Forced sub tracks : check also subtitle field "isforced" in case field "name" is empty or misspelled.
Expand All @@ -31,6 +26,7 @@
New Keywords Blacklist for Audio tracks. Same principle as for Subtitles, based on track name, to skip some (ex. Commentary, ...)
Fix Greek and Serbian language codes according to iso639-2/T. Fix some typos.
Fix multiple 3 digit codes per language (ex. German ger,deu). Now OK also for Conditional Subtitles preferences.
1.0.4 : Fix and simplify SignsSongs subtagging (was colliding with language codes subtagging ie. pt-br). Thanks to BrutuZ!

</news>
<assets>
Expand Down
4 changes: 4 additions & 0 deletions service.languagepreferencemanager/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
--- Version 1.0.4

- Fix and simplify Signs & Songs subtagging (was colliding with language codes subtagging ie. pt-br). Thanks to BrutuZ!

--- Version 1.0.3

- Improve 10sec subs latency workaround: new option to disable it (default), or enable it at 'start only' or 'start+resume'.
Expand Down
17 changes: 5 additions & 12 deletions service.languagepreferencemanager/resources/lib/prefparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def __init__( self ):
self.custom_g_t_pref_delim = r'#'
self.custom_g_t_delim = r','
self.custom_condSub_delim = r':'
self.custom_subtag_delim = r'-'

def parsePrefString(self, pref_string):
preferences = []
Expand Down Expand Up @@ -81,17 +80,11 @@ def parsePref(self, prefs):
else:
temp_a = (languageTranslate(pref[0], 3, 0), pref[0])
# Searching if a sub tag is present (like Eng:Eng-ss to prioritize Signs&Songs tracks)
ss_tag = 'false'
if (pref[1].find(self.custom_subtag_delim) > 0):
st_pref = pref[1].split(self.custom_subtag_delim)
if len(st_pref) != 2:
print('Custom cond subs prefs parse error: {0}'.format(pref))
else:
if (st_pref[1] == 'ss'):
ss_tag = 'true'
else:
self.log(LOG_INFO, 'Custom cond subs prefs parse error: {0}. Unknown sub tag is ignored'.format(pref))
pref[1] = st_pref[0]
if pref[1].endswith('-ss'):
ss_tag = 'true'
pref[1] = pref[1].rstrip('-ss')
else:
ss_tag = 'false'
temp_s = (languageTranslate(pref[1], 3, 0), pref[1])
if (temp_a[0] and temp_a[1] and temp_s[0] and temp_s[1]):
if (temp_s[1] == 'non'):
Expand Down
6 changes: 5 additions & 1 deletion service.languagepreferencemanager/resources/lib/prefutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,11 @@ def evalSubPrefs(self, sub_prefs):

log(LOG_INFO,'Subtitle: genre/tag preference {0} met with intersection {1}'.format(g_t, (self.genres_and_tags & g_t)))
for pref in preferences:
name, codes, forced = pref
if len(pref) == 2:
name, codes = pref
forced = 'false'
else:
name, codes, forced = pref
codes = codes.split(r',')
for code in codes:
if (code is None):
Expand Down

0 comments on commit fad7187

Please sign in to comment.