Fix linting, flake8 and sonarcloud issues

This commit is contained in:
Odd Stråbø 2020-04-19 12:07:55 +02:00
parent 87af711c94
commit 3f63e7c213
27 changed files with 162 additions and 169 deletions

View file

@ -3,18 +3,9 @@ from __future__ import division, absolute_import, print_function, unicode_litera
#################################################################################################
import threading
from six.moves import queue as Queue
from six.moves.urllib.parse import urlencode
from kodi_six import xbmc, xbmcvfs
from helper import LazyLogger
from . import queries as QU
from . import queries_texture as QUTEX
from helper import settings
import requests
from helper import LazyLogger
##################################################################################################

View file

@ -3,11 +3,13 @@ from __future__ import division, absolute_import, print_function, unicode_litera
##################################################################################################
from sqlite3 import IntegrityError
from helper import values
from helper import LazyLogger
from . import artwork
from . import queries as QU
from helper import values
from sqlite3 import IntegrityError
from helper import LazyLogger
##################################################################################################
@ -23,7 +25,7 @@ class Kodi(object):
try:
self.cursor.execute(QU.get_all_people)
except:
except Exception:
# Failed to load the table. Has the table been created?
self._people_cache = {}
else:
@ -276,7 +278,7 @@ class Kodi(object):
self.cursor.execute(QU.delete_tags, args)
for tag in tags:
tag_id = self.get_tag(tag, *args)
self.get_tag(tag, *args)
def add_tag(self, *args):

View file

@ -61,15 +61,15 @@ class Music(Kodi):
try:
self.cursor.execute(QU.get_artist, (musicbrainz,))
result = self.cursor.fetchone()
artist_id = result[0]
artist_id_res = result[0]
artist_name = result[1]
except TypeError:
artist_id = self.add_artist(artist_id, name, musicbrainz)
artist_id_res = self.add_artist(artist_id, name, musicbrainz)
else:
if artist_name != name:
self.update_artist_name(artist_id, name)
return artist_id
return artist_id_res
def add_artist(self, artist_id, name, *args):
@ -77,12 +77,12 @@ class Music(Kodi):
'''
try:
self.cursor.execute(QU.get_artist_by_name, (name,))
artist_id = self.cursor.fetchone()[0]
artist_id_res = self.cursor.fetchone()[0]
except TypeError:
artist_id = artist_id or self.create_entry()
artist_id_res = artist_id or self.create_entry()
self.cursor.execute(QU.add_artist, (artist_id, name,) + args)
return artist_id
return artist_id_res
def update_artist_name(self, *args):
self.cursor.execute(QU.update_artist_name, args)