From 7ec6574adede66c7f06bbd53cfd894a9bf9fef20 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Fri, 4 Nov 2016 02:21:17 -0500 Subject: [PATCH] Rename objects functions To stop using super() --- resources/lib/objects/movies.py | 12 ++++++------ resources/lib/objects/music.py | 18 +++++++++--------- resources/lib/objects/musicvideos.py | 6 +++--- resources/lib/objects/tvshows.py | 18 +++++++++--------- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/resources/lib/objects/movies.py b/resources/lib/objects/movies.py index 07690bcb..b96b39ca 100644 --- a/resources/lib/objects/movies.py +++ b/resources/lib/objects/movies.py @@ -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() diff --git a/resources/lib/objects/music.py b/resources/lib/objects/music.py index fca60236..98a78192 100644 --- a/resources/lib/objects/music.py +++ b/resources/lib/objects/music.py @@ -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): diff --git a/resources/lib/objects/musicvideos.py b/resources/lib/objects/musicvideos.py index 12b69242..cc15a2ab 100644 --- a/resources/lib/objects/musicvideos.py +++ b/resources/lib/objects/musicvideos.py @@ -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")) diff --git a/resources/lib/objects/tvshows.py b/resources/lib/objects/tvshows.py index 7153182f..1282d3e3 100644 --- a/resources/lib/objects/tvshows.py +++ b/resources/lib/objects/tvshows.py @@ -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):