mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-05-14 13:25:07 +00:00
fix db stuff (#164)
* Reload objects upon initial setup * Fix database discovery ignore db-journal
This commit is contained in:
parent
2a4e42fba0
commit
2bbd5bf3a9
3 changed files with 29 additions and 27 deletions
|
@ -99,7 +99,8 @@ class Database(object):
|
|||
modified = {'file': None, 'time': 0}
|
||||
|
||||
for file in reversed(files):
|
||||
if file.startswith(database) and not file.endswith('-wal') and not file.endswith('-shm'):
|
||||
if (file.startswith(database) and not file.endswith('-wal') and
|
||||
not file.endswith('-shm') and not file.endswith('db-journal')):
|
||||
|
||||
st = xbmcvfs.Stat(databases + file.decode('utf-8'))
|
||||
modified_int = st.st_mtime()
|
||||
|
|
|
@ -200,7 +200,7 @@ class Service(xbmc.Monitor):
|
|||
return False
|
||||
|
||||
get_objects(zipfile, label + '.zip')
|
||||
reload(objects) # to apply latest changes
|
||||
self.reload_objects()
|
||||
|
||||
dialog("notification", heading="{emby}", message=_(33156), icon="{emby}")
|
||||
LOG.info("--[ new objects/%s ]", objects.version)
|
||||
|
@ -477,6 +477,30 @@ class Service(xbmc.Monitor):
|
|||
if not self.settings['kodi_companion']:
|
||||
dialog("ok", heading="{emby}", line1=_(33138))
|
||||
|
||||
def reload_objects(self):
|
||||
|
||||
''' Reload objects which depends on the patch module.
|
||||
This allows to see the changes in code without restarting the python interpreter.
|
||||
'''
|
||||
import full_sync
|
||||
|
||||
reload_modules = ['objects.movies', 'objects.musicvideos', 'objects.tvshows',
|
||||
'objects.music', 'objects.obj', 'objects.actions', 'objects.kodi.kodi',
|
||||
'objects.kodi.movies', 'objects.kodi.musicvideos', 'objects.kodi.tvshows',
|
||||
'objects.kodi.music', 'objects.kodi.artwork', 'objects.kodi.queries',
|
||||
'objects.kodi.queries_music', 'objects.kodi.queries_texture']
|
||||
|
||||
for mod in reload_modules:
|
||||
del sys.modules[mod]
|
||||
|
||||
reload(objects.kodi)
|
||||
reload(objects)
|
||||
reload(library)
|
||||
reload(full_sync)
|
||||
reload(monitor)
|
||||
|
||||
LOG.warn("---[ objects reloaded ]")
|
||||
|
||||
def shutdown(self):
|
||||
|
||||
LOG.warn("---<[ EXITING ]")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue