2018-10-20 23:49:04 +11:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
from __future__ import absolute_import, division, unicode_literals
|
|
|
|
import xbmc
|
|
|
|
|
2018-11-19 00:59:17 +11:00
|
|
|
from .. import app
|
2018-10-20 23:49:04 +11:00
|
|
|
|
|
|
|
|
|
|
|
class libsync_mixin(object):
|
|
|
|
def isCanceled(self):
|
2018-11-19 00:59:17 +11:00
|
|
|
return (self._canceled or app.APP.stop_pkc or app.SYNC.stop_sync or
|
2018-11-26 03:03:19 +11:00
|
|
|
app.APP.suspend_threads or app.SYNC.suspend_sync)
|
2018-10-20 23:49:04 +11:00
|
|
|
|
|
|
|
|
2018-12-22 02:53:53 +11:00
|
|
|
class fullsync_mixin(object):
|
|
|
|
def isCanceled(self):
|
|
|
|
return (self._canceled or
|
|
|
|
app.APP.stop_pkc or
|
|
|
|
app.SYNC.stop_sync or
|
|
|
|
app.APP.suspend_threads)
|
|
|
|
|
|
|
|
|
2018-10-20 23:49:04 +11:00
|
|
|
def update_kodi_library(video=True, music=True):
|
|
|
|
"""
|
|
|
|
Updates the Kodi library and thus refreshes the Kodi views and widgets
|
|
|
|
"""
|
2018-11-26 06:36:54 +11:00
|
|
|
if video:
|
|
|
|
xbmc.executebuiltin('UpdateLibrary(video)')
|
|
|
|
if music:
|
|
|
|
xbmc.executebuiltin('UpdateLibrary(music)')
|