Posts: 182
Joined: Sep 2016
Reputation:
16
SEIKT
Senior Member
Posts: 182
2021-12-06, 02:25
(This post was last modified: 2021-12-11, 03:34 by SEIKT.)
I'll try it out and let you know. I think the for loop should stop scanning for languages in the string when the year in the string appears. Otherwise, the possibility of incorrect language identification is still present. If no language is identified up to that point maybe default to the user's default language in case they have forgotten to append the language to the subtitles filename or set the language to unknown.
Posts: 182
Joined: Sep 2016
Reputation:
16
SEIKT
Senior Member
Posts: 182
2021-12-06, 02:32
(This post was last modified: 2021-12-06, 02:33 by SEIKT.)
And some other ideas:
Optional parameters for setSubtitles:
1. Video name: Pass the video name so that it can be removed from the subtitles string to improve match accuracy
2. Name preference of subtitles as shown in the GUI: either as only the language detected or the subtitles filename
Posts: 2,474
Joined: Sep 2006
Reputation:
338
2021-12-11, 05:18
(This post was last modified: 2021-12-11, 05:23 by matthuisman.)
The flag relates to forced and or default.
64 is decimal of the hex flag for forced (0x0040)
Posts: 182
Joined: Sep 2016
Reputation:
16
SEIKT
Senior Member
Posts: 182
Understood. Cheers for the insight. Would you mind creating a pull request? Seems the devs gave up on this thread.
Posts: 5,435
Joined: Jul 2012
Reputation:
378
Don't we still have a problem that the requirement is to get the filename of the video item and strip that from the subtitle filename prior to parsing for the language? What this has done is better, but I think in the case of No Time To Die.chs.srt for example, chs isn't recognized by Kodi (unless added by user in advancedsettings) so instead of getting language "unknown" it will still return "Norwegian". (I use chs as example as it seems to be a common work around for limitations of using ISO 639 language codes.)
scott s.
.
Posts: 2,474
Joined: Sep 2006
Reputation:
338
That is way out of scope of this issue.
You'd need to make your own PR adding more language codes etc