mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 02:06:09 +00:00
flake8
This commit is contained in:
parent
6341bb2c62
commit
8a3ca73d52
14 changed files with 26 additions and 22 deletions
|
@ -1,9 +1,11 @@
|
||||||
import xml.etree.ElementTree as ET
|
import xml.etree.ElementTree as ET
|
||||||
import yaml
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
|
import yaml
|
||||||
|
|
||||||
|
|
||||||
def indent(elem, level=0):
|
def indent(elem, level=0):
|
||||||
'''
|
'''
|
||||||
Nicely formats output xml with newlines and spaces
|
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()):
|
if level and (not elem.tail or not elem.tail.strip()):
|
||||||
elem.tail = i
|
elem.tail = i
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
py_version = sys.argv[1]
|
py_version = sys.argv[1]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
|
|
|
@ -17,8 +17,8 @@ sys.path.insert(0, __base__)
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
from entrypoint import Context # noqa: F402
|
from entrypoint import Context # noqa: E402
|
||||||
from helper import LazyLogger # noqa: F402
|
from helper import LazyLogger # noqa: E402
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,8 @@ sys.path.insert(0, __base__)
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
from entrypoint import Context # noqa: F402
|
from entrypoint import Context # noqa: E402
|
||||||
from helper import LazyLogger # noqa: F402
|
from helper import LazyLogger # noqa: E402
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,8 @@ sys.path.insert(0, __base__)
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
from entrypoint import Events # noqa: F402
|
from entrypoint import Events # noqa: E402
|
||||||
from helper import LazyLogger # noqa: F402
|
from helper import LazyLogger # noqa: E402
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
|
|
@ -224,6 +224,7 @@ def get_library_items(library_id, item_type):
|
||||||
|
|
||||||
return _get(url, params)
|
return _get(url, params)
|
||||||
|
|
||||||
|
|
||||||
def get_albums_by_artist(artist_id, basic=False):
|
def get_albums_by_artist(artist_id, basic=False):
|
||||||
|
|
||||||
params = {
|
params = {
|
||||||
|
|
|
@ -435,13 +435,13 @@ class FullSync(object):
|
||||||
obj.artist(artist)
|
obj.artist(artist)
|
||||||
|
|
||||||
# Get all albums for each 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:
|
for album in artist_albums:
|
||||||
# Add album to database
|
# Add album to database
|
||||||
obj.album(album)
|
obj.album(album)
|
||||||
album_id = album.get('Id')
|
album_id = album.get('Id')
|
||||||
# Get all songs in each album
|
# 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:
|
for song in album_songs:
|
||||||
dialog.update(percent,
|
dialog.update(percent,
|
||||||
message="%s/%s/%s" % (artist_name, album['Name'][:7], song['Name'][:7]))
|
message="%s/%s/%s" % (artist_name, album['Name'][:7], song['Name'][:7]))
|
||||||
|
|
|
@ -435,7 +435,7 @@ class API(object):
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
return response.json()
|
return response.json()
|
||||||
else:
|
else:
|
||||||
return { 'Status_Code': response.status_code }
|
return {'Status_Code': response.status_code}
|
||||||
|
|
||||||
def get_public_info(self, server_address):
|
def get_public_info(self, server_address):
|
||||||
response = self.send_request(server_address, "system/info/public")
|
response = self.send_request(server_address, "system/info/public")
|
||||||
|
|
|
@ -260,7 +260,7 @@ class ConnectionManager(object):
|
||||||
}
|
}
|
||||||
|
|
||||||
servers.append(info)
|
servers.append(info)
|
||||||
|
|
||||||
return servers
|
return servers
|
||||||
|
|
||||||
# TODO: Make IPv6 compatable
|
# TODO: Make IPv6 compatable
|
||||||
|
|
|
@ -111,7 +111,7 @@ class Credentials(object):
|
||||||
existing['ConnectServerId'] = server['ConnectServerId']
|
existing['ConnectServerId'] = server['ConnectServerId']
|
||||||
|
|
||||||
return existing
|
return existing
|
||||||
|
|
||||||
servers.append(server)
|
servers.append(server)
|
||||||
return server
|
return server
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ class HTTP(object):
|
||||||
else:
|
else:
|
||||||
LOG.debug("Server address not set")
|
LOG.debug("Server address not set")
|
||||||
|
|
||||||
if '{UserId}'in string:
|
if '{UserId}' in string:
|
||||||
if self.config.data.get('auth.user_id', None):
|
if self.config.data.get('auth.user_id', None):
|
||||||
string = string.replace("{UserId}", self.config.data['auth.user_id'])
|
string = string.replace("{UserId}", self.config.data['auth.user_id'])
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -376,7 +376,7 @@ class Library(threading.Thread):
|
||||||
include = []
|
include = []
|
||||||
filters = ["tvshows", "boxsets", "musicvideos", "music", "movies"]
|
filters = ["tvshows", "boxsets", "musicvideos", "music", "movies"]
|
||||||
sync = get_sync()
|
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)
|
LOG.info("--[ retrieve changes ] %s", last_sync)
|
||||||
|
|
||||||
# Get the item type of each synced library and build list of types to request
|
# Get the item type of each synced library and build list of types to request
|
||||||
|
@ -395,7 +395,7 @@ class Library(threading.Thread):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Get list of updates from server for synced library types and populate work queues
|
# 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:
|
if result is None:
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -182,13 +182,13 @@ class Movies(KodiDb):
|
||||||
if validate_dvd_dir(obj['Path'] + obj['Filename']):
|
if validate_dvd_dir(obj['Path'] + obj['Filename']):
|
||||||
obj['Path'] = obj['Path'] + obj['Filename'] + '/VIDEO_TS/'
|
obj['Path'] = obj['Path'] + obj['Filename'] + '/VIDEO_TS/'
|
||||||
obj['Filename'] = 'VIDEO_TS.IFO'
|
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'''
|
'''check bluray directries and point it to ./BDMV/index.bdmv'''
|
||||||
if validate_bluray_dir(obj['Path'] + obj['Filename']):
|
if validate_bluray_dir(obj['Path'] + obj['Filename']):
|
||||||
obj['Path'] = obj['Path'] + obj['Filename'] + '/BDMV/'
|
obj['Path'] = obj['Path'] + obj['Filename'] + '/BDMV/'
|
||||||
obj['Filename'] = 'index.bdmv'
|
obj['Filename'] = 'index.bdmv'
|
||||||
LOG.debug("Bluray directry %s",obj['Path'])
|
LOG.debug("Bluray directry %s", obj['Path'])
|
||||||
|
|
||||||
else:
|
else:
|
||||||
obj['Path'] = "plugin://plugin.video.jellyfin/%s/" % obj['LibraryId']
|
obj['Path'] = "plugin://plugin.video.jellyfin/%s/" % obj['LibraryId']
|
||||||
|
|
|
@ -160,9 +160,9 @@ class Player(xbmc.Player):
|
||||||
|
|
||||||
def set_audio_subs(self, audio=None, subtitle=None):
|
def set_audio_subs(self, audio=None, subtitle=None):
|
||||||
if audio:
|
if audio:
|
||||||
audio=int(audio)
|
audio = int(audio)
|
||||||
if subtitle:
|
if subtitle:
|
||||||
subtitle=int(subtitle)
|
subtitle = int(subtitle)
|
||||||
|
|
||||||
''' Only for after playback started
|
''' Only for after playback started
|
||||||
'''
|
'''
|
||||||
|
|
|
@ -18,9 +18,9 @@ sys.path.insert(0, __base__)
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
from entrypoint import Service # noqa: F402
|
from entrypoint import Service # noqa: E402
|
||||||
from helper.utils import settings # noqa: F402
|
from helper.utils import settings # noqa: E402
|
||||||
from helper import LazyLogger # noqa: F402
|
from helper import LazyLogger # noqa: E402
|
||||||
|
|
||||||
#################################################################################################
|
#################################################################################################
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue