mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 02:06:09 +00:00
Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
commit
7f2eb13f9a
7 changed files with 32 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<addon id="plugin.video.emby"
|
<addon id="plugin.video.emby"
|
||||||
name="Emby"
|
name="Emby"
|
||||||
version="2.3.4"
|
version="2.3.5"
|
||||||
provider-name="Emby.media">
|
provider-name="Emby.media">
|
||||||
<requires>
|
<requires>
|
||||||
<import addon="xbmc.python" version="2.19.0"/>
|
<import addon="xbmc.python" version="2.19.0"/>
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
version 2.3.4
|
version 2.3.4
|
||||||
- add throttling for error event logging
|
- add throttling for error event logging
|
||||||
|
|
||||||
>>>>>>> refs/remotes/origin/master
|
|
||||||
version 2.3.3
|
version 2.3.3
|
||||||
- minor fix to exception handling
|
- minor fix to exception handling
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,24 @@ log = logging.getLogger("EMBY."+__name__)
|
||||||
|
|
||||||
logEventHistory = {}
|
logEventHistory = {}
|
||||||
|
|
||||||
|
# wrap a function to catch, log and then re throw an exception
|
||||||
|
def log_error(errors=(Exception, )):
|
||||||
|
def decorator(func):
|
||||||
|
def wrapper(*args, **kwargs):
|
||||||
|
try:
|
||||||
|
return func(*args, **kwargs)
|
||||||
|
except errors as error:
|
||||||
|
ga = GoogleAnalytics()
|
||||||
|
errStrings = ga.formatException()
|
||||||
|
ga.sendEventData("Exception", errStrings[0], errStrings[1], True)
|
||||||
|
log.exception(error)
|
||||||
|
log.error("log_error: %s \n args: %s \n kwargs: %s",
|
||||||
|
func.__name__, args, kwargs)
|
||||||
|
raise
|
||||||
|
return wrapper
|
||||||
|
return decorator
|
||||||
|
|
||||||
|
# main GA class
|
||||||
class GoogleAnalytics():
|
class GoogleAnalytics():
|
||||||
|
|
||||||
testing = False
|
testing = False
|
||||||
|
|
|
@ -12,6 +12,7 @@ import downloadutils
|
||||||
import embydb_functions as embydb
|
import embydb_functions as embydb
|
||||||
import playbackutils as pbutils
|
import playbackutils as pbutils
|
||||||
from utils import window, settings, kodiSQL
|
from utils import window, settings, kodiSQL
|
||||||
|
from ga_client import log_error
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
@ -56,6 +57,7 @@ class KodiMonitor(xbmc.Monitor):
|
||||||
log.info("New context setting: %s", current_context)
|
log.info("New context setting: %s", current_context)
|
||||||
window('emby_context', value=current_context)
|
window('emby_context', value=current_context)
|
||||||
|
|
||||||
|
@log_error()
|
||||||
def onNotification(self, sender, method, data):
|
def onNotification(self, sender, method, data):
|
||||||
|
|
||||||
if method not in ('Playlist.OnAdd', 'Player.OnStop', 'Player.OnClear'):
|
if method not in ('Playlist.OnAdd', 'Player.OnStop', 'Player.OnClear'):
|
||||||
|
|
|
@ -22,7 +22,7 @@ ga = GoogleAnalytics()
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
def catch_except(errors=(Exception, )):
|
def catch_except(errors=(Exception, ), default_value=False):
|
||||||
# Will wrap method with try/except and print parameters for easier debugging
|
# Will wrap method with try/except and print parameters for easier debugging
|
||||||
def decorator(func):
|
def decorator(func):
|
||||||
def wrapper(*args, **kwargs):
|
def wrapper(*args, **kwargs):
|
||||||
|
@ -34,7 +34,7 @@ def catch_except(errors=(Exception, )):
|
||||||
log.exception(error)
|
log.exception(error)
|
||||||
log.error("function: %s \n args: %s \n kwargs: %s",
|
log.error("function: %s \n args: %s \n kwargs: %s",
|
||||||
func.__name__, args, kwargs)
|
func.__name__, args, kwargs)
|
||||||
raise
|
return default_value
|
||||||
|
|
||||||
return wrapper
|
return wrapper
|
||||||
return decorator
|
return decorator
|
||||||
|
|
|
@ -14,7 +14,7 @@ import downloadutils
|
||||||
import kodidb_functions as kodidb
|
import kodidb_functions as kodidb
|
||||||
import websocket_client as wsc
|
import websocket_client as wsc
|
||||||
from utils import window, settings, language as lang
|
from utils import window, settings, language as lang
|
||||||
from ga_client import GoogleAnalytics
|
from ga_client import GoogleAnalytics, log_error
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ class Player(xbmc.Player):
|
||||||
log.debug("Starting playback monitor.")
|
log.debug("Starting playback monitor.")
|
||||||
xbmc.Player.__init__(self)
|
xbmc.Player.__init__(self)
|
||||||
|
|
||||||
|
@log_error()
|
||||||
def onPlayBackStarted(self):
|
def onPlayBackStarted(self):
|
||||||
# Will be called when xbmc starts playing a file
|
# Will be called when xbmc starts playing a file
|
||||||
self.stopAll()
|
self.stopAll()
|
||||||
|
@ -356,6 +357,7 @@ class Player(xbmc.Player):
|
||||||
log.debug("Report: %s" % postdata)
|
log.debug("Report: %s" % postdata)
|
||||||
self.ws.send_progress_update(postdata)
|
self.ws.send_progress_update(postdata)
|
||||||
|
|
||||||
|
@log_error()
|
||||||
def onPlayBackPaused(self):
|
def onPlayBackPaused(self):
|
||||||
|
|
||||||
currentFile = self.currentFile
|
currentFile = self.currentFile
|
||||||
|
@ -366,6 +368,7 @@ class Player(xbmc.Player):
|
||||||
|
|
||||||
self.reportPlayback()
|
self.reportPlayback()
|
||||||
|
|
||||||
|
@log_error()
|
||||||
def onPlayBackResumed(self):
|
def onPlayBackResumed(self):
|
||||||
|
|
||||||
currentFile = self.currentFile
|
currentFile = self.currentFile
|
||||||
|
@ -376,6 +379,7 @@ class Player(xbmc.Player):
|
||||||
|
|
||||||
self.reportPlayback()
|
self.reportPlayback()
|
||||||
|
|
||||||
|
@log_error()
|
||||||
def onPlayBackSeek(self, time, seekOffset):
|
def onPlayBackSeek(self, time, seekOffset):
|
||||||
# Make position when seeking a bit more accurate
|
# Make position when seeking a bit more accurate
|
||||||
currentFile = self.currentFile
|
currentFile = self.currentFile
|
||||||
|
@ -387,6 +391,7 @@ class Player(xbmc.Player):
|
||||||
|
|
||||||
self.reportPlayback()
|
self.reportPlayback()
|
||||||
|
|
||||||
|
@log_error()
|
||||||
def onPlayBackStopped(self):
|
def onPlayBackStopped(self):
|
||||||
# Will be called when user stops xbmc playing a file
|
# Will be called when user stops xbmc playing a file
|
||||||
log.debug("ONPLAYBACK_STOPPED")
|
log.debug("ONPLAYBACK_STOPPED")
|
||||||
|
@ -396,6 +401,7 @@ class Player(xbmc.Player):
|
||||||
log.info("Clear playlist properties.")
|
log.info("Clear playlist properties.")
|
||||||
self.stopAll()
|
self.stopAll()
|
||||||
|
|
||||||
|
@log_error()
|
||||||
def onPlayBackEnded(self):
|
def onPlayBackEnded(self):
|
||||||
# Will be called when xbmc stops playing a file
|
# Will be called when xbmc stops playing a file
|
||||||
log.debug("ONPLAYBACK_ENDED")
|
log.debug("ONPLAYBACK_ENDED")
|
||||||
|
|
|
@ -15,6 +15,7 @@ import librarysync
|
||||||
import playlist
|
import playlist
|
||||||
import userclient
|
import userclient
|
||||||
from utils import window, settings, dialog, language as lang, JSONRPC
|
from utils import window, settings, dialog, language as lang, JSONRPC
|
||||||
|
from ga_client import log_error
|
||||||
|
|
||||||
##################################################################################################
|
##################################################################################################
|
||||||
|
|
||||||
|
@ -60,6 +61,7 @@ class WebSocketClient(threading.Thread):
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
log.exception(error)
|
log.exception(error)
|
||||||
|
|
||||||
|
@log_error()
|
||||||
def on_message(self, ws, message):
|
def on_message(self, ws, message):
|
||||||
|
|
||||||
result = json.loads(message)
|
result = json.loads(message)
|
||||||
|
|
Loading…
Reference in a new issue