Ajatt-Tools / impd

🍵 AJATT-style passive listening and condensed audio without bloat.
https://tatsumoto-ren.github.io/blog/passive-listening
GNU General Public License v3.0
40 stars 4 forks source link

[Feature Request] Give option to output M3U playlist file rather than depend on MPD #11

Open Daja177 opened 2 months ago

Daja177 commented 2 months ago

As great of a tool impd is, one aspect I'm not too big of a fan of is its dependence on MPD when there are other music players people might want to use. Having the option to create an M3U playlist file would allow people to use any music player that supports M3U, including ones on devices that aren't computers, and also make MPD optional rather than essential.

For quite some time I've achieved this by replacing the reshuffle() function with one with this command:

find "$immersionpod_dir/$current" -type f -printf '%P\n' -iname "*.mp3" -o -iname "*.opus" -o -iname "*.ogg" -o -iname "*.wav" -o -iname "*.m4a" -o -iname "*.wma" | shuf > "$immersionpod_dir/$current/impd.m3u"

This isn't a particularly elegant solution nor do I know how to do a better one, which is why I'm creating an issue rather than a pull request.

tatsumoto-ren commented 1 month ago

This isn't a particularly elegant solution nor do I know how to do a better one, which is why I'm creating an issue rather than a pull request.

I'm not familiar with the m3u format but your solution just prints a list of file names to a *.m3u file. I don't think it can be wrong.

I made a PR that adds this as a new function.