Access bookmarks from python plugin
#1
Hi,

I would like to read and change bookmarks from within my python plugin.
How can I do that?

~ Markus

It is about this: https://github.com/MarkusEh/plugin.video.vdr.recordings plugin
Reply
#2
Not possible atm, as far as I know...
Add-on : Bluray iso utils Rewrite of BR_iso_enhancements
Add-on : BR_iso_Enhancements Give theatrical & directors cut from the same bluray iso each their own library entry, use bluray iso's of tv shows as if they are already ripped.
Reply
#3
Sad 
Thank you for your answer.

This is also what I found. So I did a bad thing, blame on me Sad .
I directly access the database. It works.

~ Markus
Reply
#4
(2018-10-06, 09:21)MarkusEh Wrote: Thank you for your answer.

This is also what I found. So I did a bad thing, blame on me Sad .
I directly access the database. It works.

~ Markus
What if the user is using MySQL or MariaDB instead of Kodi's default SQLite3 db's ?  Your plugin doesn't currently take that into account and assumes a local DB, but not everyone runs a local DB.
Learning Linux the hard way !!
Reply
#5
(2018-10-06, 21:45)black_eagle Wrote: What if the user is using MySQL or MariaDB instead of Kodi's default SQLite3 db's ?  Your plugin doesn't currently take that into account and assumes a local DB, but not everyone runs a local DB. 
Thank you for pointing this out. My approach has lots of other disadvantages, there might be incompatible database changes, for example.

Any hint how I can improve my solution is very welcome. Like API to bookmarks, or API I could use to access the DB the user is using, ...

~ Markus
Reply
#6
What I did was to look for an advancedsettings.xml file - if it doesn't exist we are definitely looking at SQLite3.  If it does exist, parse it and see if there is a <videodatabase> tag.  If so, get the connection details for the database.  The awkward part here is there will not be a number appended on the end so I used a loop to append a value and just kept decrementing it and trying to connect until it was successful.  I would have preferred getting the db info from the jsonrpc, but I don't think it's exposed there anywhere.  It also apparently doesn't expose the bookmark info either, else that would have been the way to go.

To connect to MySQL you need to import script.module.myconnpy and make that a dependency in your addon.xml so it gets installed automatically with your plugin.
Learning Linux the hard way !!
Reply
#7
OK, seems to be high effort.
I will put it on hold and stop supporting bookmarks Sad
Let's hope for an API ...
Reply

Logout Mark Read Team Forum Stats Members Help
Access bookmarks from python plugin0