Project

General

Profile

Helper script - improves the behaviour of audacious when playing files already in your Library

Added by Dreamcat Four almost 6 years ago

Hi there,
Here is a shell script that caches your playlist entries every 15 minutes

https://gist.github.com/dreamcat4/8e6c06a6bcfbd3f0f03c13b5603000db

If the file you are opening in audacious is already existing in either your 'Library' or 'Radio' playlists. Then this script will just switch to an play that Pre-existing Playlist entry. Rather than append a new entry to the end of the playlist (creating a duplicate entry). Which is what audacious would otherwise do if you launched it directly.

This script also caches your Radio stations as individual .m3u files. And saves them into the hidden folder `~/Music/.radio_m3us/`. So that you can also switch between your internet radio stations quickly and easily. Again, without audacious creating an entire new 'Now Playing' playlist. Or appending a duplicate entry to an existing 'Radio' playlist. Same as with your mp3s.

The improved behaviour offered by this script is pretty helpful. Especially for users who keep their playlists on 'Shuffle' (random) mode at other times.

Therefore, if you are a developer of audacious, please consider making your application work a little more like this, without the need for your users to hunt around to find and install this 3rd party script. Thank you.

The Performance:

Very good. Tested with a playlist of 2785 entries. The caching occurs once every 16m50s (by default) and takes 3-5 seconds. This is all performed with the assistance of another helper program: 'audtool'. Without which, this script would not have been possible!

Warning:

There is also a few sed and greps going on in there too. Therefore, this script will probably fail in unexpected ways if your Artist names or Radio station names, or mp3 Filenames include the IFS seperator character which is '|' (vertical bar).

So make sure none of your Songs or Radio stations in your Library contain '|'. And especially ' | ' with a <space> around either side. Not good for the string matching / will break...