Add addons items to library
#1
I'm currently writing an addon to access files on a cloud storage provider, so user may access movies/TV shows/music stored on this account.

So I want to make it possible to add them to the local library (as links are stable and does not disappear as long as they are not deleted by user). But so far I didn't found a simple way to do it:
  • There is no API to add directly a path into library
  • Insert them directly into DB is forbidden by add-on rules (and would be very fragile anyway)
  • One solution could be to generate a local strm file and add it to library

Is it possible to add a plugin:// resource to library directly ?
Reply
#2
Yes, as long as you make sure you setresolvedurl on your addon code (otherwise you'll have that "opening stream" dialog hanging forever).
However, XBMC will not make items marked as watched when you reach the eof. You'll need to make sure you code that as well on your addon player class (one possibility is to make calls to the json-rpc).

Welcome to xbmc forums.
Reply
#3
Thanks for your answer.

I don't have problem to open files and stream them (I already use setresolvedurl). But now I want to add files to the Movie/TV show library, but when I call VideoLibrary.Scan directly on my plugin:// path, I get errors like these ones:

Code:
21:15:14 T:140174243657472 WARNING: CreateLoader - Unsupported protocol(plugin) in plugin://plugin.kodic/play/Tests/Vid%C3%A9os%2FBig+Buck+Bunny.nfo
21:15:15 T:140174243657472 WARNING: No information found for item 'plugin://plugin.kodic/play/Tests/Vid%C3%A9os%2FBig+Buck+Bunny.mp4', it won't be added to the library.
21:15:15 T:140174243657472 WARNING: CreateLoader - Unsupported protocol(plugin) in plugin://plugin.kodic/play/Tests/Vid%C3%A9os%2FSintel.nfo
21:15:15 T:140174243657472 WARNING: No information found for item 'plugin://plugin.kodic/play/Tests/Vid%C3%A9os%2FSintel.mp4', it won't be added to the library.
[/code]
Reply
#4
Create srtm files following the naming conventions (read more here: http://wiki.xbmc.org/index.php?title=Nam...les/Movies)

So, a file called "Big Buck Bunny (2008).strm" or "Sintel (2010).strm" should be scrapped correctly when calling videoLibrary.Scan.
Reply
#5
Ah ok, indeed the strm solution work Smile

But as far as I understood there is no direct way to integrate library into the plugin, that is add directly plugin://... files into the library, without using intermediary strm files. Am I right ?
Reply
#6
I would like to see this feature, too, for music files. It seems that currently there is only limited support for music videos, which can also be streaming audio files without video, but this is not a graceful way to integrate with the actual music library...
Reply
#7
Montellese is working on sth. like that:
Here's the thread where he mentioned it (it was actually about better importing from upnp sources, but he's working on sth. generic that would work with plugins as well
(2014-08-28, 10:21)Montellese Wrote: I'm trying to achieve now is a generic framework for "importing" items into the library (from anywhere). It consists of an import manager, media importers (which could be binary addons at some point) and abstracted logic to add specific media types to the library. The idea is that the user specifies a location from where items should be imported. Then there's a task that is responsible for retrieving the items, a task to synchronise the imported items with the items already in the database (which will result in a list of changes that need to be made to the current library, a potential task to get additional metadata for the imported items (scraping) and a task to apply the changes to the library. That way the source could be a local/remote filesystem, a upnp contentdirectory provider, a plugin or something else and all it would need would be a source-specific importer and the rest would be handled the same.
Reply
#8
This is really interesting Smile I will take a closer look at this this week end. Maybe I will be able to help a bit, or at least make some testing.
Reply
#9
Nice to know Smile
Reply

Logout Mark Read Team Forum Stats Members Help
Add addons items to library0