From 1198f58862dbbbfa5e6669651a5739ed2bcc1c05 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 10 Jul 2023 20:13:57 -0400 Subject: [PATCH] Upgrade mpd to v0.1.0 --- Cargo.lock | 13 +++++++++++-- interpreter/Cargo.toml | 2 +- interpreter/src/lang/iter_block.rs | 3 ++- interpreter/src/processing/mpd.rs | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 902a467..ae3b339 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1142,6 +1142,15 @@ dependencies = [ "time", ] +[[package]] +name = "mpd" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e12cace5746cb0aa78faa6cd2caec9f9c01882fc0e6b54d34685a2d3303ea34" +dependencies = [ + "bufstream", +] + [[package]] name = "mpris-player" version = "0.6.1" @@ -1169,7 +1178,7 @@ dependencies = [ "criterion", "dirs", "m3u8-rs", - "mpd", + "mpd 0.1.0", "rand 0.8.5", "regex 1.9.1", "rusqlite", @@ -1194,7 +1203,7 @@ version = "0.9.0" dependencies = [ "base64", "m3u8-rs", - "mpd", + "mpd 0.0.12", "mpris-player", "muss-interpreter", "rodio", diff --git a/interpreter/Cargo.toml b/interpreter/Cargo.toml index a0615b4..472faa0 100644 --- a/interpreter/Cargo.toml +++ b/interpreter/Cargo.toml @@ -17,7 +17,7 @@ regex = { version = "1" } rand = { version = "0.8" } shellexpand = { version = "2", optional = true } bliss-audio-symphonia = { version = "0.6", optional = true, path = "../bliss-rs" } -mpd = { version = "0.0.12", optional = true } +mpd = { version = "0.1", optional = true } unidecode = { version = "0.3.0", optional = true } base64 = { version = "0.13", optional = true } m3u8-rs = { version = "3.0.0", optional = true } diff --git a/interpreter/src/lang/iter_block.rs b/interpreter/src/lang/iter_block.rs index 8034980..1a63b4d 100644 --- a/interpreter/src/lang/iter_block.rs +++ b/interpreter/src/lang/iter_block.rs @@ -227,7 +227,8 @@ impl ItemBlockFactory { tokens: &mut VecDeque, dict: &LanguageDictionary, ) -> Result, SyntaxError> { - for (i, factory) in self.vocabulary.iter().enumerate() { + //for (i, factory) in self.vocabulary.iter().enumerate() { + for factory in self.vocabulary.iter() { if factory.is_item_op(tokens) { return factory.build_item_op(tokens, self, dict); } diff --git a/interpreter/src/processing/mpd.rs b/interpreter/src/processing/mpd.rs index 8de3f44..dc2b4c4 100644 --- a/interpreter/src/processing/mpd.rs +++ b/interpreter/src/processing/mpd.rs @@ -95,7 +95,7 @@ fn song_to_item(song: Song) -> Item { */ if let Some(dur) = song.duration { - item.set_field("duration", dur.num_seconds().into()); + item.set_field("duration", dur.as_secs().into()); } if let Some(place) = song.place { item.set_field("tracknumber", (place.pos as u64).into());