mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-24 09:46:11 +00:00
Rename objects functions
To stop using super()
This commit is contained in:
parent
e06f138d5d
commit
7ec6574ade
4 changed files with 27 additions and 27 deletions
|
@ -37,14 +37,14 @@ class Movies(Items):
|
|||
|
||||
if item_type == "Movie":
|
||||
actions = {
|
||||
'added': self.added,
|
||||
'added': self.add_movies,
|
||||
'update': self.add_update,
|
||||
'userdata': self.updateUserdata,
|
||||
'remove': self.remove
|
||||
}
|
||||
elif item_type == "BoxSet":
|
||||
actions = {
|
||||
'added': self.added_boxset,
|
||||
'added': self.add_boxsets,
|
||||
'update': self.add_updateBoxset,
|
||||
'remove': self.remove
|
||||
}
|
||||
|
@ -98,15 +98,15 @@ class Movies(Items):
|
|||
|
||||
return self.compare("BoxSet", emby_boxsets['Items'], boxsets)
|
||||
|
||||
def added(self, items, total=None, view=None):
|
||||
def add_movies(self, items, total=None, view=None):
|
||||
|
||||
for item in super(Movies, self).added(items, total):
|
||||
for item in self.added(items, total):
|
||||
if self.add_update(item, view):
|
||||
self.content_pop(item.get('Name', "unknown"))
|
||||
|
||||
def added_boxset(self, items, total=None):
|
||||
def add_boxsets(self, items, total=None):
|
||||
|
||||
for item in super(Movies, self).added(items, total):
|
||||
for item in self.added(items, total):
|
||||
self.add_updateBoxset(item)
|
||||
|
||||
@catch_except()
|
||||
|
|
|
@ -44,20 +44,20 @@ class Music(Items):
|
|||
|
||||
if item_type == "MusicAlbum":
|
||||
actions = {
|
||||
'added': self.added_album,
|
||||
'added': self.add_albums,
|
||||
'update': self.add_updateAlbum,
|
||||
'userdata': self.updateUserdata,
|
||||
'remove': self.remove
|
||||
}
|
||||
elif item_type in ("MusicArtist", "AlbumArtist"):
|
||||
actions = {
|
||||
'added': self.added,
|
||||
'added': self.add_artists,
|
||||
'update': self.add_updateArtist,
|
||||
'remove': self.remove
|
||||
}
|
||||
elif item_type == "Audio":
|
||||
actions = {
|
||||
'added': self.added_song,
|
||||
'added': self.add_songs,
|
||||
'update': self.add_updateSong,
|
||||
'userdata': self.updateUserdata,
|
||||
'remove': self.remove
|
||||
|
@ -149,19 +149,19 @@ class Music(Items):
|
|||
|
||||
return self.compare("Audio", emby_songs['Items'], songs)
|
||||
|
||||
def added(self, items, total=None):
|
||||
def add_artists(self, items, total=None):
|
||||
|
||||
for item in super(Music, self).added(items, total):
|
||||
for item in self.added(items, total):
|
||||
if self.add_updateArtist(item):
|
||||
# Add albums
|
||||
all_albums = self.emby.getAlbumsbyArtist(item['Id'])
|
||||
self.added_album(all_albums['Items'])
|
||||
|
||||
def added_album(self, items, total=None):
|
||||
def add_albums(self, items, total=None):
|
||||
|
||||
update = True if not self.total else False
|
||||
|
||||
for item in super(Music, self).added(items, total, update):
|
||||
for item in self.added(items, total, update):
|
||||
self.title = "%s - %s" % (item.get('AlbumArtist', "unknown"), self.title)
|
||||
|
||||
if self.add_updateAlbum(item):
|
||||
|
@ -169,11 +169,11 @@ class Music(Items):
|
|||
all_songs = self.emby.getSongsbyAlbum(item['Id'])
|
||||
self.added_song(all_songs['Items'])
|
||||
|
||||
def added_song(self, items, total=None):
|
||||
def add_songs(self, items, total=None):
|
||||
|
||||
update = True if not self.total else False
|
||||
|
||||
for item in super(Music, self).added(items, total, update):
|
||||
for item in self.added(items, total, update):
|
||||
self.title = "%s - %s" % (item.get('AlbumArtist', "unknown"), self.title)
|
||||
|
||||
if self.add_updateSong(item):
|
||||
|
|
|
@ -37,7 +37,7 @@ class MusicVideos(Items):
|
|||
|
||||
if item_type == "MusicVideo":
|
||||
actions = {
|
||||
'added': self.added,
|
||||
'added': self.add_mvideos,
|
||||
'update': self.add_update,
|
||||
'userdata': self.updateUserdata,
|
||||
'remove': self.remove
|
||||
|
@ -76,9 +76,9 @@ class MusicVideos(Items):
|
|||
|
||||
return self.compare("MusicVideo", emby_mvideos['Items'], mvideos, view)
|
||||
|
||||
def added(self, items, total=None, view=None):
|
||||
def add_mvideos(self, items, total=None, view=None):
|
||||
|
||||
for item in super(MusicVideos, self).added(items, total):
|
||||
for item in self.added(items, total):
|
||||
if self.add_update(item, view):
|
||||
self.content_pop(item.get('Name', "unknown"))
|
||||
|
||||
|
|
|
@ -38,20 +38,20 @@ class TVShows(Items):
|
|||
|
||||
if item_type == "Series":
|
||||
actions = {
|
||||
'added': self.added,
|
||||
'added': self.add_shows,
|
||||
'update': self.add_update,
|
||||
'userdata': self.updateUserdata,
|
||||
'remove': self.remove
|
||||
}
|
||||
elif item_type == "Season":
|
||||
actions = {
|
||||
'added': self.added_season,
|
||||
'added': self.add_seasons,
|
||||
'update': self.add_updateSeason,
|
||||
'remove': self.remove
|
||||
}
|
||||
elif item_type == "Episode":
|
||||
actions = {
|
||||
'added': self.added_episode,
|
||||
'added': self.add_episodes,
|
||||
'update': self.add_updateEpisode,
|
||||
'userdata': self.updateUserdata,
|
||||
'remove': self.remove
|
||||
|
@ -196,19 +196,19 @@ class TVShows(Items):
|
|||
return True
|
||||
|
||||
|
||||
def added(self, items, total=None, view=None):
|
||||
def add_shows(self, items, total=None, view=None):
|
||||
|
||||
for item in super(TVShows, self).added(items, total):
|
||||
for item in self.added(items, total):
|
||||
if self.add_update(item, view):
|
||||
# Add episodes
|
||||
all_episodes = self.emby.getEpisodesbyShow(item['Id'])
|
||||
self.added_episode(all_episodes['Items'])
|
||||
|
||||
def added_season(self, items, total=None, view=None):
|
||||
def add_seasons(self, items, total=None, view=None):
|
||||
|
||||
update = True if not self.total else False
|
||||
|
||||
for item in super(TVShows, self).added(items, total, update):
|
||||
for item in self.added(items, total, update):
|
||||
self.title = "%s - %s" % (item.get('SeriesName', "Unknown"), self.title)
|
||||
|
||||
if self.add_updateSeason(item):
|
||||
|
@ -216,11 +216,11 @@ class TVShows(Items):
|
|||
all_episodes = self.emby.getEpisodesbySeason(item['Id'])
|
||||
self.added_episode(all_episodes['Items'])
|
||||
|
||||
def added_episode(self, items, total=None, view=None):
|
||||
def add_episodes(self, items, total=None, view=None):
|
||||
|
||||
update = True if not self.total else False
|
||||
|
||||
for item in super(TVShows, self).added(items, total, update):
|
||||
for item in self.added(items, total, update):
|
||||
self.title = "%s - %s" % (item.get('SeriesName', "Unknown"), self.title)
|
||||
|
||||
if self.add_updateEpisode(item):
|
||||
|
|
Loading…
Reference in a new issue