commands: add response types for multiple commands
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{
|
||||
DbSongInfo, Priority, SongId, SongPosition,
|
||||
commands::{Command, CommandRequest, CommandResponse, RequestParserError, ResponseParserError},
|
||||
common::types::{PlaylistVersion, WindowRange},
|
||||
request_tokenizer::RequestTokenizer,
|
||||
@@ -59,7 +60,15 @@ impl CommandRequest<'_> for PlChangesRequest {
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct PlChangesResponse;
|
||||
pub struct PlChangesResponse(Vec<PlChangesResponseEntry>);
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct PlChangesResponseEntry {
|
||||
pub position: SongPosition,
|
||||
pub id: SongId,
|
||||
pub priority: Option<Priority>,
|
||||
pub song_info: DbSongInfo,
|
||||
}
|
||||
|
||||
impl CommandResponse<'_> for PlChangesResponse {
|
||||
fn from_response_enum(response: crate::Response) -> Option<Self> {
|
||||
|
||||
Reference in New Issue
Block a user