Skip to content
Snippets Groups Projects
Commit 95dad62d authored by David Trattnig's avatar David Trattnig
Browse files

Small performance improvement.

parent c9cd1e49
No related branches found
No related tags found
No related merge requests found
...@@ -278,15 +278,15 @@ class CalendarFetcher: ...@@ -278,15 +278,15 @@ class CalendarFetcher:
servicetype = "api_tank_playlist" servicetype = "api_tank_playlist"
playlist = None playlist = None
if not playlist_id:
return None
# If playlist is already fetched, use the existing one # If playlist is already fetched, use the existing one
for playlist in fetched_playlists: for playlist in fetched_playlists:
if playlist["id"] == playlist_id: if playlist["id"] == playlist_id:
self.logger.debug("Playlist #%s already fetched" % playlist_id) self.logger.debug("Playlist #%s already fetched" % playlist_id)
return playlist return playlist
if not playlist_id:
return None
url = self.__build_url__(servicetype, "${ID}", playlist_id) url = self.__build_url__(servicetype, "${ID}", playlist_id)
json_response = self.__fetch_data__(servicetype, url) json_response = self.__fetch_data__(servicetype, url)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment