Remove GA

This commit is contained in:
angelblue05 2018-05-12 22:56:53 -05:00
parent 9ecd546ce6
commit e50780bd37
9 changed files with 42 additions and 24 deletions

View file

@ -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

View file

@ -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]

View file

@ -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'):

View file

@ -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):

View file

@ -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)

View file

@ -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):

View file

@ -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

View file

@ -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)

View file

@ -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()