Question to the developers MyVideos34.db / MyVideos44.db
#1
I am creating an addon where i interface directly against the database through python sqlite library, and in that context i need to know what is the difference between MyVideos34.db and MyVideos44.db?

And another thing, is there any way i can get the path to the current video database? something a little less hardcoded than this?

xbmc.translatePath('special://database/MyVideos44.db')

Any help is appreciated!
Thanks!
Reply
#2
44.db is version 44 - all sqlite databases update the file on disk now as the version updates. So you'll need to basically list the files and choose the latest, though that won't necessarily guarantee you're on the correct database - reason is that a user may have run a nightly build and then gone back to a stable (previous db version).

I suggest that querying the db directly will only lead to maintenance problems down the road (eg recently added script broke the other day because of a db bump).

If you can get away with using the JSON-RPC lib then that's the better way to go. Feel free to request extensions to it as you need.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
Great! just the info i needed, thank you!.

For now i think my best option is to interface directly against the database. But in principle i absolutely agree, however the jsonrpc don't have the methods i need in order to do what i want. Basically what i need is the name,imdb id and playcount of every video file in the library. And the ability to set playcount myself.
Reply
#4
Btw, can you tell me anything about what the default version of the latest stable is? is it MyVideos44.db?
Reply
#5
use the http api to get your data, it will be better.
Reply
#6
netbrain Wrote:Basically what i need is the name,imdb id and playcount of every video file in the library. And the ability to set playcount myself.

You can get the name, imdbid and playcount for every movie and episode. Music videos don't have an imdbid IIRC but they also have the name and playcount. But you can't get a list of all videos in the library with a single call. But then again you also need a complex sql statement to get it directly from the database.
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
#7
Montellese Wrote:You can get the name, imdbid and playcount for every movie and episode. Music videos don't have an imdbid IIRC but they also have the name and playcount. But you can't get a list of all videos in the library with a single call. But then again you also need a complex sql statement to get it directly from the database.

This through the http api? and how many calls would one need to get a list/map of name,imdb_id,playcount?
Reply
#8
you can see exemple of db request through http api in recentlyadded, or tvtunes, or logo-downloder, or tvshow.next.aired
Reply
#9
netbrain Wrote:This through the http api? and how many calls would one need to get a list/map of name,imdb_id,playcount?

No I'm talking about json rpc. You need a single call to json rpc to retrieve name,imdb_id and playcount for all movies. If you need the same info for tv episodes and music videos you need another call for every one of those.

In json rpc you can provide a "fields" parameter to certain method calls to define which info you would like to retrieve. A call for movies would look like this:
Code:
{ "jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": { "fields": [ "title", "imdbid", "playcount" ] }
This will return a json object containing a list of movies with the following info for each movie:
- label (name you see in the XBMC user interface)
- title (actual title of the movie; this doesn't really differ from label so you can drop it if prefered)
- imdbid
- playcount

Hope this helps you getting rid of the manual db interaction.
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
Sweet, this looks promising. But one snag, what about updating values in the database? can I set values through the json api aswell? I need to be able to set the playcount value.

Thanks for the help!
Reply
#11
No there's no method in jsonrpc yet which allows the changing of values in the database.
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
Question to the developers MyVideos34.db / MyVideos44.db0