Skip to content
Permalink
Browse files
minor changes to allow future association of data to genre/labels
includes commented-out example that add pictures to genres
  • Loading branch information
squentin committed May 6, 2012
1 parent 2352842 commit 489d25f1f3a0149459a93c70ce0c92ee72a8076f
Showing with 15 additions and 2 deletions.
  1. +1 −1 gmusicbrowser_list.pm
  2. +14 −1 gmusicbrowser_songs.pm
@@ -1674,7 +1674,7 @@ my @MenuSubGroup=
check => sub {$_[0]{mode} eq 'C'}, notmode => 'S', },
{ label => _"mosaic mode", code => sub { my $self=$_[0]{self}; $self->set_mode(($self->{mode} eq 'mosaic' ? 'list' : 'mosaic'),1);},
check => sub {$_[0]{mode} eq 'M'}, notmode => 'S',
test => sub { my $field=Songs::MainField($_[0]{self}{field}[0]); $field eq 'artist' || $field eq 'album' }, #FIXME use more generic test : does it have pictures
test => sub { Songs::FilterListProp($_[0]{field},'picture') },
},
{ label => _"show the 'All' row", code => sub { my $self=$_[0]{self}; $self->{noall}^=1; $self->SetOption; },
check => sub { !$_[0]{self}{noall} }, mode => 'L',
@@ -146,6 +146,10 @@ our %timespan_menu=
'smartfilter::' => 'si s',
'smartfilter:~' => 'mi m',
default_filter => 'si',

load_extra => '___gid{#SGID#} || return;',
save_extra => 'my %h; while ( my ($sgid,$gid)=each %___gid ) { $h{$sgid}= [#SUBFIELDS#] } delete $h{""}; return \%h;',

},
artists =>
{ _ => '____[#ID#]',
@@ -805,6 +809,14 @@ our %timespan_menu=
alias=> 'on',
alias_trans=> ::_p('Field_aliases',"album,on"), #TRANSLATION: comma-separated list of field aliases for album, these are in addition to english aliases
},
# genre_picture =>
# { name => "Genre picture",
# flags => 'g',
# depend => 'genre',
# property_of => 'genre',
# mainfield => 'genre',
# type => '_picture',
# },
album_picture =>
{ name => _"Album picture",
flags => 'g',
@@ -916,6 +928,7 @@ our %timespan_menu=
FilterList => {search=>1},
edit_order=> 70, edit_many=>1, letter => 'g',
category=>'basic',
# picture_field => 'genre_picture',
},
label =>
{ name => _"Labels", width => 180, flags => 'fgaescpil',
@@ -1689,7 +1702,7 @@ sub MakeSaveSub
push @saved_fields,$save_as;
push @code, Code($field, 'save|get', ID => '$_[0]');
my ($mainfield,$save_extra)=LookupCode($field,'mainfield','save_extra');
if ($save_extra && ( !$mainfield || $mainfield eq $field ))
if ($save_extra && $Def{$field}{_properties} && ( !$mainfield || $mainfield eq $field ))
{ my @subfields= split / /, $Def{$field}{_properties};
if (@subfields)
{ my @extra_code;

0 comments on commit 489d25f

Please sign in to comment.