Permalink
Browse files

fix -tagedit not working when only 1 file (Close #121)

  • Loading branch information...
squentin committed Jan 14, 2016
1 parent cf95aec commit a6fdbbb4b6eb7074de01cc2e3d8b695a77ea89d4
Showing with 9 additions and 4 deletions.
  1. +6 −2 gmusicbrowser.pl
  2. +3 −2 gmusicbrowser_songs.pm
View
@@ -1691,10 +1691,14 @@ sub Edittag_mode
$dialog->set_default_size(500, 600);
my $edittag;
if (@$Library==1)
{ $edittag=EditTagSimple->new($dialog,$Library->[0]);
{ my $ID= $Library->[0];
$edittag=EditTagSimple->new($ID);
$dialog->signal_connect( response => sub
{ my ($dialog,$response)=@_;
$edittag->save if $response eq 'ok';
if ($response eq 'ok')
{ my @set= $edittag->get_changes;
Songs::Set($ID,\@set,window=>$dialog,noidle=>1) if @set;
}
exit;
});
}
View
@@ -2008,7 +2008,7 @@ sub Write
return $res;
};
Glib::Idle->add(sub
my $write_next= sub
{ my $ID= $IDs->[$i];
if (defined $ID)
{ my $modif;
@@ -2036,7 +2036,8 @@ sub Write
}
::Progress( $pid, current=>$i );
return 1;
});
};
if ($opt{noidle}) { my $c=1; $c=$write_next->() until $c==0; } else { Glib::Idle->add($write_next); }
}
sub Changed # 2nd arg contains list of changed fields as a list or a hash ref

0 comments on commit a6fdbbb

Please sign in to comment.