[Announcement] - Changes in Subtitle Addons structure

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
tnuc Offline
Member
Posts: 54
Joined: Sep 2014
Reputation: 2
Post: #61
https://github.com/amet/service.subtitle...ce.py#L178
find quote
Roman_V_M Offline
Skilled Python Coder
Posts: 849
Joined: Jun 2011
Reputation: 31
Location: Kyiv, Ukraine
Post: #62
(2014-10-08 12:13)tnuc Wrote:  https://github.com/amet/service.subtitle...ce.py#L178

Not sure if understand it correctly. Would you be so kind to explain this in plain words? What xbmcplugin.addDirectoryItem() method, which is used for creating content lists in plugins, has to do with passing a subtitle path to the player? As far as understand, this string creates some list of several items (the number of items in subs collection), but how this list is then processed?
In content plugins such list of items with isFolder=False usually contains links to playable content and this list is displayed in XBMC UI, but what is its function here, in the subtitles plugin?

Raspberry PI 2 + OpenELEC 6 (Kodi 15.x)
Acer IconiaTab A510 + Kodi 14.2 for Android
(This post was last modified: 2014-10-08 13:23 by Roman_V_M.)
find quote
tnuc Offline
Member
Posts: 54
Joined: Sep 2014
Reputation: 2
Post: #63
we pass listitem back to core, OnDownloadComplete(https://github.com/xbmc/xbmc/blob/master...s.cpp#L435) picks it up and uses url param to move it from temp location to where user specified in subtitle settings.
find quote
Roman_V_M Offline
Skilled Python Coder
Posts: 849
Joined: Jun 2011
Reputation: 31
Location: Kyiv, Ukraine
Post: #64
(2014-10-08 13:44)tnuc Wrote:  we pass listitem back to core, OnDownloadComplete(https://github.com/xbmc/xbmc/blob/master...s.cpp#L435) picks it up and uses url param to move it from temp location to where user specified in subtitle settings.

Thank you for explanation. As far as understand, some script call parameters ("search", "manualsearch" and "download) are reserved and handled by XBMC core too. But for my addon I need 2-level structure: episode list (if several episodes match the search criteria, which is rare but still happens) and subtitles list for the selected episode. Can I use my own script call parameters (e.g. "showsubs") to display a multi-level list?

Raspberry PI 2 + OpenELEC 6 (Kodi 15.x)
Acer IconiaTab A510 + Kodi 14.2 for Android
(This post was last modified: 2014-10-08 14:06 by Roman_V_M.)
find quote
tnuc Offline
Member
Posts: 54
Joined: Sep 2014
Reputation: 2
Post: #65
sure, anything is allowed in your script, what you do in scrip before sending listitem to core is up to you.

but when you call 'xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=listitem,isFolder=False)' and finish it off with 'xbmcplugin.endOfDirectory(int(sys.argv[1])' thats when core displays the list and your script has ended

so if you want to show a list of subs for user to pick the correct one(if I understood correctly) you do that before calling xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=listitem,isFolder=False) and send the picked one to back to core.

I hope that it helps, otherwise I didnt understand
find quote
Roman_V_M Offline
Skilled Python Coder
Posts: 849
Joined: Jun 2011
Reputation: 31
Location: Kyiv, Ukraine
Post: #66
(2014-10-08 16:10)tnuc Wrote:  sure, anything is allowed in your script, what you do in scrip before sending listitem to core is up to you.

but when you call 'xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=listitem,isFolder=False)' and finish it off with 'xbmcplugin.endOfDirectory(int(sys.argv[1])' thats when core displays the list and your script has ended

so if you want to show a list of subs for user to pick the correct one(if I understood correctly) you do that before calling xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=listitem,isFolder=False) and send the picked one to back to core.

I hope that it helps, otherwise I didnt understand

As far as I can see, Search() function also creates a list of listItems, and this list of items is actually displayed in "Subtitles" interface (so I understand). So how XBMC Core knows, when it needs to display a list of items, and when it needs to handle subtitles URLs from listItems without displaying anything?

Raspberry PI 2 + OpenELEC 6 (Kodi 15.x)
Acer IconiaTab A510 + Kodi 14.2 for Android
find quote
tnuc Offline
Member
Posts: 54
Joined: Sep 2014
Reputation: 2
Post: #67
hm, read the XBMC core a bit, but in short...

this is called when we download the sub and we just handle moving and renaming the subs....

this however is called when search is finished, that in turn fills the list and displays it.

list item is just that, an item, it doesnt just get displayed in some window just because its a listitem. its just a simple way to move list of subtitles from python into core using something that both (C++ and Python) understand
find quote
Roman_V_M Offline
Skilled Python Coder
Posts: 849
Joined: Jun 2011
Reputation: 31
Location: Kyiv, Ukraine
Post: #68
(2014-10-08 18:04)tnuc Wrote:  hm, read the XBMC core a bit, but in short...

this is called when we download the sub and we just handle moving and renaming the subs....

this however is called when search is finished, that in turn fills the list and displays it.

list item is just that, an item, it doesnt just get displayed in some window just because its a listitem. its just a simple way to move list of subtitles from python into core using something that both (C++ and Python) understand

OK, but how can I control which of the above is called from Python addon perspective? I'm not very familial with C++, and all I need to know is to how display a list of found items and how to pass downloaded subs to the XBMC player.

Raspberry PI 2 + OpenELEC 6 (Kodi 15.x)
Acer IconiaTab A510 + Kodi 14.2 for Android
find quote
tnuc Offline
Member
Posts: 54
Joined: Sep 2014
Reputation: 2
Post: #69
core calls your service with a param, see here, after 'search' or 'manualsearch' is called everything you return is being displayed as a list of subtitles, when param is 'download' core will just move sub to a destination.

https://github.com/amet/service.subtitle...service.py is best documentation there is
(This post was last modified: 2014-10-08 19:02 by tnuc.)
find quote
Roman_V_M Offline
Skilled Python Coder
Posts: 849
Joined: Jun 2011
Reputation: 31
Location: Kyiv, Ukraine
Post: #70
(2014-10-08 19:01)tnuc Wrote:  core calls your service with a param, see here, after 'search' or 'manualsearch' is called everything you return is being displayed as a list of subtitles, when param is 'download' core will just move sub to a destination.

https://github.com/amet/service.subtitle...service.py is best documentation there is

Thanks for your answers. I've finally managed to get my own subtitles service working Smile

Raspberry PI 2 + OpenELEC 6 (Kodi 15.x)
Acer IconiaTab A510 + Kodi 14.2 for Android
find quote
delwashy Offline
Junior Member
Posts: 14
Joined: Sep 2014
Reputation: 0
Post: #71
i have got the subtitle plugin but when i try to open the drop box under video OSD nothing happens any help please
find quote
0adbylad Offline
Junior Member
Posts: 12
Joined: Jun 2014
Reputation: 0
Post: #72
Hello
Re Subtitles
Is it possible to add a subtitle source of one's own choice?
The reason i ask is i live in the UK so my prefered sub is English and i find the selection at the moment is a little scares for my needs on the TV sections
https://dailysubs.net/ is the one i would like to add
Ive tried downing the files i needed to a sd card in srt, format but cant seem to find a way to get them to play on the series im trying to watch
Or would it be possible to link to an Auto translator?

Kodi on Windows7 iMac Android
(This post was last modified: 2015-11-19 12:51 by 0adbylad.)
find quote
0adbylad Offline
Junior Member
Posts: 12
Joined: Jun 2014
Reputation: 0
Post: #73
Try
System...Settings...Add-ons...Search...type in subtitles
Good luck

ps.
Make sure youve followed this
Subtitles (wiki)
To activate them
Smile

Kodi on Windows7 iMac Android
find quote
mariosxrist Offline
Junior Member
Posts: 3
Joined: Mar 2016
Reputation: 0
Post: #74
Subtitle service works but fails to download..what should i do? i've reset the subtitle settings and set it up again but that didnt fix it

http://prntscr.com/aijn1u
find quote
labrekke Offline
Junior Member
Posts: 4
Joined: Apr 2016
Reputation: 0
Post: #75
I experience the same problem as mariosxrist today. Using Kodi 16.0. Yesterday everything was working fine, so I'm suspecting a change in the subtitle addon.
find quote
Post Reply