mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 10:16:11 +00:00
Resume fix
Forgot to remove old piece of code that interfered with resume point on homescreen. Also added another verification to removed any Kodi created bookmark as it messes with plugin paths bookmark.
This commit is contained in:
parent
cbebcbd818
commit
c61a17d48d
2 changed files with 30 additions and 6 deletions
|
@ -58,10 +58,6 @@ class PlaybackUtils():
|
|||
# To avoid negative bookmark
|
||||
seekTime = seekTime - jumpBackSec
|
||||
|
||||
if userData.get("PlaybackPositionTicks") != 0:
|
||||
reasonableTicks = int(userData.get("PlaybackPositionTicks")) / 1000
|
||||
seekTime = reasonableTicks / 10000
|
||||
|
||||
itemsToPlay = []
|
||||
# Check for intros
|
||||
if seekTime == 0:
|
||||
|
@ -137,6 +133,7 @@ class PlaybackUtils():
|
|||
elif resume_result < 0:
|
||||
# User cancelled dialog
|
||||
xbmc.log("Emby player -> User cancelled resume dialog.")
|
||||
xbmcplugin.setResolvedUrl(int(sys.argv[1]), False, listItem)
|
||||
return
|
||||
|
||||
if result.get("Type")=="Episode":
|
||||
|
|
|
@ -153,9 +153,22 @@ class WriteKodiVideoDB():
|
|||
filename = "plugin://plugin.video.emby/movies/%s/?filename=%s&id=%s&mode=play" % (embyId, fileext, embyId)
|
||||
path = "plugin://plugin.video.emby/movies/%s/" % embyId
|
||||
|
||||
# Remove Kodi bookmark - messes with plugin path bookmark
|
||||
# If the bookmark was created from widget
|
||||
cursor.execute("SELECT idFile as fileid FROM files WHERE strFilename = ?", (fileext,))
|
||||
try: # Remove Kodi bookmark - messes with plugin path bookmark
|
||||
result = cursor.fetchone()[0]
|
||||
self.setKodiResumePoint(result, 0, 0, cursor)
|
||||
except: pass
|
||||
|
||||
# If the bookmark was created within the library
|
||||
plugindummy = "plugin://plugin.video.emby/"
|
||||
cursor.execute("SELECT idPath FROM path WHERE strPath = ?", (plugindummy,))
|
||||
try:
|
||||
pathiddummy = cursor.fetchone()[0]
|
||||
except: pass
|
||||
else:
|
||||
cursor.execute("SELECT idFile as fileid FROM files WHERE strFilename = ? and idPath = ?", (filename, pathiddummy,))
|
||||
try: # Remove Kodi bookmark - creates a ghost bookmark for widgets
|
||||
result = cursor.fetchone()[0]
|
||||
self.setKodiResumePoint(result, 0, 0, cursor)
|
||||
except: pass
|
||||
|
@ -586,12 +599,26 @@ class WriteKodiVideoDB():
|
|||
filename = "plugin://plugin.video.emby/tvshows/%s/?filename=%s&id=%s&mode=play" % (seriesId, fileext, embyId)
|
||||
path = "plugin://plugin.video.emby/tvshows/%s/" % seriesId
|
||||
|
||||
# If the bookmark was created from widget
|
||||
cursor.execute("SELECT idFile as fileid FROM files WHERE strFilename = ?", (fileext,))
|
||||
try: # Remove Kodi bookmark - messes with plugin path bookmark
|
||||
result = cursor.fetchone()[0]
|
||||
self.setKodiResumePoint(result, 0, 0, cursor)
|
||||
except: pass
|
||||
|
||||
# If the bookmark was created within the library
|
||||
plugindummy = "plugin://plugin.video.emby/"
|
||||
cursor.execute("SELECT idPath FROM path WHERE strPath = ?", (plugindummy,))
|
||||
try:
|
||||
pathiddummy = cursor.fetchone()[0]
|
||||
except: pass
|
||||
else:
|
||||
cursor.execute("SELECT idFile as fileid FROM files WHERE strFilename = ? and idPath = ?", (filename, pathiddummy,))
|
||||
try: # Remove Kodi bookmark - creates a ghost bookmark for widgets
|
||||
result = cursor.fetchone()[0]
|
||||
self.setKodiResumePoint(result, 0, 0, cursor)
|
||||
except: pass
|
||||
|
||||
# Validate the path in database
|
||||
cursor.execute("SELECT idPath as pathid FROM path WHERE strPath = ?", (path,))
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue