[Announcement] - Changes in Subtitle Addons structure

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
tnuc Offline
Junior Member
Posts: 22
Joined: Sep 2014
Reputation: 0
Post: #61
https://github.com/amet/service.subtitle...ce.py#L178
find quote
Roman_V_M Offline
Fan
Posts: 571
Joined: Jun 2011
Reputation: 14
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?

AMD A4-3300 + AsRock A75M-ITX
XBMC 13.2 (custom build) on Windows 7
(This post was last modified: 2014-10-08 13:23 by Roman_V_M.)
find quote
tnuc Offline
Junior Member
Posts: 22
Joined: Sep 2014
Reputation: 0
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
Fan
Posts: 571
Joined: Jun 2011
Reputation: 14
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?

AMD A4-3300 + AsRock A75M-ITX
XBMC 13.2 (custom build) on Windows 7
(This post was last modified: 2014-10-08 14:06 by Roman_V_M.)
find quote
tnuc Offline
Junior Member
Posts: 22
Joined: Sep 2014
Reputation: 0
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
Fan
Posts: 571
Joined: Jun 2011
Reputation: 14
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?

AMD A4-3300 + AsRock A75M-ITX
XBMC 13.2 (custom build) on Windows 7
find quote
tnuc Offline
Junior Member
Posts: 22
Joined: Sep 2014
Reputation: 0
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
Fan
Posts: 571
Joined: Jun 2011
Reputation: 14
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.

AMD A4-3300 + AsRock A75M-ITX
XBMC 13.2 (custom build) on Windows 7
find quote
tnuc Offline
Junior Member
Posts: 22
Joined: Sep 2014
Reputation: 0
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
Fan
Posts: 571
Joined: Jun 2011
Reputation: 14
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

AMD A4-3300 + AsRock A75M-ITX
XBMC 13.2 (custom build) on Windows 7
find quote
delwashy Offline
Junior Member
Posts: 4
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
Post Reply