Compare commits
1 Commits
main
...
queue-resp
Author | SHA1 | Date | |
---|---|---|---|
aa56ba5a7f
|
@@ -83,8 +83,8 @@ jobs:
|
||||
target: ${{ gitea.ref_name }}/coverage/
|
||||
username: gitea-web
|
||||
ssh-key: ${{ secrets.WEB_SYNC_SSH_KEY }}
|
||||
host: pages.pvv.ntnu.no
|
||||
known-hosts: "pages.pvv.ntnu.no ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH2QjfFB+city1SYqltkVqWACfo1j37k+oQQfj13mtgg"
|
||||
host: bekkalokk.pvv.ntnu.no
|
||||
known-hosts: "bekkalokk.pvv.ntnu.no ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEI6VSaDrMG8+flg4/AeHlAFIen8RUzWh6URQKqFegSx"
|
||||
|
||||
docs:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -107,6 +107,6 @@ jobs:
|
||||
target: ${{ gitea.ref_name }}/docs/
|
||||
username: gitea-web
|
||||
ssh-key: ${{ secrets.WEB_SYNC_SSH_KEY }}
|
||||
host: pages.pvv.ntnu.no
|
||||
known-hosts: "pages.pvv.ntnu.no ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH2QjfFB+city1SYqltkVqWACfo1j37k+oQQfj13mtgg"
|
||||
host: bekkalokk.pvv.ntnu.no
|
||||
known-hosts: "bekkalokk.pvv.ntnu.no ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEI6VSaDrMG8+flg4/AeHlAFIen8RUzWh6URQKqFegSx"
|
||||
|
||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@@ -1,5 +1,3 @@
|
||||
/target
|
||||
result
|
||||
result-*
|
||||
|
||||
Cargo.lock
|
||||
result-*
|
95
Cargo.lock
generated
Normal file
95
Cargo.lock
generated
Normal file
@@ -0,0 +1,95 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "diff"
|
||||
version = "0.1.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
|
||||
|
||||
[[package]]
|
||||
name = "empidee"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"indoc",
|
||||
"pretty_assertions",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "indoc"
|
||||
version = "2.0.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"
|
||||
|
||||
[[package]]
|
||||
name = "pretty_assertions"
|
||||
version = "1.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d"
|
||||
dependencies = [
|
||||
"diff",
|
||||
"yansi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.88"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.37"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.210"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a"
|
||||
dependencies = [
|
||||
"serde_derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.210"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.82"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "83540f837a8afc019423a8edb95b52a8effe46957ee402287f4292fae35be021"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "unicode-ident"
|
||||
version = "1.0.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe"
|
||||
|
||||
[[package]]
|
||||
name = "yansi"
|
||||
version = "1.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049"
|
@@ -7,12 +7,12 @@ authors = [
|
||||
description = "A rust implementation of the mpd protocol, both client and serverside"
|
||||
repository = "https://git.pvv.ntnu.no/Grzegorz/empidee"
|
||||
documentation = "https://pages.pvv.ntnu.no/Grzegorz/empidee/main/docs/empidee/"
|
||||
edition = "2024"
|
||||
rust-version = "1.85.0"
|
||||
edition = "2021"
|
||||
rust-version = "1.83.0"
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0.225", features = ["derive"] }
|
||||
serde = { version = "1.0.210", features = ["derive"] }
|
||||
|
||||
[dev-dependencies]
|
||||
indoc = "2.0.6"
|
||||
indoc = "2.0.5"
|
||||
pretty_assertions = "1.4.1"
|
||||
|
12
flake.lock
generated
12
flake.lock
generated
@@ -2,11 +2,11 @@
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1758277210,
|
||||
"narHash": "sha256-iCGWf/LTy+aY0zFu8q12lK8KuZp7yvdhStehhyX1v8w=",
|
||||
"lastModified": 1739866667,
|
||||
"narHash": "sha256-EO1ygNKZlsAC9avfcwHkKGMsmipUk1Uc0TbrEZpkn64=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "8eaee110344796db060382e15d3af0a9fc396e0e",
|
||||
"rev": "73cf49b8ad837ade2de76f87eb53fc85ed5d4680",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -29,11 +29,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1758335443,
|
||||
"narHash": "sha256-2jaGMj32IckpZgBjn7kG4zyJl66T+2A1Fn2ppkHh91o=",
|
||||
"lastModified": 1740277845,
|
||||
"narHash": "sha256-NNU0CdiaSbAeZ8tpDG4aFi9qtcdlItRvk8Xns9oBrVU=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "f1ccb14649cf87e48051a6ac3a571b4a57d84ff3",
|
||||
"rev": "f933070c29f9c1c5457447a51903f27f76ebb519",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@@ -36,7 +36,6 @@
|
||||
default = pkgs.mkShell {
|
||||
nativeBuildInputs = [
|
||||
toolchain
|
||||
pkgs.cargo-edit
|
||||
];
|
||||
|
||||
RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library";
|
||||
|
@@ -1 +0,0 @@
|
||||
style_edition = "2024"
|
@@ -1,8 +1,8 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::commands::{
|
||||
Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
expect_property_type,
|
||||
expect_property_type, Command, Request, RequestParserResult, ResponseAttributes,
|
||||
ResponseParserError,
|
||||
};
|
||||
|
||||
pub struct Channels;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::commands::{
|
||||
Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
expect_property_type,
|
||||
expect_property_type, Command, Request, RequestParserResult, ResponseAttributes,
|
||||
ResponseParserError,
|
||||
};
|
||||
|
||||
pub struct ReadMessages;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct Protocol;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct ProtocolAll;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct ProtocolAvailable;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct ProtocolClear;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct ProtocolDisable;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct ProtocolEnable;
|
||||
|
@@ -30,7 +30,7 @@ impl Command for TagTypes {
|
||||
GenericResponseValue::Binary(_) => {
|
||||
return Err(ResponseParserError::UnexpectedPropertyType(
|
||||
"tagtype", "Binary",
|
||||
));
|
||||
))
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct TagTypesAll;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct TagTypesAvailable;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct TagTypesClear;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct TagTypesDisable;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct TagTypesEnable;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct TagTypesReset;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct ListMounts;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct ListNeighbors;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct Mount;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct Unmount;
|
||||
|
@@ -2,8 +2,8 @@ use std::collections::HashMap;
|
||||
|
||||
use crate::{
|
||||
commands::{
|
||||
Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
|
||||
ResponseParserError, get_and_parse_property, get_property,
|
||||
get_and_parse_property, get_property, Command, Request, RequestParserError,
|
||||
RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
common::Offset,
|
||||
};
|
||||
|
@@ -2,8 +2,8 @@ use std::collections::HashMap;
|
||||
|
||||
use crate::{
|
||||
commands::{
|
||||
Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
|
||||
ResponseParserError, get_and_parse_property,
|
||||
get_and_parse_property, Command, Request, RequestParserError, RequestParserResult,
|
||||
ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
filter::parse_filter,
|
||||
};
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::commands::{
|
||||
Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
|
||||
ResponseParserError, get_and_parse_property,
|
||||
get_and_parse_property, Command, Request, RequestParserError, RequestParserResult,
|
||||
ResponseAttributes, ResponseParserError,
|
||||
};
|
||||
|
||||
pub struct GetFingerprint;
|
||||
|
@@ -1,7 +1,7 @@
|
||||
use crate::{
|
||||
commands::{
|
||||
Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
|
||||
ResponseParserError, expect_property_type,
|
||||
expect_property_type, Command, Request, RequestParserError, RequestParserResult,
|
||||
ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
filter::parse_filter,
|
||||
};
|
||||
|
@@ -2,8 +2,8 @@ use std::collections::HashMap;
|
||||
|
||||
use crate::{
|
||||
commands::{
|
||||
Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
|
||||
ResponseParserError, get_and_parse_property, get_optional_property, get_property,
|
||||
get_and_parse_property, get_optional_property, get_property, Command, Request,
|
||||
RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
common::Offset,
|
||||
};
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::commands::{
|
||||
Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
get_and_parse_property,
|
||||
get_and_parse_property, Command, Request, RequestParserResult, ResponseAttributes,
|
||||
ResponseParserError,
|
||||
};
|
||||
|
||||
pub struct Rescan;
|
||||
|
@@ -2,8 +2,8 @@ use std::collections::HashMap;
|
||||
|
||||
use crate::{
|
||||
commands::{
|
||||
Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
|
||||
ResponseParserError, get_and_parse_property,
|
||||
get_and_parse_property, Command, Request, RequestParserError, RequestParserResult,
|
||||
ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
filter::parse_filter,
|
||||
};
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::commands::{
|
||||
Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
get_and_parse_property,
|
||||
get_and_parse_property, Command, Request, RequestParserResult, ResponseAttributes,
|
||||
ResponseParserError,
|
||||
};
|
||||
|
||||
pub struct Update;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::commands::{
|
||||
Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
expect_property_type,
|
||||
expect_property_type, Command, Request, RequestParserResult, ResponseAttributes,
|
||||
ResponseParserError,
|
||||
};
|
||||
|
||||
pub struct ListPartitions;
|
||||
|
@@ -2,8 +2,8 @@ use std::collections::HashMap;
|
||||
|
||||
use crate::{
|
||||
commands::{
|
||||
Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
get_and_parse_property,
|
||||
get_and_parse_property, Command, Request, RequestParserResult, ResponseAttributes,
|
||||
ResponseParserError,
|
||||
},
|
||||
common::VolumeValue,
|
||||
};
|
||||
|
@@ -4,8 +4,8 @@ use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{
|
||||
commands::{
|
||||
Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
get_property,
|
||||
get_property, Command, Request, RequestParserResult, ResponseAttributes,
|
||||
ResponseParserError,
|
||||
},
|
||||
common::ReplayGainModeMode,
|
||||
};
|
||||
|
@@ -3,8 +3,8 @@ use std::collections::HashMap;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::commands::{
|
||||
Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
get_and_parse_optional_property, get_and_parse_property,
|
||||
get_and_parse_optional_property, get_and_parse_property, Command, Request, RequestParserResult,
|
||||
ResponseAttributes, ResponseParserError,
|
||||
};
|
||||
|
||||
pub struct Stats;
|
||||
|
@@ -6,9 +6,9 @@ use serde::{Deserialize, Serialize};
|
||||
use crate::common::{Audio, BoolOrOneshot, SongId, SongPosition};
|
||||
|
||||
use crate::commands::{
|
||||
get_and_parse_optional_property, get_and_parse_property, get_optional_property, get_property,
|
||||
Command, GenericResponseValue, Request, RequestParserResult, ResponseAttributes,
|
||||
ResponseParserError, get_and_parse_optional_property, get_and_parse_property,
|
||||
get_optional_property, get_property,
|
||||
ResponseParserError,
|
||||
};
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
|
@@ -1,7 +1,7 @@
|
||||
use crate::{
|
||||
commands::{
|
||||
Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
|
||||
ResponseParserError, get_next_and_parse_property,
|
||||
get_next_and_parse_property, Command, Request, RequestParserError, RequestParserResult,
|
||||
ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
common::{SongId, SongPosition},
|
||||
};
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct AddTagId;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct ClearTagId;
|
||||
|
@@ -1,11 +1,11 @@
|
||||
use std::str::FromStr;
|
||||
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
common::OneOrRange,
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct Delete;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct DeleteId;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct Move;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct MoveId;
|
||||
|
@@ -1,12 +1,14 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{Command, RequestParserResult, ResponseAttributes, ResponseParserError},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct Playlist;
|
||||
|
||||
pub type PlaylistResponse = Vec<String>;
|
||||
|
||||
impl Command for Playlist {
|
||||
type Response = ();
|
||||
type Response = PlaylistResponse;
|
||||
const COMMAND: &'static str = "playlist";
|
||||
|
||||
fn parse_request(mut parts: std::str::SplitWhitespace<'_>) -> RequestParserResult<'_> {
|
||||
@@ -17,6 +19,7 @@ impl Command for Playlist {
|
||||
fn parse_response(
|
||||
_parts: ResponseAttributes<'_>,
|
||||
) -> Result<Self::Response, ResponseParserError> {
|
||||
// TODO: 1: https, 2: https, etc.
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
@@ -1,9 +1,9 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
filter::parse_filter,
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct PlaylistFind;
|
||||
@@ -44,6 +44,9 @@ impl Command for PlaylistFind {
|
||||
fn parse_response(
|
||||
_parts: ResponseAttributes<'_>,
|
||||
) -> Result<Self::Response, ResponseParserError> {
|
||||
// Pos:
|
||||
// Id:
|
||||
// (Prio:)
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct PlaylistId;
|
||||
@@ -25,6 +25,9 @@ impl Command for PlaylistId {
|
||||
fn parse_response(
|
||||
_parts: ResponseAttributes<'_>,
|
||||
) -> Result<Self::Response, ResponseParserError> {
|
||||
// Pos:
|
||||
// Id:
|
||||
// (Prio:)
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct PlaylistInfo;
|
||||
@@ -28,6 +28,9 @@ impl Command for PlaylistInfo {
|
||||
fn parse_response(
|
||||
_parts: ResponseAttributes<'_>,
|
||||
) -> Result<Self::Response, ResponseParserError> {
|
||||
// Pos:
|
||||
// Id:
|
||||
// (Prio:)
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
@@ -1,9 +1,9 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
filter::parse_filter,
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct PlaylistSearch;
|
||||
@@ -44,6 +44,9 @@ impl Command for PlaylistSearch {
|
||||
fn parse_response(
|
||||
_parts: ResponseAttributes<'_>,
|
||||
) -> Result<Self::Response, ResponseParserError> {
|
||||
// Pos:
|
||||
// Id:
|
||||
// (Prio:)
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct PlChanges;
|
||||
@@ -33,6 +33,9 @@ impl Command for PlChanges {
|
||||
fn parse_response(
|
||||
parts: ResponseAttributes<'_>,
|
||||
) -> Result<Self::Response, ResponseParserError> {
|
||||
// Pos:
|
||||
// Id:
|
||||
// (Prio:)
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct PlChangesPosId;
|
||||
@@ -33,6 +33,8 @@ impl Command for PlChangesPosId {
|
||||
fn parse_response(
|
||||
parts: ResponseAttributes<'_>,
|
||||
) -> Result<Self::Response, ResponseParserError> {
|
||||
// cpos:
|
||||
// Id:
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct Prio;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct PrioId;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct RangeId;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct Shuffle;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct Swap;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use crate::{
|
||||
Request,
|
||||
commands::{
|
||||
Command, RequestParserError, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
},
|
||||
Request,
|
||||
};
|
||||
|
||||
pub struct SwapId;
|
||||
|
@@ -30,7 +30,7 @@ impl Command for Commands {
|
||||
GenericResponseValue::Binary(_) => {
|
||||
return Err(ResponseParserError::UnexpectedPropertyType(
|
||||
"handler", "Binary",
|
||||
));
|
||||
))
|
||||
}
|
||||
};
|
||||
result.push(value.to_string());
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::commands::{
|
||||
Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
get_and_parse_property, get_property,
|
||||
get_and_parse_property, get_property, Command, Request, RequestParserResult,
|
||||
ResponseAttributes, ResponseParserError,
|
||||
};
|
||||
|
||||
pub struct Config;
|
||||
|
@@ -30,7 +30,7 @@ impl Command for NotCommands {
|
||||
GenericResponseValue::Binary(_) => {
|
||||
return Err(ResponseParserError::UnexpectedPropertyType(
|
||||
"handler", "Binary",
|
||||
));
|
||||
))
|
||||
}
|
||||
};
|
||||
result.push(value.to_string());
|
||||
|
@@ -30,7 +30,7 @@ impl Command for UrlHandlers {
|
||||
GenericResponseValue::Binary(_) => {
|
||||
return Err(ResponseParserError::UnexpectedPropertyType(
|
||||
"handler", "Binary",
|
||||
));
|
||||
))
|
||||
}
|
||||
};
|
||||
url_handlers.push(value.to_string());
|
||||
|
@@ -87,7 +87,7 @@ impl Command for StickerFind {
|
||||
let uri = match uri.1 {
|
||||
GenericResponseValue::Text(s) => s.to_string(),
|
||||
GenericResponseValue::Binary(_) => {
|
||||
return Err(ResponseParserError::UnexpectedPropertyType(uri.0, "Binary"));
|
||||
return Err(ResponseParserError::UnexpectedPropertyType(uri.0, "Binary"))
|
||||
}
|
||||
};
|
||||
|
||||
@@ -96,7 +96,7 @@ impl Command for StickerFind {
|
||||
GenericResponseValue::Binary(_) => {
|
||||
return Err(ResponseParserError::UnexpectedPropertyType(
|
||||
"sticker", "Binary",
|
||||
));
|
||||
))
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::commands::{
|
||||
Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
|
||||
ResponseParserError, get_next_property,
|
||||
get_next_property, Command, Request, RequestParserError, RequestParserResult,
|
||||
ResponseAttributes, ResponseParserError,
|
||||
};
|
||||
|
||||
pub struct StickerGet;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::commands::{
|
||||
Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
expect_property_type,
|
||||
expect_property_type, Command, Request, RequestParserResult, ResponseAttributes,
|
||||
ResponseParserError,
|
||||
};
|
||||
|
||||
pub struct StickerNames;
|
||||
|
@@ -39,7 +39,7 @@ impl Command for StickerNamesTypes {
|
||||
GenericResponseValue::Binary(_) => {
|
||||
return Err(ResponseParserError::UnexpectedPropertyType(
|
||||
"name", "Binary",
|
||||
));
|
||||
))
|
||||
}
|
||||
};
|
||||
|
||||
@@ -48,7 +48,7 @@ impl Command for StickerNamesTypes {
|
||||
GenericResponseValue::Binary(_) => {
|
||||
return Err(ResponseParserError::UnexpectedPropertyType(
|
||||
"type", "Binary",
|
||||
));
|
||||
))
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::commands::{
|
||||
Command, Request, RequestParserResult, ResponseAttributes, ResponseParserError,
|
||||
expect_property_type,
|
||||
expect_property_type, Command, Request, RequestParserResult, ResponseAttributes,
|
||||
ResponseParserError,
|
||||
};
|
||||
|
||||
pub struct StickerTypes;
|
||||
|
@@ -1,8 +1,8 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::commands::{
|
||||
Command, Request, RequestParserError, RequestParserResult, ResponseAttributes,
|
||||
ResponseParserError, get_and_parse_property,
|
||||
get_and_parse_property, Command, Request, RequestParserError, RequestParserResult,
|
||||
ResponseAttributes, ResponseParserError,
|
||||
};
|
||||
|
||||
pub struct PlaylistLength;
|
||||
|
@@ -239,7 +239,7 @@ impl Request {
|
||||
.ok_or(RequestParserError::MissingCommandListEnd(i))?;
|
||||
match line.trim() {
|
||||
"command_list_begin" => {
|
||||
return Err(RequestParserError::NestedCommandList(i));
|
||||
return Err(RequestParserError::NestedCommandList(i))
|
||||
}
|
||||
"command_list_end" => {
|
||||
return Ok((Request::CommandList(commands), rest));
|
||||
|
@@ -1,4 +1,4 @@
|
||||
use crate::{Request, Response, common::SubSystem};
|
||||
use crate::{common::SubSystem, Request, Response};
|
||||
|
||||
pub trait MPDServer {
|
||||
type Error;
|
||||
|
Reference in New Issue
Block a user