Permalink
Browse files

various tiny fixes

gstreamer: escape spaces in filenames to fix GST_DEBUG warning
TINY fix warning (AABox turning Master filter on)
TINY fix warning in rowtip
TINY remove length_estimated from sortable fields
TINY add debug message
TINY fix comment for dates_compact field type
TINY fix warning when loading gmbrc and finding same filename multiple times
  • Loading branch information...
squentin committed May 17, 2015
1 parent cfb03d1 commit d4c41f87c4ae0b0c3edd7080b926c024706f045c
Showing with 8 additions and 5 deletions.
  1. +1 −1 gmusicbrowser_gstreamer-1.x.pm
  2. +2 −0 gmusicbrowser_list.pm
  3. +4 −4 gmusicbrowser_songs.pm
  4. +1 −0 gmusicbrowser_tags.pm
@@ -302,7 +302,7 @@ sub Play
sub set_file
{ my ($self,$f)=@_;
if ($f!~m#^([a-z]+)://#)
{ $f=~s#([^A-Za-z0-9- /\.])#sprintf('%%%02X', ord($1))#seg;
{ $f=~s#([^A-Za-z0-9-/\.])#sprintf('%%%02X', ord($1))#seg;
$f='file://'.$f;
}
$self->{playbin}->set(uri => $f);
View
@@ -1083,6 +1083,7 @@ sub query_tooltip_cb
my ($row)=$path->get_indices;
my $self=::find_ancestor($tv,__PACKAGE__);
my $ID=$self->{array}[$row];
return unless defined $ID;
my $markup= ::ReplaceFieldsAndEsc($ID,$self->{rowtip});
$tooltip->set_markup($markup);
$tv->set_tooltip_row($tooltip,$path);
@@ -6816,6 +6817,7 @@ sub query_tooltip_cb
my $row=$path->{row};
return 0 unless defined $row;
my $ID=$self->{array}[$row];
return unless defined $ID;
my $markup= ::ReplaceFieldsAndEsc($ID,$self->{rowtip});
$tooltip->set_markup($markup);
my $rect=$self->row_to_rect($row);
View
@@ -644,7 +644,7 @@ our %timespan_menu=
# ___free_ : array containing free positions in ___values_ for each size
{ parent => 'dates',
_ => 'substr(___values_, #index# * #bytes#, #nb# * #bytes#)',
index => 'vec(___index_,#ID#,32)', # => max 2**32 dates in total
index => 'vec(___index_,#ID#,32)', # => max 2**32 songs that share the same number of dates, could maybe use 16 bits instead
nb => 'vec(___nb_,#ID#,16)', # => max 2**16 dates per song, could maybe use 8 bits instead
get_list => 'unpack("#packformat#*", #_#)',
init => '___index_= ___values_= ___nb_ = "";',
@@ -1369,7 +1369,7 @@ our %timespan_menu=
length_estimated =>
{ type => 'boolean',
audioinfo=> 'estimated',
flags => 'gars',
flags => 'gar',
},
);
@@ -1759,7 +1759,7 @@ sub MakeLoadSub
$loadedfields{$loaded_slots[$_]}=$_ for 0..$#loaded_slots;
# begin with a line that checks if a given path-file has already been loaded into the library
my $pathfile_code= '$_['.$loadedfields{path}.'] ."/". $_['.$loadedfields{file}.']';
my $code= '$uniq_check{ '.$pathfile_code.' }++ && do { warn qq(warning: file "'.$pathfile_code.'" already in library, skipping.\\n); return };'."\n";
my $code= '$uniq_check{ '.$pathfile_code.' }++ && do { warn "warning: file ".'.$pathfile_code.'." already in library, skipping.\\n"; return };'."\n";
# new file, increment $LastID
$code.='$LastID++;'."\n";
for my $field (@Fields)
@@ -3142,7 +3142,7 @@ our %ReplaceFields=
a => sub { my $s=Songs::Gid_to_Display($_[0],$_[1]); defined $s ? $s : $_[1]; }, #FIXME PHASE1 Gid_to_Display should return something $_[1] if no gid_to_display
l => sub { my $l=Get('length:sum',$_[0],$_[1]); $l=::__x( ($l>=3600 ? _"{hours}h{min}m{sec}s" : _"{min}m{sec}s"), hours => (int $l/3600), min => ($l>=3600 ? sprintf('%02d',$l/60%60) : $l/60%60), sec => sprintf('%02d',$l%60)); },
L => sub { ::CalcListLength( Get('id:list',$_[0],$_[1]),'length:sum' ); }, #FIXME is CalcListLength needed ?
y => sub { Get('year:range',$_[0],$_[1]); },
y => sub { Get('year:range',$_[0],$_[1])||''; },
Y => sub { my $y=Get('year:range',$_[0],$_[1]); return $y? " ($y)" : '' },
s => sub { my $l=Get('id:list',$_[0],$_[1])||[]; ::__n('%d song','%d songs',scalar @$l) },
x => sub { my $nb=@{GetXRef($_[0],$_[1])}; return $_[0] ne 'album' ? ::__("%d Album","%d Albums",$nb) : ::__("%d Artist","%d Artists",$nb); },
View
@@ -39,6 +39,7 @@ INIT
sub Read
{ my ($file,$findlength,$fieldlist)=@_;
return unless $file=~m/\.([^.]+)$/;
warn "Reading tags for $file".($findlength ? " findlength=$findlength" :'').($fieldlist ? " fieldlist=$fieldlist" :'')."\n" if $::debug;
my $format=$FORMATS{lc $1};
return unless $format;
my ($package,$formatstring,$plist)=@$format;

0 comments on commit d4c41f8

Please sign in to comment.