ListItem.SubtitleLanguage

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
cruzannavy Offline
Senior Member
Posts: 228
Joined: Dec 2010
Reputation: 10
Post: #1
does ListItem.SubtitleLanguage actually work ? i cant seem to get this to work no matter how many way i try it. Isnt it suppossed to return a 3 digit character set . ie eng ?

How would one go about implementing this ie , in dialogvideoinfo or in any view? thank you in advance.
XBMC 10.1
find quote
Hitcher Offline
Skilled Skinner
Posts: 10,818
Joined: Aug 2007
Reputation: 101
Location: Eastleigh, UK
Post: #2
From the other post -

Hitcher Wrote:Works just like any other label -

[Image: screenshot001be.jpg]
find quote
cruzannavy Offline
Senior Member
Posts: 228
Joined: Dec 2010
Reputation: 10
Post: #3
Hitcher Wrote:From the other post -

can you send me the xml or tell me which skin and xml this is so i can see how it is used to see why mine isnt working... thank you
or just post a snip of the code where you have it implemented. thanks

Im trying to add this to my confluence but doesn't return anything , it always stays blank no matter what language or type of sub i use. thanks
find quote
Hitcher Offline
Skilled Skinner
Posts: 10,818
Joined: Aug 2007
Reputation: 101
Location: Eastleigh, UK
Post: #4
I simply replaced ListItem.Label2 with ListItem.SubtitleLanguage for that test.

Have you enabled extraction of the meta data?
find quote
cruzannavy Offline
Senior Member
Posts: 228
Joined: Dec 2010
Reputation: 10
Post: #5
Just to be sure where would i verfiy this? or how would i enable / disable that?
find quote
cruzannavy Offline
Senior Member
Posts: 228
Joined: Dec 2010
Reputation: 10
Post: #6
ah i think i know what the problem is , i replaced my label 2 like yours and some populated, so i wne ta nd cheked those files and in those folders there was a movie.nfo, and in the nfo it told it what language to tell xbmc the subtitle was in. but what i was hoping for , is that xbmc would pick up ie Fight Club.srt or somethign to that matter and tell me it found that. not jsut look in the nfo, because most of my subtitles are downloaded via , xbmc subtitles, after teh fact and that info does not get pushed to the nfo. is there a way to force xbmc to knwo that you have the subtitle and to populate the nfo saying as that you downloaded one with the same naming convention??
find quote
cruzannavy Offline
Senior Member
Posts: 228
Joined: Dec 2010
Reputation: 10
Post: #7
or is there a way to tell xbmc. to look in that directory and if there is a xxxxx.srt return a yes or eng?

I looked at the python for xbmc subtitles and it has a code in there to do jsut that but how or could i extract that data to simply tell xmbc to post an image or a label saying yes it found the subtitle just like xbmc subtitle does ( it post a label saying u already have a subtitle downloaded?) thanks for any guidance
find quote
cruzannavy Offline
Senior Member
Posts: 228
Joined: Dec 2010
Reputation: 10
Post: #8
anyone? what i would like to do, is use maybe use Listitem.path ( or filename or filenameandpath) and then see if there is a xxxx.srt or any of the other supported subtitle extensions in that folder and if there is , return an image or a true ( then i can set the true to an image) basically i want add a subtitle flag along with the video aspect audio flags for my library and dialog views. so when i am scrolling through my library i an have a CC ( closed caption image ) displayed next to my other flags. any help would be great. i am familiar with modding skins. thank you
find quote
ronie Offline
Team-Kodi Member
Posts: 9,214
Joined: Jan 2009
Reputation: 158
Post: #9
i doubt there's a 'hacky' way to get around the issue.
checking for file existence from within the skin is not supported afaik.

there's a feature request on trac for external sub detection:
http://trac.xbmc.org/ticket/8472

