commands: add response types for multiple commands

This commit is contained in:
2025-12-08 00:44:37 +09:00
parent 1f2effb96d
commit 06891c16cd
7 changed files with 84 additions and 8 deletions
+10 -1
View File
@@ -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> {