diff --git a/default.py b/default.py index 2645750c..5b7b3c30 100644 --- a/default.py +++ b/default.py @@ -23,7 +23,7 @@ sys.path.append(_BASE_LIB) import entrypoint import loghandler from utils import window, dialog, language as lang -from ga_client import GoogleAnalytics +#from ga_client import GoogleAnalytics import database ################################################################################################# @@ -178,10 +178,12 @@ if __name__ == "__main__": try: Main() except Exception as error: + """ if not (hasattr(error, 'quiet') and error.quiet): ga = GoogleAnalytics() errStrings = ga.formatException() ga.sendEventData("Exception", errStrings[0], errStrings[1]) + """ log.exception(error) raise diff --git a/resources/lib/connectmanager.py b/resources/lib/connectmanager.py index d05b2b38..ce4ba220 100644 --- a/resources/lib/connectmanager.py +++ b/resources/lib/connectmanager.py @@ -12,7 +12,7 @@ import clientinfo import read_embyserver as embyserver import connect.connectionmanager as connectionmanager from dialogs import ServerConnect, UsersConnect, LoginConnect, LoginManual, ServerManual -from ga_client import GoogleAnalytics +#from ga_client import GoogleAnalytics from utils import window ################################################################################################## @@ -144,8 +144,10 @@ class ConnectManager(object): def login(self, server=None): + """ ga = GoogleAnalytics() ga.sendEventData("Connect", "UserLogin") + """ # Return user or raise error server = server or self.state['Servers'][0] diff --git a/resources/lib/kodimonitor.py b/resources/lib/kodimonitor.py index 557e528d..e97e6701 100644 --- a/resources/lib/kodimonitor.py +++ b/resources/lib/kodimonitor.py @@ -13,7 +13,7 @@ import downloadutils import embydb_functions as embydb import playbackutils as pbutils from utils import window, settings, create_id -from ga_client import log_error +#from ga_client import log_error from database import DatabaseConn ################################################################################################# @@ -68,7 +68,7 @@ class KodiMonitor(xbmc.Monitor): log.info("New context transcode setting: %s", current_context) window('emby_context_transcode', value=current_context) - @log_error() + #@log_error() def onNotification(self, sender, method, data): if method not in ('Playlist.OnAdd', 'Player.OnStop', 'Player.OnClear'): diff --git a/resources/lib/librarysync.py b/resources/lib/librarysync.py index 47c518b7..e7b34e47 100644 --- a/resources/lib/librarysync.py +++ b/resources/lib/librarysync.py @@ -24,7 +24,7 @@ import userclient import views from objects import Movies, MusicVideos, TVShows, Music from utils import window, settings, language as lang, should_stop -from ga_client import GoogleAnalytics +#from ga_client import GoogleAnalytics ################################################################################################## @@ -77,7 +77,7 @@ class LibrarySync(threading.Thread): def startSync(self): - ga = GoogleAnalytics() + #ga = GoogleAnalytics() # Run at start up - optional to use the server plugin if settings('SyncInstallRunDone') == "true": @@ -99,17 +99,17 @@ class LibrarySync(threading.Thread): if plugin['Name'] in ("Emby.Kodi Sync Queue", "Kodi companion"): log.debug("Found server plugin.") self.isFastSync = True - ga.sendEventData("SyncAction", "FastSync") + #ga.sendEventData("SyncAction", "FastSync") completed = self.fastSync() break if not completed: # Fast sync failed or server plugin is not found - ga.sendEventData("SyncAction", "Sync") + #ga.sendEventData("SyncAction", "Sync") completed = ManualSync().sync() else: # Install sync is not completed - ga.sendEventData("SyncAction", "FullSync") + #ga.sendEventData("SyncAction", "FullSync") completed = self.fullSync() return completed @@ -648,10 +648,12 @@ class LibrarySync(threading.Thread): elif "401" in e: pass except Exception as e: + """ ga = GoogleAnalytics() errStrings = ga.formatException() if not (hasattr(e, 'quiet') and e.quiet): ga.sendEventData("Exception", errStrings[0], errStrings[1]) + """ window('emby_dbScan', clear=True) log.exception(e) xbmcgui.Dialog().ok( @@ -659,8 +661,8 @@ class LibrarySync(threading.Thread): line1=( "Library sync thread has exited! " "You should restart Kodi now. " - "Please report this on the forum."), - line2=(errStrings[0] + " (" + errStrings[1] + ")")) + "Please report this on the forum.")) + #line2=(errStrings[0] + " (" + errStrings[1] + ")")) def run_internal(self): diff --git a/resources/lib/objects/_common.py b/resources/lib/objects/_common.py index 7037d2a0..47e95f43 100644 --- a/resources/lib/objects/_common.py +++ b/resources/lib/objects/_common.py @@ -13,13 +13,13 @@ import api import artwork import downloadutils import read_embyserver as embyserver -from ga_client import GoogleAnalytics +#from ga_client import GoogleAnalytics from utils import window, settings, dialog, language as lang, should_stop ################################################################################################## log = logging.getLogger("EMBY."+__name__) -ga = GoogleAnalytics() +#ga = GoogleAnalytics() ################################################################################################## @@ -32,9 +32,11 @@ def catch_except(errors=(Exception, ), default_value=False): except sqlite3.Error as error: raise except errors as error: + """ if not (hasattr(error, 'quiet') and error.quiet): errStrings = ga.formatException() ga.sendEventData("Exception", errStrings[0], errStrings[1], True) + """ log.exception(error) log.error("function: %s \n args: %s \n kwargs: %s", func.__name__, args, kwargs) diff --git a/resources/lib/player.py b/resources/lib/player.py index 7671e15c..a8d7ceb2 100644 --- a/resources/lib/player.py +++ b/resources/lib/player.py @@ -14,7 +14,7 @@ import downloadutils import read_embyserver as embyserver import websocket_client as wsc from utils import window, settings, language as lang, JSONRPC -from ga_client import GoogleAnalytics, log_error +#from ga_client import GoogleAnalytics, log_error ################################################################################################# @@ -78,7 +78,7 @@ class Player(xbmc.Player): audio_tracks = len(player.getAvailableAudioStreams()) player.setSubtitleStream(subs_index - audio_tracks - 1) - @log_error() + #@log_error() def onPlayBackStarted(self): # Will be called when xbmc starts playing a file self.stopAll() @@ -271,9 +271,11 @@ class Player(xbmc.Player): self.played_info[currentFile] = data log.info("ADDING_FILE: %s", self.played_info) + """ ga = GoogleAnalytics() ga.sendEventData("PlayAction", item_type, play_method) ga.sendScreenView(item_type) + """ def reportPlayback(self): @@ -381,7 +383,7 @@ class Player(xbmc.Player): log.debug("Report: %s", postdata) self.emby.progress_report(postdata) - @log_error() + #@log_error() def onPlayBackPaused(self): currentFile = self.currentFile @@ -392,7 +394,7 @@ class Player(xbmc.Player): self.reportPlayback() - @log_error() + #@log_error() def onPlayBackResumed(self): currentFile = self.currentFile @@ -403,7 +405,7 @@ class Player(xbmc.Player): self.reportPlayback() - @log_error() + #@log_error() def onPlayBackSeek(self, time, seekOffset): # Make position when seeking a bit more accurate currentFile = self.currentFile @@ -420,14 +422,14 @@ class Player(xbmc.Player): self.played_info[currentFile]['currentPosition'] = position self.reportPlayback() - @log_error() + #@log_error() def onPlayBackStopped(self): # Will be called when user stops xbmc playing a file log.debug("ONPLAYBACK_STOPPED") window('emby_customPlaylist.seektime', clear=True) self.stopAll() - @log_error() + #@log_error() def onPlayBackEnded(self): # Will be called when xbmc stops playing a file log.debug("ONPLAYBACK_ENDED") @@ -522,8 +524,10 @@ class Player(xbmc.Player): self.played_info.clear() + """ ga = GoogleAnalytics() ga.sendEventData("PlayAction", "Stopped") + """ def stop_playback(self, data): diff --git a/resources/lib/service_entry.py b/resources/lib/service_entry.py index 75c68291..e4c24674 100644 --- a/resources/lib/service_entry.py +++ b/resources/lib/service_entry.py @@ -21,7 +21,7 @@ import player import websocket_client as wsc from views import VideoNodes from utils import window, settings, dialog, language as lang -from ga_client import GoogleAnalytics +#from ga_client import GoogleAnalytics import hashlib ################################################################################################# @@ -136,8 +136,10 @@ class Service(object): timeSinceLastPing = time.time() - self.lastMetricPing if(timeSinceLastPing > 300): self.lastMetricPing = time.time() + """ ga = GoogleAnalytics() ga.sendEventData("PlayAction", "PlayPing") + """ self._report_progress() @@ -184,6 +186,7 @@ class Service(object): if(serverId != None): serverId = hashlib.md5(serverId).hexdigest() + """ ga = GoogleAnalytics() ga.sendEventData("Application", "Startup", serverId) try: @@ -191,6 +194,7 @@ class Service(object): ga.sendEventData("Version", "Python", platform.python_version()) except Exception: pass + """ # Start up events self.warn_auth = True diff --git a/resources/lib/websocket_client.py b/resources/lib/websocket_client.py index fb2b6103..e32d38e5 100644 --- a/resources/lib/websocket_client.py +++ b/resources/lib/websocket_client.py @@ -16,7 +16,7 @@ import playlist import userclient import playbackutils from utils import window, settings, dialog, language as lang, JSONRPC -from ga_client import log_error +#from ga_client import log_error ################################################################################################## @@ -45,7 +45,7 @@ class WebSocketClient(threading.Thread): threading.Thread.__init__(self) - @log_error() + #@log_error() def on_message(self, ws, message): result = json.loads(message) diff --git a/service.py b/service.py index f5f03563..b8a30ea1 100644 --- a/service.py +++ b/service.py @@ -21,7 +21,7 @@ sys.path.append(_BASE_LIB) import loghandler from service_entry import Service from utils import settings -from ga_client import GoogleAnalytics +#from ga_client import GoogleAnalytics ################################################################################################# @@ -46,10 +46,12 @@ if __name__ == "__main__": service.service_entry_point() except Exception as error: + """ if not (hasattr(error, 'quiet') and error.quiet): ga = GoogleAnalytics() errStrings = ga.formatException() ga.sendEventData("Exception", errStrings[0], errStrings[1]) + """ log.exception(error) log.info("Forcing shutdown") service.shutdown()