MatteoGuadrini / mkpl

Make M3U format playlist from command line
https://matteoguadrini.github.io/mkpl
GNU General Public License v3.0
27 stars 2 forks source link

mkpl enhancement #2

Closed ghost closed 1 year ago

ghost commented 1 year ago

Description

Create a m3u file recursively for every directory?

Proposed names of the parameters (short and long)

-rd recursive directory

Additional context

I think a lot of music collectors follow a folder structure and an easy way to update all their folders with one command will be very helpful

Also, Thanks for creating this project👍 Found this on ask.ubuntu

MatteoGuadrini commented 1 year ago

Hi @soup-eater, maybe I understand what you mean to propose; if I understand correctly, you would like an optional argument to create N playlists (or parts of a global one) in N recursive folders.

mkpl was designed to manage one playlist at a time, leaving the user to manage multiple playlists through his own console (bash, zsh, msdos, powershell, etc...). Anyway, the proposal seems like a good idea to me!

This kind of behavior is redundant for one simple reason; the -r or --recursive flag already acts as a recursion to the directories specified in the -d or --directories flag.

What you want, perhaps, is a new -S or --split flag, which splits the playlist into N parts as many folders are specified. For instance:

$ mkpl myplaylist --directories folder1 folder2 folder3 --split --recursive
$ ls
myplaylist_folder1.m3u myplaylist_folder2.m3u myplaylist_folder3.m3u

WORKAROUND: however this operation is feasible even today without a specific flag; just use a for loop in bash:

$ for folder in "folder1 folder2 folder3"; do mkpl "myplaylist_$folder" --directories $folder --recursive; done
ghost commented 1 year ago

yes, thats exactly it. It appears this funcationality is alredy there 😅

On a sidenote: is it possible to give the playlist file the same name as the directory (without manually adding it)? This will allow the the playlist file to get updated automatically (via a cron job or other) as the folder count grows

MatteoGuadrini commented 1 year ago

I released a few minute ago a new release 1.5.0, that implement the enhancement proposed.