Merge pull request #69 from TrueTechy/master

Complete __shortcuts__ and __getitem__ cleanup
This commit is contained in:
Claus Vium 2019-09-09 07:22:53 +02:00 committed by GitHub
commit d93580d7db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 1 additions and 56 deletions

View file

@ -110,11 +110,6 @@ class Jellyfin(object):
def __getattr__(self, name): def __getattr__(self, name):
return getattr(self.client[self.server_id], 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): def construct(self):
self.client[self.server_id] = JellyfinClient() self.client[self.server_id] = JellyfinClient()

View file

@ -34,18 +34,6 @@ class Movies(KodiDb):
KodiDb.__init__(self, videodb.cursor) 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() @stop()
@jellyfin_item() @jellyfin_item()
@library_check() @library_check()

View file

@ -34,20 +34,6 @@ class Music(KodiDb):
KodiDb.__init__(self, musicdb.cursor) 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() @stop()
@jellyfin_item() @jellyfin_item()
@library_check() @library_check()

View file

@ -34,16 +34,6 @@ class MusicVideos(KodiDb):
KodiDb.__init__(self, videodb.cursor) 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() @stop()
@jellyfin_item() @jellyfin_item()
@library_check() @library_check()

View file

@ -37,20 +37,6 @@ class TVShows(KodiDb):
KodiDb.__init__(self, videodb.cursor) 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() @stop()
@jellyfin_item() @jellyfin_item()
@library_check() @library_check()