Manage XBMC library with JSON-RPC
#1
Hi,

I'd like to manage my XBMC library with the JSON API.
What I want is to modify the details of existing movies and tv shows in the library and add such details for files that aren't successfully scanned by XBMC.

I found the following methods:
  • Files.GetDirectory to get the content of a specific directory
  • FIles.GetFileDetails to get some more details about a single file (not very useful for my purpose)
  • VideoLibrary.GetMovies to get a list of Movies already in the library (that means scanned by XBMC)
  • VideoLibrary.GetMovieDetails to get all the details of a single movie in the library
  • VideoLibrary.SetMovieDetails to change the details of a movie in the library.

However, I didn't find a way to add a movie to the library. I could find its file with the Files.GetDirectory method, but how do I create a new entry in the library?

Any help is appreciated.
Reply
#2
VideoLibrary.Scan will start a library update

http://kodi.wiki/view/JSON-RPC_API/v6#VideoLibrary.Scan
"PPC is too slow, your CPU has no balls to handle HD content." ~ Davilla
"Maybe it's a toaster. Who knows, but it has nothing to do with us." ~ Ned Scott
Reply
#3
Unfortunately there's no support for manually adding single movies (or tvshows, seasons, episodes or musicvideos) through JSON-RPC yet.
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
#4
So there is no way to manually add an entry to the library, that the automatic scan doesn't get right?

Please correct me if I am wrong. As I understand it, if the scrapers cannot recognize a specific file, no entry for a movie is made (not even an empty one)?

Is there any other way to create new Library items, apart from JSON-RPC?
Is directly modifying the database a safe approach? And if so, is there some documentation of the database structure?
Reply
#5
(2014-11-06, 16:16)anlima Wrote: So there is no way to manually add an entry to the library, that the automatic scan doesn't get right?
You can create an .NFO file with information about the video, if the scraper fails. Then it should get added to the library

jonib
XBMC2, EventGhost plugin. Image
Reply
#6
I don't want to clutter my media with lots of .nfo files that only have a meaning to XBMC (and also don't want to rename and restructure my media files for XBMC), so .nfo files don't seem to be appropriate. If there is a way to provide these nfo files in another way, that could be an option. But as I understand, to import .nfo files, XBMC must first have scanned and recognized the movie files correctly.
Is that right?
Reply
#7
What is the reason XBMC is not picking up your files? If it finds the files but no matching movie you can manually specify the movie title in XBMC by manually scraping the file in files view.
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
#8
It mainly doesn't pick up the files, because it doesn't recognize the name.
Specifying the movie title manually and then choosing the correct one from the result list is possible with movies. However it doesn't work with TV Series episodes (At least I don't see a way to do so).

But this doesn't help, if I am unhappy with some details of the scraped data. I don't find a way to modify the details of such a scraped file within XBMC (for example changing the label to something else).
Also this is a hassle to do directly in XBMC. I'd like to prepare this on my PC and then just update the values in XBMC.
Reply
#9
Well as soon as a file is in the library you can use JSON-RPC to modify the metadata.
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
#10
Thats right.
But what about the episodes in a TV Series? I don't find a way to manually specify them (the TV Show itself is already recognized and in the library). And I don't really want to manually update for example the 150 episodes of a TV Show one after the other.
Reply
#11
(2014-11-06, 19:19)anlima Wrote: But what about the episodes in a TV Series? I don't find a way to manually specify them (the TV Show itself is already recognized and in the library). And I don't really want to manually update for example the 150 episodes of a TV Show one after the other.
If the episode filenames have an unsupported format, you can tell XBMC how to recognize them via the advancedsettings.xml file, "2.3.8 tvshowmatching" section.

jonib
XBMC2, EventGhost plugin. Image
Reply
#12
It's a bit late but you could setup something like "The Renamer" to make sure all your tv shows are named in the correct format and with the correct names to make it easier. Meet the scraper halfway
Reply

Logout Mark Read Team Forum Stats Members Help
Manage XBMC library with JSON-RPC0