@@ -522,7 +522,7 @@ sub action_db_albums {
522522 {
523523 local $_ = $action ;
524524 if (/ ^Add/ ) { mpd_add_items(\@uris ) }
525- elsif (/ ^Insert/ ) { mpd_insert_items (\@uris ) }
525+ elsif (/ ^Insert/ ) { mpd_insert_albums (\@uris ) }
526526 elsif (/ ^Replace/ ) { mpd_replace_with_items(\@uris ) }
527527 elsif (/ ^Rate Album\( s\) / ) { mpd_rate_with_albums(\@uris ) }
528528 }
@@ -552,7 +552,7 @@ sub action_db_tracks {
552552 {
553553 local $_ = $action ;
554554 if (/ ^Add/ ) { mpd_add_items(\@uris ) }
555- elsif (/ ^Insert/ ) { mpd_insert_items (\@uris ) }
555+ elsif (/ ^Insert/ ) { mpd_insert_tracks (\@uris ) }
556556 elsif (/ ^Replace/ ) { mpd_replace_with_items(\@uris ) }
557557 elsif (/ ^Rate Track\( s\) / ) { mpd_rate_with_tracks(\@uris ) }
558558 }
@@ -616,14 +616,25 @@ sub mpd_add_items {
616616 $mpd -> add($_ ) for @{$_ [0]};
617617}
618618
619- sub mpd_insert_items {
619+ sub mpd_insert_tracks {
620620 my $song ;
621621 my $bla = $mpd -> playlist_info();
622622 my $pos = ($mpd -> current_song-> {Pos } +1);
623- my $prio = " 10 " ;
623+ my $prio = " 255 " ;
624624 foreach $song (reverse (@{$_ [0]})) {
625- my $id = $mpd -> add_id($song , $pos );
626- $mpd -> prio_id($prio , $id );
625+ $mpd -> prio_id($prio , $mpd -> add_id($song , $pos ));
626+ $prio --;
627+ $pos ++;
628+ }
629+ }
630+
631+ sub mpd_insert_albums {
632+ my $song ;
633+ my $bla = $mpd -> playlist_info();
634+ my $pos = ($mpd -> current_song-> {Pos } +1);
635+ my $prio = " 255" ;
636+ foreach $song (@{$_ [0]}) {
637+ $mpd -> prio_id($prio , $mpd -> add_id($song , $pos ));
627638 $prio --;
628639 $pos ++;
629640 }
0 commit comments