mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-06-06 16:26:13 +00:00
Increase amount of logging
This commit is contained in:
parent
c321b266f0
commit
9ae99de8dd
30 changed files with 641 additions and 620 deletions
|
@ -35,6 +35,7 @@ class Music(KodiDb):
|
|||
KodiDb.__init__(self, musicdb.cursor)
|
||||
|
||||
def __getitem__(self, key):
|
||||
LOG.debug("__getitem__(%r)", key)
|
||||
|
||||
if key in ('MusicArtist', 'AlbumArtist'):
|
||||
return self.artist
|
||||
|
@ -100,7 +101,7 @@ class Music(KodiDb):
|
|||
self.item_ids.append(obj['Id'])
|
||||
|
||||
def artist_add(self, obj):
|
||||
|
||||
|
||||
''' Add object to kodi.
|
||||
|
||||
safety checks: It looks like Jellyfin supports the same artist multiple times.
|
||||
|
@ -168,7 +169,7 @@ class Music(KodiDb):
|
|||
self.item_ids.append(obj['Id'])
|
||||
|
||||
def album_add(self, obj):
|
||||
|
||||
|
||||
''' Add object to kodi.
|
||||
'''
|
||||
obj['AlbumId'] = self.get_album(*values(obj, QU.get_album_obj))
|
||||
|
@ -176,7 +177,7 @@ class Music(KodiDb):
|
|||
LOG.info("ADD album [%s] %s: %s", obj['AlbumId'], obj['Title'], obj['Id'])
|
||||
|
||||
def album_update(self, obj):
|
||||
|
||||
|
||||
''' Update object to kodi.
|
||||
'''
|
||||
self.jellyfin_db.update_reference(*values(obj, QUEM.update_reference_obj))
|
||||
|
@ -219,7 +220,7 @@ class Music(KodiDb):
|
|||
self.artist(self.server['api'].get_item(temp_obj['Id']), library=None)
|
||||
temp_obj['ArtistId'] = self.jellyfin_db.get_item_by_id(*values(temp_obj, QUEM.get_item_obj))[0]
|
||||
except Exception as error:
|
||||
LOG.error(error)
|
||||
LOG.exception(error)
|
||||
continue
|
||||
|
||||
self.update_artist_name(*values(temp_obj, QU.update_artist_name_obj))
|
||||
|
@ -301,7 +302,7 @@ class Music(KodiDb):
|
|||
return not update
|
||||
|
||||
def song_add(self, obj):
|
||||
|
||||
|
||||
''' Add object to kodi.
|
||||
|
||||
Verify if there's an album associated.
|
||||
|
@ -327,7 +328,7 @@ class Music(KodiDb):
|
|||
LOG.debug("ADD song [%s/%s/%s] %s: %s", obj['PathId'], obj['AlbumId'], obj['SongId'], obj['Id'], obj['Title'])
|
||||
|
||||
def song_update(self, obj):
|
||||
|
||||
|
||||
''' Update object to kodi.
|
||||
'''
|
||||
self.update_path(*values(obj, QU.update_path_obj))
|
||||
|
@ -337,7 +338,7 @@ class Music(KodiDb):
|
|||
LOG.info("UPDATE song [%s/%s/%s] %s: %s", obj['PathId'], obj['AlbumId'], obj['SongId'], obj['Id'], obj['Title'])
|
||||
|
||||
def get_song_path_filename(self, obj, api):
|
||||
|
||||
|
||||
''' Get the path and filename and build it into protocol://path
|
||||
'''
|
||||
obj['Path'] = api.get_file_path(obj['Path'])
|
||||
|
@ -355,7 +356,7 @@ class Music(KodiDb):
|
|||
obj['Filename'] = "stream.%s?static=true" % obj['Container']
|
||||
|
||||
def song_artist_discography(self, obj):
|
||||
|
||||
|
||||
''' Update the artist's discography.
|
||||
'''
|
||||
artists = []
|
||||
|
@ -375,7 +376,7 @@ class Music(KodiDb):
|
|||
self.artist(self.server['api'].get_item(temp_obj['Id']), library=None)
|
||||
temp_obj['ArtistId'] = self.jellyfin_db.get_item_by_id(*values(temp_obj, QUEM.get_item_obj))[0]
|
||||
except Exception as error:
|
||||
LOG.error(error)
|
||||
LOG.exception(error)
|
||||
continue
|
||||
|
||||
self.link(*values(temp_obj, QU.update_link_obj))
|
||||
|
@ -390,7 +391,7 @@ class Music(KodiDb):
|
|||
obj['AlbumArtists'] = artists
|
||||
|
||||
def song_artist_link(self, obj):
|
||||
|
||||
|
||||
''' Assign main artists to song.
|
||||
Artist does not exist in jellyfin database, create the reference.
|
||||
'''
|
||||
|
@ -409,7 +410,7 @@ class Music(KodiDb):
|
|||
self.artist(self.server['api'].get_item(temp_obj['Id']), library=None)
|
||||
temp_obj['ArtistId'] = self.jellyfin_db.get_item_by_id(*values(temp_obj, QUEM.get_item_obj))[0]
|
||||
except Exception as error:
|
||||
LOG.error(error)
|
||||
LOG.exception(error)
|
||||
continue
|
||||
|
||||
self.link_song_artist(*values(temp_obj, QU.update_song_artist_obj))
|
||||
|
@ -424,7 +425,7 @@ class Music(KodiDb):
|
|||
@stop()
|
||||
@jellyfin_item()
|
||||
def userdata(self, item, e_item):
|
||||
|
||||
|
||||
''' This updates: Favorite, LastPlayedDate, Playcount, PlaybackPositionTicks
|
||||
Poster with progress bar
|
||||
'''
|
||||
|
@ -452,7 +453,7 @@ class Music(KodiDb):
|
|||
@stop()
|
||||
@jellyfin_item()
|
||||
def remove(self, item_id, e_item):
|
||||
|
||||
|
||||
''' This updates: Favorite, LastPlayedDate, Playcount, PlaybackPositionTicks
|
||||
Poster with progress bar
|
||||
|
||||
|
@ -468,7 +469,7 @@ class Music(KodiDb):
|
|||
return
|
||||
|
||||
if obj['Media'] == 'song':
|
||||
|
||||
|
||||
self.remove_song(obj['KodiId'], obj['Id'])
|
||||
self.jellyfin_db.remove_wild_item(obj['id'])
|
||||
|
||||
|
@ -513,19 +514,19 @@ class Music(KodiDb):
|
|||
self.jellyfin_db.remove_item(*values(obj, QUEM.delete_item_obj))
|
||||
|
||||
def remove_artist(self, kodi_id, item_id):
|
||||
|
||||
|
||||
self.artwork.delete(kodi_id, "artist")
|
||||
self.delete(kodi_id)
|
||||
LOG.info("DELETE artist [%s] %s", kodi_id, item_id)
|
||||
|
||||
def remove_album(self, kodi_id, item_id):
|
||||
|
||||
|
||||
self.artwork.delete(kodi_id, "album")
|
||||
self.delete_album(kodi_id)
|
||||
LOG.info("DELETE album [%s] %s", kodi_id, item_id)
|
||||
|
||||
def remove_song(self, kodi_id, item_id):
|
||||
|
||||
|
||||
self.artwork.delete(kodi_id, "song")
|
||||
self.delete_song(kodi_id)
|
||||
LOG.info("DELETE song [%s] %s", kodi_id, item_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue