Rename objects functions

To stop using super()
This commit is contained in:
angelblue05 2016-11-04 02:21:17 -05:00
parent e06f138d5d
commit 7ec6574ade
4 changed files with 27 additions and 27 deletions

View file

@ -37,14 +37,14 @@ class Movies(Items):
if item_type == "Movie": if item_type == "Movie":
actions = { actions = {
'added': self.added, 'added': self.add_movies,
'update': self.add_update, 'update': self.add_update,
'userdata': self.updateUserdata, 'userdata': self.updateUserdata,
'remove': self.remove 'remove': self.remove
} }
elif item_type == "BoxSet": elif item_type == "BoxSet":
actions = { actions = {
'added': self.added_boxset, 'added': self.add_boxsets,
'update': self.add_updateBoxset, 'update': self.add_updateBoxset,
'remove': self.remove 'remove': self.remove
} }
@ -98,15 +98,15 @@ class Movies(Items):
return self.compare("BoxSet", emby_boxsets['Items'], boxsets) 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): if self.add_update(item, view):
self.content_pop(item.get('Name', "unknown")) 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) self.add_updateBoxset(item)
@catch_except() @catch_except()

View file

@ -44,20 +44,20 @@ class Music(Items):
if item_type == "MusicAlbum": if item_type == "MusicAlbum":
actions = { actions = {
'added': self.added_album, 'added': self.add_albums,
'update': self.add_updateAlbum, 'update': self.add_updateAlbum,
'userdata': self.updateUserdata, 'userdata': self.updateUserdata,
'remove': self.remove 'remove': self.remove
} }
elif item_type in ("MusicArtist", "AlbumArtist"): elif item_type in ("MusicArtist", "AlbumArtist"):
actions = { actions = {
'added': self.added, 'added': self.add_artists,
'update': self.add_updateArtist, 'update': self.add_updateArtist,
'remove': self.remove 'remove': self.remove
} }
elif item_type == "Audio": elif item_type == "Audio":
actions = { actions = {
'added': self.added_song, 'added': self.add_songs,
'update': self.add_updateSong, 'update': self.add_updateSong,
'userdata': self.updateUserdata, 'userdata': self.updateUserdata,
'remove': self.remove 'remove': self.remove
@ -149,19 +149,19 @@ class Music(Items):
return self.compare("Audio", emby_songs['Items'], songs) 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): if self.add_updateArtist(item):
# Add albums # Add albums
all_albums = self.emby.getAlbumsbyArtist(item['Id']) all_albums = self.emby.getAlbumsbyArtist(item['Id'])
self.added_album(all_albums['Items']) 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 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) self.title = "%s - %s" % (item.get('AlbumArtist', "unknown"), self.title)
if self.add_updateAlbum(item): if self.add_updateAlbum(item):
@ -169,11 +169,11 @@ class Music(Items):
all_songs = self.emby.getSongsbyAlbum(item['Id']) all_songs = self.emby.getSongsbyAlbum(item['Id'])
self.added_song(all_songs['Items']) 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 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) self.title = "%s - %s" % (item.get('AlbumArtist', "unknown"), self.title)
if self.add_updateSong(item): if self.add_updateSong(item):

View file

@ -37,7 +37,7 @@ class MusicVideos(Items):
if item_type == "MusicVideo": if item_type == "MusicVideo":
actions = { actions = {
'added': self.added, 'added': self.add_mvideos,
'update': self.add_update, 'update': self.add_update,
'userdata': self.updateUserdata, 'userdata': self.updateUserdata,
'remove': self.remove 'remove': self.remove
@ -76,9 +76,9 @@ class MusicVideos(Items):
return self.compare("MusicVideo", emby_mvideos['Items'], mvideos, view) 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): if self.add_update(item, view):
self.content_pop(item.get('Name', "unknown")) self.content_pop(item.get('Name', "unknown"))

View file

@ -38,20 +38,20 @@ class TVShows(Items):
if item_type == "Series": if item_type == "Series":
actions = { actions = {
'added': self.added, 'added': self.add_shows,
'update': self.add_update, 'update': self.add_update,
'userdata': self.updateUserdata, 'userdata': self.updateUserdata,
'remove': self.remove 'remove': self.remove
} }
elif item_type == "Season": elif item_type == "Season":
actions = { actions = {
'added': self.added_season, 'added': self.add_seasons,
'update': self.add_updateSeason, 'update': self.add_updateSeason,
'remove': self.remove 'remove': self.remove
} }
elif item_type == "Episode": elif item_type == "Episode":
actions = { actions = {
'added': self.added_episode, 'added': self.add_episodes,
'update': self.add_updateEpisode, 'update': self.add_updateEpisode,
'userdata': self.updateUserdata, 'userdata': self.updateUserdata,
'remove': self.remove 'remove': self.remove
@ -196,19 +196,19 @@ class TVShows(Items):
return True 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): if self.add_update(item, view):
# Add episodes # Add episodes
all_episodes = self.emby.getEpisodesbyShow(item['Id']) all_episodes = self.emby.getEpisodesbyShow(item['Id'])
self.added_episode(all_episodes['Items']) 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 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) self.title = "%s - %s" % (item.get('SeriesName', "Unknown"), self.title)
if self.add_updateSeason(item): if self.add_updateSeason(item):
@ -216,11 +216,11 @@ class TVShows(Items):
all_episodes = self.emby.getEpisodesbySeason(item['Id']) all_episodes = self.emby.getEpisodesbySeason(item['Id'])
self.added_episode(all_episodes['Items']) 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 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) self.title = "%s - %s" % (item.get('SeriesName', "Unknown"), self.title)
if self.add_updateEpisode(item): if self.add_updateEpisode(item):