mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 02:06:09 +00:00
Merge pull request #69 from TrueTechy/master
Complete __shortcuts__ and __getitem__ cleanup
This commit is contained in:
commit
d93580d7db
5 changed files with 1 additions and 56 deletions
|
@ -109,12 +109,7 @@ class Jellyfin(object):
|
|||
@ensure_client()
|
||||
def __getattr__(self, name):
|
||||
return getattr(self.client[self.server_id], name)
|
||||
|
||||
@ensure_client()
|
||||
def __getitem__(self, key):
|
||||
LOG.debug("__getitem__(%r)", key)
|
||||
return self.client[self.server_id][key]
|
||||
|
||||
|
||||
def construct(self):
|
||||
|
||||
self.client[self.server_id] = JellyfinClient()
|
||||
|
|
|
@ -34,18 +34,6 @@ class Movies(KodiDb):
|
|||
|
||||
KodiDb.__init__(self, videodb.cursor)
|
||||
|
||||
def __getitem__(self, key):
|
||||
LOG.debug("__getitem__(%r)", key)
|
||||
|
||||
if key == 'Movie':
|
||||
return self.movie
|
||||
elif key == 'BoxSet':
|
||||
return self.boxset
|
||||
elif key == 'UserData':
|
||||
return self.userdata
|
||||
elif key in 'Removed':
|
||||
return self.remove
|
||||
|
||||
@stop()
|
||||
@jellyfin_item()
|
||||
@library_check()
|
||||
|
|
|
@ -34,20 +34,6 @@ 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
|
||||
elif key == 'MusicAlbum':
|
||||
return self.album
|
||||
elif key == 'Audio':
|
||||
return self.song
|
||||
elif key == 'UserData':
|
||||
return self.userdata
|
||||
elif key in 'Removed':
|
||||
return self.remove
|
||||
|
||||
@stop()
|
||||
@jellyfin_item()
|
||||
@library_check()
|
||||
|
|
|
@ -34,16 +34,6 @@ class MusicVideos(KodiDb):
|
|||
|
||||
KodiDb.__init__(self, videodb.cursor)
|
||||
|
||||
def __getitem__(self, key):
|
||||
LOG.debug("__getitem__(%r)", key)
|
||||
|
||||
if key == 'MusicVideo':
|
||||
return self.musicvideo
|
||||
elif key == 'UserData':
|
||||
return self.userdata
|
||||
elif key in 'Removed':
|
||||
return self.remove
|
||||
|
||||
@stop()
|
||||
@jellyfin_item()
|
||||
@library_check()
|
||||
|
|
|
@ -37,20 +37,6 @@ class TVShows(KodiDb):
|
|||
|
||||
KodiDb.__init__(self, videodb.cursor)
|
||||
|
||||
def __getitem__(self, key):
|
||||
LOG.debug("__getitem__(%r)", key)
|
||||
|
||||
if key == 'Series':
|
||||
return self.tvshow
|
||||
elif key == 'Season':
|
||||
return self.season
|
||||
elif key == 'Episode':
|
||||
return self.episode
|
||||
elif key == 'UserData':
|
||||
return self.userdata
|
||||
elif key in 'Removed':
|
||||
return self.remove
|
||||
|
||||
@stop()
|
||||
@jellyfin_item()
|
||||
@library_check()
|
||||
|
|
Loading…
Reference in a new issue