Always read the Kodi online-manual, FAQ and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
cruzannavy Offline
Senior Member
Posts: 228
Joined: Dec 2010
Reputation: 10
Post: #10
yeah i know it would have to be ahacky way around it. but if yuo read my other post. the xbmc subtitle script has a python to do jsut that. it returns a true if it detects .srt etc... and then display an image int he xbmc subtitle window. i was wondering if there was a way to jsut create that small line of code in a sperate python and have it run with when the dialog window opens ? thoughts?
find quote
ronie Offline
Team-Kodi Member
Posts: 9,214
Joined: Jan 2009
Reputation: 158
Post: #11
cruzannavy Wrote:yeah i know it would have to be ahacky way around it. but if yuo read my other post. the xbmc subtitle script has a python to do jsut that. it returns a true if it detects .srt etc... and then display an image int he xbmc subtitle window. i was wondering if there was a way to jsut create that small line of code in a sperate python and have it run with when the dialog window opens ? thoughts?

should be reasonably easy to do (although you're never sure until you actually start to code it)...
run the script when the videoinfo dialog opens and pass ListItem.FileNameAndPath to the script.
the script should be able to check for the subtitle files and pass the result back to the skin as a window property.


something like that?

Always read the Kodi online-manual, FAQ and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
cruzannavy Offline
Senior Member
Posts: 228
Joined: Dec 2010
Reputation: 10
Post: #12
unfortunately im not a python/ script guy.. but theres always a time to start right . and im guessing thats now. im going to hack away at it, so intheory for now, if i exceute xbmc subtitle script in conjunction with dialouge info it probably wont pass recognize the dialouge window, im pretty sure it lookd for whats currently playing not whats in the list. is it possible to get me started in the right direction.

cause what im about to do is guess until i get soemthign to work. if i copy subtitle script and change the name and details and make it launch on focus with dialoge ill see what happens then

but yes like you said. run script on open dialouge or focus ( like in a wallstream or list view) and pass info back to skin to either displa image or not based on if it finds the file in the path .
find quote
ronie Offline
Team-Kodi Member
Posts: 9,214
Joined: Jan 2009
Reputation: 158
Post: #13
cruzannavy Wrote:unfortunately im not a python/ script guy.. but theres always a time to start right . and im guessing thats now. im going to hack away at it, so intheory for now, if i exceute xbmc subtitle script in conjunction with dialouge info it probably wont pass recognize the dialouge window, im pretty sure it lookd for whats currently playing not whats in the list. is it possible to get me started in the right direction.

cause what im about to do is guess until i get soemthign to work. if i copy subtitle script and change the name and details and make it launch on focus with dialoge ill see what happens then

but yes like you said. run script on open dialouge or focus ( like in a wallstream or list view) and pass info back to skin to either displa image or not based on if it finds the file in the path .

i'll see if i can come up with some code.
looking at xbmc subtitles would indeed be the way to start.

Always read the Kodi online-manual, FAQ and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
cruzannavy Offline
Senior Member
Posts: 228
Joined: Dec 2010
Reputation: 10
Post: #14
thanks, im tryign it now to see what i can come up with, jsut reading the gui.py of the xbmc subtitle

Code:
self.getControl( 111 ).setVisible( False )                              # check for existing subtitles and set to "True" if found
    sub_exts = ["srt", "sub", "txt", "smi", "ssa", "ass" ]
    br = 0
    for i in range(3):
      for sub_ext in sub_exts:
        if br == 0:
          exec("lang = toOpenSubtitles_two(self.language_%s)" % (str(i+1)) )
          if os.path.isfile ("%s.%s.%s" % (os.path.join(sub_folder,os.path.splitext( os.path.basename( self.file_original_path ) )[0]),lang ,sub_ext,)):
            self.getControl( 111 ).setVisible( True )
            br = 1
            break
that is what i am trying to utilize
find quote
ronie Offline
Team-Kodi Member
Posts: 9,214
Joined: Jan 2009
Reputation: 158
Post: #15
here's some basic code to get you started:

dharma: http://pastebin.com/raw.php?i=cD8sXfiM

eden-pre: http://pastebin.com/raw.php?i=jtHrzabS

i haven't tested the dharma code, but the eden-pre one works fine.

in DialogVideoInfo.xml, run the script like this:
Code:
RunScript(script.subtitleinfo,path="$INFO[ListItem.FileNameAndPath]")

the script will set Window.Property(SubtitleInfo) to 'true' when a subtitle is found.

Always read the Kodi online-manual, FAQ and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
Post Reply