Adding TvShows Episodes via Plugins/JSONRPC
#1
So I'm not really sure that this is the right place for this thread but since it touches on multiple subjects I thought it would be best to put it here.

I've recently discovered Kodi and I'm impressed with whats already working. I've been looking for a way to easily access my Anime library in a concise form and Kodi seems to be the right thing to do that.

However after reading all the info on the subject and discovering that I would have to either adapt my naming scheme and/or muck around with regexes I thought that there must be a better way.

This brought me to the Plugin idea and now after reading through a whole lot of information I'm the following point:

- I would like my plugin to directly access the files and add them to the TvShow listing.

- A scraper won't work because that doesn't have access to the files directly and can't work with python scripts afaik.

- I have found no way to ADD episodes or shows to the database using a plugin. The JSON RPC Api only allows changing existing episodes or removing them altogether as far as I can see.

- EDIT: Direct access to files can be done using JSON RPC and the Files.GetSources command and then selecting the appropriate source. This however also requires that the source has already been added in Kodi itself through the usual interface. It would be interesting to know whether a plugin can add filesystem sources as well.

So my question would be the following:

Is it possible to write a script/plugin/addon that can directly access files and add them to the database with info provided by the script?

EDIT: I'm thinking about creating nfo files from a plugin and then initiating a library rescan. That might work. However this requires write access to the directory the files are stored in =/
Reply
#2
There's a PR from topfs2 that will add a Files.AddSource() to JSON-RPC so that one is already in the works.

Adding movies/tvshows/seasons/episodes/musicvideos isn't supported yet because the JSON-RPC API doesn't support any interaction with scrapers yet and most people use some kind of scrapers when adding new items.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#3
That does sound promising. It would open up all kinds of possibilities starting with hashing files etc.

Is there any way to help with that project?
Reply
#4
You could test and maybe even improve PR5484 which adds Files.AddSource to JSON-RPC but as mentioned in my comments it needs some improvements. Furthermore a way to get and modify the source options/configuration of existing sources would be nice as well.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply

Logout Mark Read Team Forum Stats Members Help
Adding TvShows Episodes via Plugins/JSONRPC0