diff --git a/.config/generate_xml.py b/.config/generate_xml.py index a35b995e..da4ae367 100644 --- a/.config/generate_xml.py +++ b/.config/generate_xml.py @@ -1,9 +1,11 @@ import xml.etree.ElementTree as ET -import yaml import sys import os from datetime import datetime +import yaml + + def indent(elem, level=0): ''' Nicely formats output xml with newlines and spaces @@ -23,6 +25,7 @@ def indent(elem, level=0): if level and (not elem.tail or not elem.tail.strip()): elem.tail = i + try: py_version = sys.argv[1] except IndexError: diff --git a/context.py b/context.py index 35655d7d..88eea1b3 100644 --- a/context.py +++ b/context.py @@ -17,8 +17,8 @@ sys.path.insert(0, __base__) ################################################################################################# -from entrypoint import Context # noqa: F402 -from helper import LazyLogger # noqa: F402 +from entrypoint import Context # noqa: E402 +from helper import LazyLogger # noqa: E402 ################################################################################################# diff --git a/context_play.py b/context_play.py index 2788a23d..87d1638d 100644 --- a/context_play.py +++ b/context_play.py @@ -17,8 +17,8 @@ sys.path.insert(0, __base__) ################################################################################################# -from entrypoint import Context # noqa: F402 -from helper import LazyLogger # noqa: F402 +from entrypoint import Context # noqa: E402 +from helper import LazyLogger # noqa: E402 ################################################################################################# diff --git a/default.py b/default.py index a4eb60c4..998ff512 100644 --- a/default.py +++ b/default.py @@ -17,8 +17,8 @@ sys.path.insert(0, __base__) ################################################################################################# -from entrypoint import Events # noqa: F402 -from helper import LazyLogger # noqa: F402 +from entrypoint import Events # noqa: E402 +from helper import LazyLogger # noqa: E402 ################################################################################################# diff --git a/jellyfin_kodi/downloader.py b/jellyfin_kodi/downloader.py index 762a4afe..b2db586b 100644 --- a/jellyfin_kodi/downloader.py +++ b/jellyfin_kodi/downloader.py @@ -224,6 +224,7 @@ def get_library_items(library_id, item_type): return _get(url, params) + def get_albums_by_artist(artist_id, basic=False): params = { diff --git a/jellyfin_kodi/full_sync.py b/jellyfin_kodi/full_sync.py index cebbd565..7a3ca779 100644 --- a/jellyfin_kodi/full_sync.py +++ b/jellyfin_kodi/full_sync.py @@ -435,13 +435,13 @@ class FullSync(object): obj.artist(artist) # Get all albums for each artist - artist_albums = [ album for album in albums if artist_name in album.get('Artists') ] + artist_albums = [album for album in albums if artist_name in album.get('Artists')] for album in artist_albums: # Add album to database obj.album(album) album_id = album.get('Id') # Get all songs in each album - album_songs = [ song for song in songs if album_id == song.get('AlbumId') ] + album_songs = [song for song in songs if album_id == song.get('AlbumId')] for song in album_songs: dialog.update(percent, message="%s/%s/%s" % (artist_name, album['Name'][:7], song['Name'][:7])) diff --git a/jellyfin_kodi/jellyfin/api.py b/jellyfin_kodi/jellyfin/api.py index c6d5ab16..b51de3fa 100644 --- a/jellyfin_kodi/jellyfin/api.py +++ b/jellyfin_kodi/jellyfin/api.py @@ -435,7 +435,7 @@ class API(object): if response.status_code == 200: return response.json() else: - return { 'Status_Code': response.status_code } + return {'Status_Code': response.status_code} def get_public_info(self, server_address): response = self.send_request(server_address, "system/info/public") diff --git a/jellyfin_kodi/jellyfin/connection_manager.py b/jellyfin_kodi/jellyfin/connection_manager.py index 05ed79b4..3dabcccc 100644 --- a/jellyfin_kodi/jellyfin/connection_manager.py +++ b/jellyfin_kodi/jellyfin/connection_manager.py @@ -260,7 +260,7 @@ class ConnectionManager(object): } servers.append(info) - + return servers # TODO: Make IPv6 compatable diff --git a/jellyfin_kodi/jellyfin/credentials.py b/jellyfin_kodi/jellyfin/credentials.py index 42e708a9..661792a7 100644 --- a/jellyfin_kodi/jellyfin/credentials.py +++ b/jellyfin_kodi/jellyfin/credentials.py @@ -111,7 +111,7 @@ class Credentials(object): existing['ConnectServerId'] = server['ConnectServerId'] return existing - + servers.append(server) return server diff --git a/jellyfin_kodi/jellyfin/http.py b/jellyfin_kodi/jellyfin/http.py index ee3b10fa..67b3edb5 100644 --- a/jellyfin_kodi/jellyfin/http.py +++ b/jellyfin_kodi/jellyfin/http.py @@ -56,7 +56,7 @@ class HTTP(object): else: LOG.debug("Server address not set") - if '{UserId}'in string: + if '{UserId}' in string: if self.config.data.get('auth.user_id', None): string = string.replace("{UserId}", self.config.data['auth.user_id']) else: diff --git a/jellyfin_kodi/library.py b/jellyfin_kodi/library.py index 3818ee13..2fa040cc 100644 --- a/jellyfin_kodi/library.py +++ b/jellyfin_kodi/library.py @@ -376,7 +376,7 @@ class Library(threading.Thread): include = [] filters = ["tvshows", "boxsets", "musicvideos", "music", "movies"] sync = get_sync() - whitelist = [ x.replace('Mixed:', "") for x in sync['Whitelist'] ] + whitelist = [x.replace('Mixed:', "") for x in sync['Whitelist']] LOG.info("--[ retrieve changes ] %s", last_sync) # Get the item type of each synced library and build list of types to request @@ -395,7 +395,7 @@ class Library(threading.Thread): try: # Get list of updates from server for synced library types and populate work queues - result = self.server.jellyfin.get_sync_queue(last_sync, ",".join([ x for x in query_filter ])) + result = self.server.jellyfin.get_sync_queue(last_sync, ",".join([x for x in query_filter])) if result is None: return True diff --git a/jellyfin_kodi/objects/movies.py b/jellyfin_kodi/objects/movies.py index 6aa03081..9edb1c9e 100644 --- a/jellyfin_kodi/objects/movies.py +++ b/jellyfin_kodi/objects/movies.py @@ -182,13 +182,13 @@ class Movies(KodiDb): if validate_dvd_dir(obj['Path'] + obj['Filename']): obj['Path'] = obj['Path'] + obj['Filename'] + '/VIDEO_TS/' obj['Filename'] = 'VIDEO_TS.IFO' - LOG.debug("DVD directry %s",obj['Path']) + LOG.debug("DVD directry %s", obj['Path']) '''check bluray directries and point it to ./BDMV/index.bdmv''' if validate_bluray_dir(obj['Path'] + obj['Filename']): obj['Path'] = obj['Path'] + obj['Filename'] + '/BDMV/' obj['Filename'] = 'index.bdmv' - LOG.debug("Bluray directry %s",obj['Path']) + LOG.debug("Bluray directry %s", obj['Path']) else: obj['Path'] = "plugin://plugin.video.jellyfin/%s/" % obj['LibraryId'] diff --git a/jellyfin_kodi/player.py b/jellyfin_kodi/player.py index 0772b57c..93f94eb8 100644 --- a/jellyfin_kodi/player.py +++ b/jellyfin_kodi/player.py @@ -160,9 +160,9 @@ class Player(xbmc.Player): def set_audio_subs(self, audio=None, subtitle=None): if audio: - audio=int(audio) + audio = int(audio) if subtitle: - subtitle=int(subtitle) + subtitle = int(subtitle) ''' Only for after playback started ''' diff --git a/service.py b/service.py index 353cc58a..4d0fb7b7 100644 --- a/service.py +++ b/service.py @@ -18,9 +18,9 @@ sys.path.insert(0, __base__) ################################################################################################# -from entrypoint import Service # noqa: F402 -from helper.utils import settings # noqa: F402 -from helper import LazyLogger # noqa: F402 +from entrypoint import Service # noqa: E402 +from helper.utils import settings # noqa: E402 +from helper import LazyLogger # noqa: E402 #################################################################################################