Req Looking for help using SQL on Bookmarks table
#1
Question 
Good Day

Experienced SQL developer here but not with Kodi. Windows 11 running on MINIX box.

I have problems losing bookmarks when migrating bookmarked content to new external hard drive because Kodi uses the entire filename and path to store the bookmarks.

I would like to use free personal form of SQL server to go in and edit bookmark records in the appropriate DB file so I can re-associate files with entries in the bookmarks table.

Is this possible and does anybody have any tips?

Thanks very much.
Reply
#2
Out of curiousity, what do you use the bookmarks for?
Wouldn't it be easier and more permanent to create chapter files once and then add those to the video file? Then there is no risk of losing bookmarks each time you rebuild your library. If you are using mkv files, it is pretty simple to do.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#3
Not familiar with Chapter Files. How does that work?
Reply
#4
OK looked it up and it talks about episodes. My videos are GoPro camera stuff I took myself. There are no episodes.
Reply
#5
(2023-12-22, 22:50)DobieGillis Wrote: OK looked it up and it talks about episodes.
Disregard what they are used for.
Your GoPro video, what format are they?
(and aware we are heading away from your original question... for now...)

Chapters are what you normally see in Bluray and DVD's, where you can skip to the next part of the movie.
Here is a typical chapter file, but don't let that scare you off as they can be created quite simply... https://paste.kodi.tv/afotatavir

Using MKVToolNix, you can create the chapter points, then embed them into an mkv videofile and they remain there permanently...
Image
And you can name the chapters. It does not have to be Chapter xx. It can be "The big crash".

If you look at the second image of my post here... https://forum.kodi.tv/showthread.php?tid...pid3171001 you will see the chapter marks as little white dots along the timeline bar.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#6
MP4
Reply
#7
Also, the procedure you are showing is too complex. The bookmarks are great since I can add them while reviewing a video. - I'd like to keep using them. I'm only looking to solve a once in a blue moon problem.
Reply
#8
(2023-12-22, 20:35)DobieGillis Wrote: Is this possible and does anybody have any tips?
Yes, this is possible but can be a lot of work depending on how many bookmarks you have.
The bookmarks are stored in the bookmark table of the MyVideo database.
As you already know, the bookmarks are linked to the video via the files table. This allows bookmarks to be used whether the video is in the library or not.
All you need to do is relink idFile to the correct record in the files table.
Is there a pluging to do this? No
Is there a guide to do this? No
But as an experienced SQL developer, you will have far more understanding of the requirements than I could possible provide.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#9
It's a matter of loading the table up to see what the columns are then issuing  UPDATE ... WHERE ... SET...  statements, as required. Lots of possibilities.

Thanks for the info. Is that table also in the android version? I upgraded to the Windows version (much more responsive!) but lost all my book marks. If I had access to those I could copy the bookmarks.

Grateful for the info!
Reply
#10
Actually, even easier might be to use a SQL utility to export the table to a CSV file, then use a text editor to change <this> to <that>, re-import the table and away you go.
Reply
#11
(2023-12-23, 02:04)DobieGillis Wrote: Is that table also in the android version?
Yes. Check location in the table... https://kodi.wiki/view/Userdata

This might be of use... https://kodi.wiki/view/Databases
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
#12
Will do. Seasonal Cheers!
Reply
#13
In Kodi you have resume point, bookmark, episode bookmark, and chapter.  All as seconds from start of the file.  These are all related to the file, not directly the media type.

Chapter files are a way to add chapters as metadata to AV files.  I use mkv format but I suppose it can be done in other formats.  Mkvtoolnix program can take chapter info as text / xml file and mux it into the mkv.  Check out mkvmerge on the web for file format info.

I have many video files without chapters.  I wrote a little python script to extract the bookmarks and write them to a file that I can mux into mkv with Mkvtoolnix.  One issue with the bookmarks is that Kodi takes a frame grab when you set a bookmark and saves it into Thumbnails/Video/Bookmarks.  Typically when you do something to your library the link to the thumb gets broken and you don't see the frame.  A bigger problem is usability in that bookmarks and chapters are only available while a file is playing.  (Except for episode bookmarks but these are special purpose only available for "episode" media type.)  However, you do have the option of treating your video as a "tv show" with a single, multi-episode file, but then you are constrained by episode filename requirements.  Also when you play the file you can select the "episode" and start playback there, but there is no episode "endpoint" and the file will continue play until EOF.

I haven't had luck in updating bookmarks in Kodi db after redoing a library, but it's been a few years, maybe could take another crack at it.

I also had problems with chapter navigating "chapter back" to the beginning of the file so I always add a chapter at time 0.  That might be fixed now (since I have chapter 0 at time 0 in all my files I don't care).

Finally I also see that after adding the chapters and refreshing the file in the UI, I can delete the bookmarks (one-by-one) but there's always one that won't delete.

scott s.
.
Reply
#14
Thanks again. It's always more complicated than you think!
Reply

Logout Mark Read Team Forum Stats Members Help
Looking for help using SQL on Bookmarks table0