randomplay 0.60 released
Today I released version 0.60 of randomplay, my command-line shuffle-recall-swiss-army-knife music player. It will never make Winamp users happy, but it’s a good substitution for complex combinations of find/grep/xargs/sort that people sometimes use to pick tracks to play. If you can’t see why you’d use it, you probably don’t need it.
The latest version adds two new command-line options, —older-than and —newer-than. These can be used to limit the songs included in the shuffle on the basis of the file modification date. The syntax is fairly flexible, and resembles that used by rdiff-backup for restoration commands. For example:
Randomly play music under the ~/music directory that were added in the past week:
randomplay --newer-than 1W ~/music
Play in order music that is from before this year:
randomplay --norandom --older-than '1/1/2006'
Give a list of filenames of music that were added in the past 6 months, but haven’t been played in the last three months:
randomplay --names-only --newer-than 6M --days 3M
Play, but don’t record in the playing history, music added in the first three months of 2004:
randomplay --noremember --newer-than '1/1/2004' --older-than '4/1/2004'
Unfortunately, this new feature is pretty slow, because it stats each file individually on the initial spidering of the directories to be played. In fact, the startup is always fairly slow if you are searching a large directory hierarchy, since randomplay does not preserve any file index but checks anew on each execution. If you are searching tens of thousands of tracks over NFS (as I do), this can take a minute or so. Suggestions for improving the perfomance of the file modification time detection or of the whole startup are welcome. At some point, I will probably implement an indexing feature, but I like the simplicity of it now where it works basically like the shell find command.
Version 0.60 should show up in Debian unstable shortly.
Joe Buck Jan 28
You don’t need to scan the directory tree every time: you could keep a db of the file names mod times and have a seperate command line option to rebuild it. You could run a cron job to update it, or the user could just do a re-scan when s/he adds new music. Then startup could be much faster: only one file to read.
bleh Jan 28
sounds like you might want to check out xmms2. one of the summer of code projects implemented this feature and as the medialib caches metadata you will not have any uncomfortable load time… and as your script, it does not depend on any X-server running.
http://wiki.xmms2.xmms.se/index.php/Collections_Concept