Remove or Skip Chapters in Bookmark List
#1
I would like to be able to access the bookmarks I created and move from one to another without Chapters in the list of bookmarks.  I can hide the Chapters using:

<visible>!String.StartsWith(ListItem.Label,Chapter)</visible>

but that keeps the Chapters in the bookmark list and does not allow for navigating directly between the created bookmarks.  Is there a way to eliminate Chapters from the bookmark list created in VideoOSDBookmarks or alternately do not create Chapter bookmarks at all?
Reply
#2
There is a solution using if else statements in python scripts.

if xbmc.getCondVisibility("String.StartsWith(ListItem.Label,Chapter)"):
     xbmc.executebuiltin("Action(Right)")
     time.sleep(0.01)
else:
     break

I can directly jump to a bookmarked location (excluding chapters) with a script. Number one jumps to the first bookmarked location. One long press jumps to the eleventh bookmark. Knowing how to compare the ListItem.Label2 (time) to the Player.Time would provide a way to jump to the next bookmark after the current Player.Time. Does anyone know how to make this work?

Some details:
- This should work for any skin with bookmarks in a single horizontal row. I tested it with AeonNoxSilvo.
- <onright> and <onleft> need to be disabled in VideoOSDBookmarks.xml.
- The code below is the script to jump to the second bookmark. The first loop is to return the focused item to the beginning of the list. Perhaps there is a single action to do that?
- The next two loops find the first and second bookmarks (not counting chapters). Nested loops with IF statements were problematic.
- The last loop is for cases where I am seeking beyond the end of the bookmarks and the last list item is a chapter. This loop will go back to the last bookmark that is not a chapter.

import xbmc
import time

xbmc.executebuiltin("ActivateWindow(VideoBookmarks)")

for x in range(50):
     xbmc.executebuiltin("Action(Left)")


for x in range(25):
     if xbmc.getCondVisibility("String.StartsWith(ListItem.Label,Chapter)"):
          xbmc.executebuiltin("Action(Right)")
          time.sleep(0.01)
     else:
           break

xbmc.executebuiltin("Action(Right)")
time.sleep(0.01)

for x in range(25):
     if xbmc.getCondVisibility("String.StartsWith(ListItem.Label,Chapter)"):
          xbmc.executebuiltin("Action(Right)")
          time.sleep(0.01)
     else:
          break


time.sleep(0.1)

for x in range(25):
     if xbmc.getCondVisibility("String.StartsWith(ListItem.Label,Chapter)"):
          xbmc.executebuiltin("Action(Left)")
          time.sleep(0.01)
     else:
          break

xbmc.executebuiltin("Action(Select)")
xbmc.executebuiltin("Action(Close)")
Reply
#3
One more detail:  Using the above script will create a bookmark if there are no bookmarks.  To prevent that, add the following lines after xbmc.executebuiltin("ActivateWindow(VideoBookmarks)")

xbmc.executebuiltin("Action(Right)")
time.sleep(0.01)

if xbmc.getCondVisibility("String.StartsWith(ListItem.Label,Chapter)") | xbmc.getCondVisibility("String.StartsWith(ListItem.Label,Bookmark)"):
       xbmc.executebuiltin("Action(noop)")
else:  
       xbmc.executebuiltin("Action(close)")
Reply
#4
Hi! 

I've been looking for a replacement for this add-on for years but since json-rpc no one has succeeded... 
[RELEASE] Video bookmarks browser

I see you are making progress with bookmark's for the first time
thanks and I am very happy for that!

even if bookmarks could not be put on the main screen as widgets 
do you think it could be separated somewhere?
like a context menu or something like that, the point is that it should not only be visible when the video is already started
Reply

Logout Mark Read Team Forum Stats Members Help
Remove or Skip Chapters in Bookmark List0