diff options
| author | krolxon <krolyxon@tutanota.com> | 2024-04-28 19:21:23 +0530 |
|---|---|---|
| committer | krolxon <krolyxon@tutanota.com> | 2024-04-28 19:21:23 +0530 |
| commit | fd371e896096b03bc5efa7dc59963cbba0c334e7 (patch) | |
| tree | 1c959ba8eae6942f28432b0528153336a08807d7 /src/connection.rs | |
| parent | 7eac9cfbc66c272edaf8c5207b4beaca247d5209 (diff) | |
use mpd's load() to load playlists
Diffstat (limited to 'src/connection.rs')
| -rwxr-xr-x | src/connection.rs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/connection.rs b/src/connection.rs index a929385..1ec76ae 100755 --- a/src/connection.rs +++ b/src/connection.rs @@ -160,16 +160,9 @@ impl Connection { } /// Push all songs of a playlist into queue - pub fn push_playlist(&mut self, playlist: &str) -> Result<()> { - let songs: Vec<Song> = self.conn.playlist(playlist)?; - - for song in songs { - if self.songs_filenames.contains(&song.file) { - let song = self.get_song_with_only_filename(&song.file); - self.conn.push(&song)?; - self.conn.play()?; - } - } + pub fn load_playlist(&mut self, playlist: &str) -> Result<()> { + self.conn.load(playlist, ..)?; + self.conn.play()?; Ok(()) } |
