Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 79d71bcf rédigé par Krocoh's avatar Krocoh Validation de Kubat
Parcourir les fichiers

Adding ID prefix for karas

parent afe761fa
Branches
Étiquettes
1 requête de fusion!161Kagari update
Pipeline #2232 réussi avec des avertissements
......@@ -182,6 +182,7 @@ def search_query(args):
def build_kara_name(data):
"Builds the name of the file from the response dictionary"
kara_id = data["id"]
src_name = data["source_name"]
song_name = data["song_name"]
song_type = data["song_type"]
......@@ -190,7 +191,7 @@ def build_kara_name(data):
language = data["language"]
author = data["author_name"]
kara_name = f"{src_name} - {song_type}{song_nbr} - {song_name}"
kara_name = f"{kara_id} - {src_name} - {song_type}{song_nbr} - {song_name}"
kara_additional = f" ({category}/{language}) by {author}"
return kara_name, kara_additional
......@@ -228,9 +229,7 @@ def dl_mode(args, kara_json):
kara_string = ""
kara_nbr = 0
if len(kara_json) == 1:
if type(kara_json) is list:
kara_json = kara_json[0]
if type(kara_json) is not list:
kara_name, kara_additional = build_kara_name(kara_json)
kara_string = '"' + kara_name + '"' + kara_additional
kara_id = kara_json["id"]
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter