ListItem.SubtitleLanguage
#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
Reply
#2
From the other post -

Hitcher Wrote:Works just like any other label -

Image
Reply
#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
Reply
#4
I simply replaced ListItem.Label2 with ListItem.SubtitleLanguage for that test.

Have you enabled extraction of the meta data?
Reply
#5
Just to be sure where would i verfiy this? or how would i enable / disable that?
Reply
#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??
Reply
#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
Reply
#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
Reply
#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
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#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?
Reply
#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?
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#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 .
Reply
#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.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#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
Reply
#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.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply

Logout Mark Read Team Forum Stats Members Help
ListItem.SubtitleLanguage0