Optimize logging

This commit is contained in:
croneter 2018-11-04 17:33:55 +01:00
parent 120a616331
commit f8c6b21f51
3 changed files with 8 additions and 13 deletions

View file

@ -98,8 +98,7 @@ class Movie(ItemBase):
api.date_created())
if update_item:
LOG.info('UPDATE movie plex_id: %s - Title: %s',
plex_id, api.title())
LOG.info('UPDATE movie plex_id: %s - %s', plex_id, api.title())
if file_id != old_kodi_fileid:
self.kodi_db.remove_file(old_kodi_fileid)
rating_id = self.kodi_db.get_ratingid(kodi_id,
@ -123,7 +122,7 @@ class Movie(ItemBase):
self.kodi_db.remove_uniqueid(kodi_id, v.KODI_TYPE_MOVIE)
uniqueid = -1
else:
LOG.info("ADD movie plex_id: %s - Title: %s", plex_id, title)
LOG.info("ADD movie plex_id: %s - %s", plex_id, title)
rating_id = self.kodi_db.get_ratingid(kodi_id,
v.KODI_TYPE_MOVIE)
self.kodi_db.add_ratings(rating_id,

View file

@ -497,7 +497,7 @@ class Song(ItemBase, MusicMixin):
# UPDATE THE SONG #####
if update_item:
LOG.info("UPDATE song plex_id: %s - Title: %s", plex_id, title)
LOG.info("UPDATE song plex_id: %s - %s", plex_id, title)
# Use dummy strHash '123' for Kodi
query = "UPDATE path SET strPath = ?, strHash = ? WHERE idPath = ?"
self.kodicursor.execute(query, (path, '123', kodi_pathid))
@ -574,7 +574,7 @@ class Song(ItemBase, MusicMixin):
# OR ADD THE SONG #####
else:
LOG.info("ADD song plex_id: %s - Title: %s", plex_id, title)
LOG.info("ADD song plex_id: %s - %s", plex_id, title)
# Add path
kodi_pathid = self.kodi_db.add_music_path(path, hash_string="123")
# Get the album

View file

@ -181,8 +181,7 @@ class Show(ItemBase, TvShowMixin):
id_parent_path=toppathid)
# UPDATE THE TVSHOW #####
if update_item:
LOG.info("UPDATE tvshow plex_id: %s - Title: %s",
plex_id, api.title())
LOG.info("UPDATE tvshow plex_id: %s - %s", plex_id, api.title())
# update new ratings Kodi 17
rating_id = self.kodi_db.get_ratingid(kodi_id, v.KODI_TYPE_SHOW)
self.kodi_db.update_ratings(kodi_id,
@ -217,8 +216,7 @@ class Show(ItemBase, TvShowMixin):
kodi_id))
# OR ADD THE TVSHOW #####
else:
LOG.info("ADD tvshow plex_id: %s - Title: %s",
plex_id, api.title())
LOG.info("ADD tvshow plex_id: %s - %s", plex_id, api.title())
# Link the path
query = "INSERT INTO tvshowlinkpath(idShow, idPath) values (?, ?)"
self.kodicursor.execute(query, (kodi_id, kodi_pathid))
@ -438,8 +436,7 @@ class Episode(ItemBase, TvShowMixin):
# UPDATE THE EPISODE #####
if update_item:
LOG.info("UPDATE episode plex_id: %s, Title: %s",
plex_id, api.title())
LOG.info("UPDATE episode plex_id: %s - %s", plex_id, api.title())
if kodi_fileid != old_kodi_fileid:
self.kodi_db.remove_file(old_kodi_fileid)
ratingid = self.kodi_db.get_ratingid(kodi_id,
@ -475,8 +472,7 @@ class Episode(ItemBase, TvShowMixin):
# OR ADD THE EPISODE #####
else:
LOG.info("ADD episode plex_id: %s - Title: %s",
plex_id, api.title())
LOG.info("ADD episode plex_id: %s - %s", plex_id, api.title())
# Create the episode entry
rating_id = self.kodi_db.get_ratingid(kodi_id,
v.KODI_TYPE_EPISODE)