Solved Display or filter subtitle languages
#1
Dear all,

I'm looking for some time now a possibility to identify easily in the Kodi interface my video files (mkv) having subtitles in english.

I have looked for a way to display the available subtitles of the movie in the fanart view like it is the case for the video resolution, the audio channels, the codecs, ... I have tried it by tagging the mkv file directly and by using nfo files but without success.

Another way to achieve my goal is to make a node displaying only the movies with a specific subtitle language. To ease it I'm using the node library editor addon. If I perfectly succeed in creating such node with other types of filters such a date, I always fail with audio and subtitle languages.

What is the best way to achieve what I'm looking for ? I have the feeling the filtering with a node is the easiest one, but I probably miss something in the logic: when I use "is not", the result is empty, when I use "is" it provides all movies without filtering...

Many thanks in advance for your help !
Reply
#2
Once videos are properly scraped or played, their video details are stored in Kodi's video database.
So that means a 'simple' query should get you your answer.

Are you referring to internal or external subtitles? Internal ones should be recognized right away, external ones not so much.
Reply
#3
(2020-09-04, 19:35)Klojum Wrote: Once videos are properly scraped or played, their video details are stored in Kodi's video database.
So that means a 'simple' query should get you your answer.

Are you referring to internal or external subtitles? Internal ones should be recognized right away, external ones not so much.

Thanks a lot for your feedback.

It's all about internal subtitles. Several videos have been played already; I'm not sure what scraped means (it reaches the limits of my English knowledge :-) ) but all videos have been correctly identified during the library update and got the information from TheMovieDB.

I have never been in the Kodi DB but probably a good idea to check what information is present there. As I succeed making node filters on other types of info I indeed have the feeling the audio and subtitle languages info is not in the DB... I'll check that.
Reply
#4
(2020-09-04, 20:58)TouFou Wrote: I'm not sure what scraped means (it reaches the limits of my English knowledge :-) )
'Scraping' is retrieving metadata from data providers such as TheMovieDB or TheTVDB.

(2020-09-04, 20:58)TouFou Wrote: I have never been in the Kodi DB but probably a good idea to check what information is present there.
Okay... In such cases it's best to recommend "SQL for Dummies". Nothing personal, but SQL is basically a programming language for database servers. It's also different from other programming languages for applications. In general, the Dummies books are quite good.

But .. you first need to get a DB browser of some sorts.
For the default Kodi SQLite databases, you can try DB Browser for SQLite.
For remote MySQL database access, I prefer MySQL Workbench.

If you have the tool running, try running this query:
sql:
# SUBTITLES PER MOVIE
SELECT
m.c00 AS film,
s.strSubtitleLanguage AS lang
FROM
MyVideos116.movie m,
MyVideos116.streamdetails s
WHERE
m.idFile = s.idFile
AND
(s.strSubtitleLanguage IS NOT NULL
AND
s.strSubtitleLanguage <> "")
ORDER BY
c00 ASC
Reply
#5
(2020-09-04, 21:29)Klojum Wrote:
(2020-09-04, 20:58)TouFou Wrote: I'm not sure what scraped means (it reaches the limits of my English knowledge :-) )
'Scraping' is retrieving metadata from data providers such as TheMovieDB or TheTVDB.
(2020-09-04, 20:58)TouFou Wrote: I have never been in the Kodi DB but probably a good idea to check what information is present there.
Okay... In such cases it's best to recommend "SQL for Dummies". Nothing personal, but SQL is basically a programming language for database servers. It's also different from other programming languages for applications. In general, the Dummies books are quite good.

But .. you first need to get a DB browser of some sorts.
For the default Kodi SQLite databases, you can try DB Browser for SQLite.
For remote MySQL database access, I prefer MySQL Workbench.

If you have the tool running, try running this query:
sql:
# SUBTITLES PER MOVIE
SELECT
m.c00 AS film,
s.strSubtitleLanguage AS lang
FROM
MyVideos116.movie m,
MyVideos116.streamdetails s
WHERE
m.idFile = s.idFile
AND
(s.strSubtitleLanguage IS NOT NULL
AND
s.strSubtitleLanguage <> "")
ORDER BY
c00 ASC
Problem solved ! The string I was using as filter was not the right one...

What did I face ?
1/ I was not sure at the beginning of what string to use: English, english, eng, en, etc. I tried several ones but at the time I tried them I made a mistake and 2 conflicting filters were applying... and I forgot to try them again after I solved that. So at the end the right string is "eng"
2/ I struggled a little about the DB. It's the default Kodi one (SQLite) local to a LibreElec system. I had first to understand that SQLite is, unlike MsSQL and Oracle I know, not accessible remotely ! I therefore copied the MyVideos116.db locally on my Windows PC, used as you recommended the "DB Browser for SQLite", get rid of the DB info in your script and then got its result... which made my mistake obvious !

Thanks a lot again for your great support !
Reply
#6
Yeah, I use MySQL and not the SQLite databases. The MyVideos116 references are obsolete in SQLite.

One last request: use the Quote button wisely. It's hardly always necessary to quote an entire post, for what mostly is a reply of one or two lines.

You can select/mark the text you want to react to with your mouse, and a Reply option will appear in the bottom left of that post.
Then click on that Reply bar, and the selected text is pasted into your textbox reply section. Easy peasy, and it avoids forum/thread cluttering.
Reply
#7
Thread marked solved.
Reply
#8
Yep we use the ISO 639-2 language codes see https://www.loc.gov/standards/iso639-2/p...e_list.php for full list.
Reply

Logout Mark Read Team Forum Stats Members Help
Display or filter subtitle languages0