FireFly Media Server › Firefly Media Server Forums › Firefly Media Server › General Discussion › Option to create dynamic playlists?
- This topic has 2 replies, 2 voices, and was last updated 17 years, 10 months ago by msalerno.
-
AuthorPosts
-
04/12/2006 at 3:19 PM #857msalernoGuest
mt-daapd 0.2.4
GentooIs there a way to create dynamic playlists with Artist, Album or any other attribute?
For example, we can create a playlist by specifying:
"Beck" {
Artist is "Beck"
}But, is there a way to do it with something like:
$ARTIST {
Artist is $ARTIST
}I don’t see anything like that in the docs.
Is it possible?
04/12/2006 at 3:45 PM #7701fizzeParticipantseeing as 0.2.4 is rather old, Id suggest you upgrade to one of the nightlies, especially since the ‘smart’ playlist handling has changed quite a bit.
Your request is kinda intriguing though. 🙂
With $ARTIST the request seems rather silly tbh, because one can just browse by artist, assuming you use a soundbridge…?
Or maybe Im just getting it all plain wrong. 😉
04/12/2006 at 4:10 PM #7702msalernoGuestNo, my request might be silly, I am still new to this, so it’s entirely possible.
I prefer to see lists broken down. True you can sort by artist and album, but it would be nice to create a playlist for an artist or for an album.
I’ll check out a newer version.
Thanks
I wrote a quick script to take care of that, I’m not sure if it’s usefull. It prints the playlist to the stdout.
You will need to install the MP3::Info perl module before you can use the script.
Just: # cpan install MP3::Info
So I can currently:
./playlist.pl /media/music/ ARTIST > /etc/mt-daapd.playlist
or
./playlist.pl /media/music/ ALBUM > /etc/mt-daapd.playlist#!/usr/bin/perl -w
use strict;
use MP3::Info;
my %playlistdata;
unless (@ARGV && @ARGV == 2){
print "Please specify the path and attributen";
print "ex. ./playlist.pl /media/mp3 ARTISTn";
exit;
}
unless (-d $ARGV[0]){
print "Invalid directory given: $ARGV[0]n";
exit;
}
unless ( $ARGV[1] eq "ARTIST" || $ARGV[1] eq "ALBUM" ){
print "Invalid attrib given $ARGV[1]n";
print "Specify either ARTIST or ALBUMn";
exit;
}
chomp(my @mp3s = `find $ARGV[0] -iname *.mp3`);
die "There was an error with the find commandn" if $? != 0;;
foreach my $mp3 (@mp3s){
my $tag = get_mp3tag($mp3) or next;
$playlistdata{$tag->{$ARGV[1]}} = $tag->{"ARTIST"} if !$playlistdata{$tag->{$ARGV[1]}};
}
foreach my $data (keys %playlistdata){
print qq|"$data" { $ARGV[1] is "$data" }n| if $ARGV[1] eq "ARTIST";
print qq|"$data - $playlistdata{$data}" { $ARGV[1] is "$data" }n| if $ARGV[1] eq "ALBUM";
}
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.