fix: errors raised by Pycharm

This commit is contained in:
geoffrey45
2023-02-01 14:00:21 +03:00
parent 95c1524b68
commit 838e19cf0f
14 changed files with 20 additions and 49 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ class CheckArtistImages:
"""
Checks if an artist image exists and downloads it if not.
:param artistname: The artist name
:param artist: The artist name
"""
img_path = Path(settings.ARTIST_IMG_SM_PATH) / f"{artist.artisthash}.webp"
+2 -2
View File
@@ -20,7 +20,7 @@ class GetFilesAndDirs:
try:
entries = os.scandir(self.path)
except FileNotFoundError:
return ([], [])
return [], []
dirs, files = [], []
@@ -56,4 +56,4 @@ class GetFilesAndDirs:
folders = filter(lambda f: f.has_tracks, folders)
return (tracks, folders) # type: ignore
return tracks, folders # type: ignore
+1 -2
View File
@@ -1,5 +1,4 @@
from concurrent.futures import ThreadPoolExecutor
import os
from tqdm import tqdm
from app import settings
@@ -139,4 +138,4 @@ class ProcessTrackThumbnails:
)
)
results = [r for r in results]
list(results)
+1 -6
View File
@@ -111,7 +111,7 @@ def get_tags(filepath: str):
if p == "" or p is None:
maybe = parse_artist_from_filename(filename)
if maybe != []:
if maybe:
setattr(tags, tag, ", ".join(maybe))
else:
setattr(tags, tag, "Unknown")
@@ -174,8 +174,3 @@ def get_tags(filepath: str):
del tags[tag]
return tags
for tag in to_delete:
del tags[tag]
return tags