mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-06-17 05:36:12 +00:00
Centralized logging
This commit is contained in:
parent
f5404fa1c1
commit
7a0f69e014
9 changed files with 542 additions and 516 deletions
|
@ -5,7 +5,7 @@
|
|||
##################################################################################################
|
||||
|
||||
import clientinfo
|
||||
import utils
|
||||
from utils import Logging, settings
|
||||
|
||||
##################################################################################################
|
||||
|
||||
|
@ -13,17 +13,16 @@ import utils
|
|||
class API():
|
||||
|
||||
def __init__(self, item):
|
||||
|
||||
global log
|
||||
log = Logging(self.__class__.__name__).log
|
||||
|
||||
# item is the api response
|
||||
self.item = item
|
||||
|
||||
self.clientinfo = clientinfo.ClientInfo()
|
||||
self.addonName = self.clientinfo.getAddonName()
|
||||
|
||||
def logMsg(self, msg, lvl=1):
|
||||
|
||||
className = self.__class__.__name__
|
||||
utils.logMsg("%s %s" % (self.addonName, className), msg, lvl)
|
||||
|
||||
|
||||
def getUserData(self):
|
||||
# Default
|
||||
|
@ -223,7 +222,7 @@ class API():
|
|||
resume = 0
|
||||
if resume_seconds:
|
||||
resume = round(float(resume_seconds), 6)
|
||||
jumpback = int(utils.settings('resumeJumpBack'))
|
||||
jumpback = int(settings('resumeJumpBack'))
|
||||
if resume > jumpback:
|
||||
# To avoid negative bookmark
|
||||
resume = resume - jumpback
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue