Skip to content

Commit

Permalink
Separate song paths and names in JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
yuckdevchan committed Nov 2, 2023
1 parent 99ae3b2 commit 368c884
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion json_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def generate_songs_json(artist, album, MUSIC_DIR, CAL_DIR):
return # Album directory not found

songs = sorted(os.listdir(album_dir))
song_data = [{'name': song} for song in songs]
song_data = [{'name': song, 'path': song} for song in songs]
print(song_data)
with open(os.path.join(MUSIC_DIR, CAL_DIR, 'songs', f'{artist}_{album}_songs.json'), 'w') as file: # Save in the "music_index" folder
json.dump(song_data, file)

0 comments on commit 368c884

Please sign in to comment.