Skip to content

Commit

Permalink
fix -tagedit not working when only 1 file (Close #121)
Browse files Browse the repository at this point in the history
  • Loading branch information
squentin committed Jan 14, 2016
1 parent cf95aec commit a6fdbbb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 6 additions & 2 deletions gmusicbrowser.pl
Expand Up @@ -1691,10 +1691,14 @@ sub Edittag_mode
$dialog->set_default_size(500, 600); $dialog->set_default_size(500, 600);
my $edittag; my $edittag;
if (@$Library==1) if (@$Library==1)
{ $edittag=EditTagSimple->new($dialog,$Library->[0]); { my $ID= $Library->[0];
$edittag=EditTagSimple->new($ID);
$dialog->signal_connect( response => sub $dialog->signal_connect( response => sub
{ my ($dialog,$response)=@_; { 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; exit;
}); });
} }
Expand Down
5 changes: 3 additions & 2 deletions gmusicbrowser_songs.pm
Expand Up @@ -2008,7 +2008,7 @@ sub Write
return $res; return $res;
}; };


Glib::Idle->add(sub my $write_next= sub
{ my $ID= $IDs->[$i]; { my $ID= $IDs->[$i];
if (defined $ID) if (defined $ID)
{ my $modif; { my $modif;
Expand Down Expand Up @@ -2036,7 +2036,8 @@ sub Write
} }
::Progress( $pid, current=>$i ); ::Progress( $pid, current=>$i );
return 1; 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 sub Changed # 2nd arg contains list of changed fields as a list or a hash ref
Expand Down

0 comments on commit a6fdbbb

Please sign in to comment.