diff --git a/addon.xml b/addon.xml index 40396110..82dc9651 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ diff --git a/changelog.txt b/changelog.txt index af01a20b..82b94dbd 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,8 @@ +version 2.3.12 +- Fix virtual episodes being processed +- Return offline items so they don't get removed in kodi +- other minor fixes + version 2.3.8 - Fix database connection - other minor fixes diff --git a/resources/lib/database.py b/resources/lib/database.py index a300a465..a4746836 100644 --- a/resources/lib/database.py +++ b/resources/lib/database.py @@ -98,7 +98,7 @@ class DatabaseConn(object): log.info("opened: %s - %s", self.path, id(self.conn)) self.cursor = self.conn.cursor() - return self.conn.cursor() + return self.cursor def _SQL(self, media_type): diff --git a/resources/lib/librarysync.py b/resources/lib/librarysync.py index fe795b15..bc89af22 100644 --- a/resources/lib/librarysync.py +++ b/resources/lib/librarysync.py @@ -651,9 +651,6 @@ class LibrarySync(threading.Thread): log.warn("---===### Starting LibrarySync ###===---") - # Verify database structure, otherwise create it. - self._verify_emby_database() - while not self.monitor.abortRequested(): # In the event the server goes offline diff --git a/resources/lib/objects/tvshows.py b/resources/lib/objects/tvshows.py index fab1dbb7..9d192ccc 100644 --- a/resources/lib/objects/tvshows.py +++ b/resources/lib/objects/tvshows.py @@ -401,7 +401,7 @@ class TVShows(Items): # We needed to recreate the show entry. Re-add episodes now. log.info("Repairing episodes for showid: %s %s", showid, title) all_episodes = emby.getEpisodesbyShow(itemid) - self.add_episode(all_episodes['Items'], None) + self.add_episodes(all_episodes['Items'], None) return True diff --git a/resources/lib/player.py b/resources/lib/player.py index 9f196e66..a61f1b6a 100644 --- a/resources/lib/player.py +++ b/resources/lib/player.py @@ -385,10 +385,15 @@ class Player(xbmc.Player): log.debug("PLAYBACK_SEEK: %s" % currentFile) if self.played_info.get(currentFile): - position = self.xbmcplayer.getTime() - self.played_info[currentFile]['currentPosition'] = position + position = None + try: + position = self.xbmcplayer.getTime() + except: + pass - self.reportPlayback() + if position is not None: + self.played_info[currentFile]['currentPosition'] = position + self.reportPlayback() @log_error() def onPlayBackStopped(self): diff --git a/resources/lib/read_embyserver.py b/resources/lib/read_embyserver.py index 550dc7d9..96a345d0 100644 --- a/resources/lib/read_embyserver.py +++ b/resources/lib/read_embyserver.py @@ -172,6 +172,7 @@ class Read_EmbyServer(): 'ParentId': parentid, 'ArtistIds': artist_id, 'IncludeItemTypes': itemtype, + 'LocationTypes': "FileSystem,Remote,Offline", 'CollapseBoxSetItems': False, 'IsVirtualUnaired': False, 'IsMissing': False, @@ -201,6 +202,7 @@ class Read_EmbyServer(): 'IncludeItemTypes': itemtype, 'CollapseBoxSetItems': False, 'IsVirtualUnaired': False, + 'LocationTypes': "FileSystem,Remote,Offline", 'IsMissing': False, 'Recursive': True, 'StartIndex': index, @@ -340,6 +342,7 @@ class Read_EmbyServer(): 'ParentId': parentid, 'CollapseBoxSetItems': False, 'IsVirtualUnaired': False, + 'LocationTypes': "FileSystem,Remote,Offline", 'IsMissing': False, 'Recursive': True, 'Ids': itemid @@ -446,6 +449,7 @@ class Read_EmbyServer(): 'ParentId': parent_id, 'Recursive': True, 'IsVirtualUnaired': False, + 'LocationTypes': "FileSystem,Remote,Offline", 'IsMissing': False, 'StartIndex': index, 'Limit': jump, diff --git a/resources/lib/service_entry.py b/resources/lib/service_entry.py index 273dce45..5ed15c5c 100644 --- a/resources/lib/service_entry.py +++ b/resources/lib/service_entry.py @@ -7,6 +7,7 @@ import sys import time import _strptime # Workaround for threads using datetime: _striptime is locked from datetime import datetime +import platform import xbmc @@ -99,6 +100,8 @@ class Service(object): self.websocket_thread = wsc.WebSocketClient() self.library_thread = librarysync.LibrarySync() + # Verify database structure, otherwise create it. + self.library_thread._verify_emby_database() while not self.monitor.abortRequested(): @@ -164,6 +167,11 @@ class Service(object): ga = GoogleAnalytics() ga.sendEventData("Application", "Startup", serverId) + try: + ga.sendEventData("Version", "OS", platform.platform()) + ga.sendEventData("Version", "Python", platform.python_version()) + except Exception: + pass # Start up events self.warn_auth = True