mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
fix arg handlers and album versions route
This commit is contained in:
@@ -141,6 +141,7 @@ def get_album_versions():
|
||||
artisthash: str = data['artisthash']
|
||||
|
||||
albums = AlbumStore.get_albums_by_artisthash(artisthash)
|
||||
print(base_title, artisthash)
|
||||
|
||||
albums = [
|
||||
a for a in albums
|
||||
@@ -148,6 +149,8 @@ def get_album_versions():
|
||||
create_hash(a.base_title) == create_hash(base_title) and create_hash(og_album_title) != create_hash(a.og_title)
|
||||
]
|
||||
|
||||
print(albums)
|
||||
|
||||
return {
|
||||
"data": albums
|
||||
}
|
||||
|
||||
+4
-4
@@ -44,7 +44,7 @@ class HandleArgs:
|
||||
"""
|
||||
Runs Pyinstaller.
|
||||
"""
|
||||
if ALLARGS.build in ARGS:
|
||||
if ALLARGS.build.value in ARGS:
|
||||
with open("pyinstaller.config.ini", "w", encoding="utf-8") as file:
|
||||
config["DEFAULT"]["BUILD"] = "True"
|
||||
config.write(file)
|
||||
@@ -73,7 +73,7 @@ class HandleArgs:
|
||||
|
||||
@staticmethod
|
||||
def handle_port():
|
||||
if ALLARGS.port in ARGS:
|
||||
if ALLARGS.port.value in ARGS:
|
||||
index = ARGS.index(ALLARGS.port.value)
|
||||
try:
|
||||
port = ARGS[index + 1]
|
||||
@@ -89,7 +89,7 @@ class HandleArgs:
|
||||
|
||||
@staticmethod
|
||||
def handle_host():
|
||||
if ALLARGS.host in ARGS:
|
||||
if ALLARGS.host.value in ARGS:
|
||||
index = ARGS.index(ALLARGS.host.value)
|
||||
|
||||
try:
|
||||
@@ -105,7 +105,7 @@ class HandleArgs:
|
||||
"""
|
||||
Modifies the config path.
|
||||
"""
|
||||
if ALLARGS.config in ARGS:
|
||||
if ALLARGS.config.value in ARGS:
|
||||
index = ARGS.index(ALLARGS.config.value)
|
||||
|
||||
try:
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ def extract_thumb(filepath: str, webp_path: str) -> bool:
|
||||
return False
|
||||
|
||||
|
||||
def extract_date(date_str: str | None) -> int:
|
||||
def extract_date(date_str: str | None, filepath: str) -> int:
|
||||
try:
|
||||
return int(date_str.split("-")[0])
|
||||
except: # pylint: disable=bare-except
|
||||
|
||||
@@ -55,6 +55,7 @@ class Album:
|
||||
if get_flag(ParserFlags.CLEAN_ALBUM_TITLE):
|
||||
# if FromFlags.CLEAN_ALBUM_TITLE:
|
||||
self.title, self.versions = get_base_title_and_versions(self.title)
|
||||
self.base_title = self.title
|
||||
|
||||
if "super_deluxe" in self.versions:
|
||||
self.versions.remove("deluxe")
|
||||
|
||||
@@ -21,7 +21,7 @@ def recent_fav_album_serializer(album: Album) -> dict:
|
||||
"""
|
||||
return {
|
||||
"image": album.image,
|
||||
"title": album.og_title,
|
||||
"title": album.title,
|
||||
"albumhash": album.albumhash,
|
||||
"colors": album.colors,
|
||||
}
|
||||
|
||||
+5
-5
@@ -145,19 +145,19 @@ class ALLARGS(Enum):
|
||||
|
||||
|
||||
class FromFlags:
|
||||
EXTRACT_FEAT = False
|
||||
EXTRACT_FEAT = True
|
||||
"""
|
||||
Whether to extract the featured artists from the song title.
|
||||
"""
|
||||
|
||||
REMOVE_PROD = False
|
||||
REMOVE_PROD = True
|
||||
"""
|
||||
Whether to remove the producers from the song title.
|
||||
"""
|
||||
|
||||
CLEAN_ALBUM_TITLE = False
|
||||
REMOVE_REMASTER_FROM_TRACK = False
|
||||
SHOW_ALBUM_VERSION = False
|
||||
CLEAN_ALBUM_TITLE = True
|
||||
REMOVE_REMASTER_FROM_TRACK = True
|
||||
SHOW_ALBUM_VERSION = True
|
||||
|
||||
DO_PERIODIC_SCANS = True
|
||||
PERIODIC_SCAN_INTERVAL = 300 # seconds
|
||||
|
||||
Reference in New Issue
Block a user