Skip to content

Commit

Permalink
Updated script to create directory if necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
mwdle committed Sep 6, 2024
1 parent a8b78f6 commit 6deb816
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions generatePlaylist.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ def generate_m3u_playlist(playlist_directory, music_directory, output_file, excl
Generates an m3u playlist with the given filename in the given directory.
The playlist file will contain relative paths and other information for all files with matching extensions in the given music directory, not including any provided exclusions.
"""
# Ensure that the directories exist
os.makedirs(music_directory, exist_ok=True)

with open(f"{music_directory}{os.path.sep}{output_file}", 'w', encoding='utf-8') as playlist:
# Playlist Header
playlist.write("#EXTM3U\n")
Expand Down

0 comments on commit 6deb816

Please sign in to comment.