From a033aac72156e4df2a99a8a67471dc6ec1b567e7 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Tue, 25 Nov 2025 04:02:03 +0900 Subject: [PATCH] common/types: add better alias for `PlaylistVersion` --- src/commands/queue/plchanges.rs | 4 ++-- src/commands/queue/plchangesposid.rs | 4 ++-- src/common/types.rs | 26 +++++++++++++------------- src/request.rs | 4 ++-- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/commands/queue/plchanges.rs b/src/commands/queue/plchanges.rs index 855e78c2..5a4c8679 100644 --- a/src/commands/queue/plchanges.rs +++ b/src/commands/queue/plchanges.rs @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize}; use crate::{ Request, commands::{Command, RequestParserError, RequestParserResult, ResponseParserError}, - common::{Version, WindowRange}, + common::{PlaylistVersion, WindowRange}, request_tokenizer::RequestTokenizer, response_tokenizer::ResponseAttributes, }; @@ -12,7 +12,7 @@ pub struct PlChanges; #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct PlChangesRequest { - pub version: Version, + pub version: PlaylistVersion, pub window: Option, } diff --git a/src/commands/queue/plchangesposid.rs b/src/commands/queue/plchangesposid.rs index 8490ce96..0480e4d2 100644 --- a/src/commands/queue/plchangesposid.rs +++ b/src/commands/queue/plchangesposid.rs @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize}; use crate::{ Request, commands::{Command, RequestParserError, RequestParserResult, ResponseParserError}, - common::{Version, WindowRange}, + common::{PlaylistVersion, WindowRange}, request_tokenizer::RequestTokenizer, response_tokenizer::ResponseAttributes, }; @@ -12,7 +12,7 @@ pub struct PlChangesPosId; #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct PlChangesPosIdRequest { - pub version: Version, + pub version: PlaylistVersion, pub window: Option, } diff --git a/src/common/types.rs b/src/common/types.rs index efdfb41d..a80b5867 100644 --- a/src/common/types.rs +++ b/src/common/types.rs @@ -28,22 +28,22 @@ pub use time_interval::TimeInterval; pub use volume_value::VolumeValue; pub use window_range::WindowRange; -pub type SongPosition = u32; -pub type SongId = u32; -pub type Seconds = u32; -pub type TimeWithFractions = f64; -pub type Priority = u8; -pub type PlaylistName = String; pub type Offset = u32; +pub type PlaylistName = String; +pub type PlaylistVersion = u32; +pub type Priority = u8; +pub type Seconds = u32; +pub type SongId = u32; +pub type SongPosition = u32; +pub type TimeWithFractions = f64; // TODO: use a proper types +pub type AudioOutputId = String; +pub type ChannelName = String; +pub type Feature = String; +pub type PartitionName = String; +pub type Path = String; +pub type StickerType = String; pub type TagName = String; pub type TagValue = String; pub type Uri = String; -pub type Path = String; -pub type Version = String; -pub type Feature = String; -pub type PartitionName = String; -pub type AudioOutputId = String; -pub type ChannelName = String; -pub type StickerType = String; diff --git a/src/request.rs b/src/request.rs index 4019fc20..cb6dfc91 100644 --- a/src/request.rs +++ b/src/request.rs @@ -62,9 +62,9 @@ pub enum Request { PlaylistInfo(Option), PlaylistSearch(Filter, Option, Option), // TODO: which type of range? - PlChanges(Version, Option), + PlChanges(PlaylistVersion, Option), // TODO: which type of range? - PlChangesPosId(Version, Option), + PlChangesPosId(PlaylistVersion, Option), // TODO: which type of range? Prio(Priority, WindowRange), PrioId(Priority, Vec),