Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -60,6 +60,7 @@ def process(prompt, lang):
|
|
| 60 |
|
| 61 |
with open(output_csv, "w") as w:
|
| 62 |
writer = csv.writer(w)
|
|
|
|
| 63 |
count = 0
|
| 64 |
for top in I[0]:
|
| 65 |
if count > max_output:
|
|
@@ -67,11 +68,14 @@ def process(prompt, lang):
|
|
| 67 |
|
| 68 |
#formated.append(get_url_myma(top, audio_names, url_dict)
|
| 69 |
#formated.append(audio_names[top].split('.')[0])
|
|
|
|
| 70 |
try :
|
| 71 |
-
|
|
|
|
|
|
|
| 72 |
writer.writerow(dict_catalog[file].values())
|
| 73 |
except KeyError:
|
| 74 |
-
writer.writerow("
|
| 75 |
count += 1
|
| 76 |
|
| 77 |
out.append(file)
|
|
|
|
| 60 |
|
| 61 |
with open(output_csv, "w") as w:
|
| 62 |
writer = csv.writer(w)
|
| 63 |
+
header = False
|
| 64 |
count = 0
|
| 65 |
for top in I[0]:
|
| 66 |
if count > max_output:
|
|
|
|
| 68 |
|
| 69 |
#formated.append(get_url_myma(top, audio_names, url_dict)
|
| 70 |
#formated.append(audio_names[top].split('.')[0])
|
| 71 |
+
file = os.path.splitext(os.path.basename(audio_names[top]))[0]
|
| 72 |
try :
|
| 73 |
+
if not header:
|
| 74 |
+
writer.writerow(list(dict_catalog[file].keys()))
|
| 75 |
+
header = True
|
| 76 |
writer.writerow(dict_catalog[file].values())
|
| 77 |
except KeyError:
|
| 78 |
+
writer.writerow("no metadata provided")
|
| 79 |
count += 1
|
| 80 |
|
| 81 |
out.append(file)
|