bug-gnupod
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnupod] question regarding smartlist handling in gnupod_search.pl


From: H. Langos
Subject: [Bug-gnupod] question regarding smartlist handling in gnupod_search.pl
Date: Sun, 15 Feb 2009 13:05:59 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Hi,

As I announced a while ago I doing a rewrite of gnupod_search.pl

Reading the source of gnupod_search I've found something strange in the newpl 
handler.


############################################
# Eventhandler for PLAYLIST items
sub newpl {
    # Delete or rename needs to rebuild the XML file
    my ($el, $name, $plt) = @_;
    if(($plt eq "pl" or $plt eq "pcpl") && ref($el->{add}) eq "HASH") { #Add 
action
        if(defined($el->{add}->{id}) && int(keys(%{$el->{add}})) == 1) { #Only 
id
            return unless($keeplist[$el->{add}->{id}]); #ID not on keeplist. 
drop it
        }
    }
    elsif($plt eq "spl" && ref($el->{splcont}) eq "HASH") { #spl content
        if(defined($el->{splcont}->{id}) && int(keys(%{$el->{splcont}})) == 1) 
{ #Only one item
            return unless($keeplist[$el->{splcont}->{id}]);
        }
    }
    GNUpod::XMLhelper::mkfile($el,{$plt."name"=>$name});
}
#############################################


It looks like the elsif branch is only used for smartplaylist items. 
I didn't know that smartplaylists can contain song id items at all.
Could somebody enlighten me?
I don't want to copy'n paste without understanding what I'm doing.

cheers
-h




reply via email to

[Prev in Thread] Current Thread [Next in Thread]