File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -100,10 +100,15 @@ impl Playlist {
100100 }
101101 }
102102
103- pub fn reverse ( & mut self ) {
103+ pub fn reverse ( & mut self , library : & Library ) {
104104 if let Some ( tracks) = & mut self . tracks {
105105 tracks. reverse ( ) ;
106106 }
107+
108+ // Clear any stored sort order for this playlist
109+ library. cfg . with_state_mut ( |state| {
110+ state. playlist_orders . remove ( & self . id ) ;
111+ } ) ;
107112 }
108113
109114 pub fn sort ( & mut self , key : & SortKey , direction : & SortDirection ) {
Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ impl ViewExt for PlaylistView {
114114 }
115115
116116 if let Command :: Reverse = cmd {
117- self . playlist . reverse ( ) ;
117+ self . playlist . reverse ( & self . library ) ;
118118 let tracks = self . playlist . tracks . as_ref ( ) . unwrap_or ( & Vec :: new ( ) ) . clone ( ) ;
119119 self . list = ListView :: new (
120120 Arc :: new ( RwLock :: new ( tracks) ) ,
You can’t perform that action at this time.
0 commit comments