Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I9a5114addcab5fbff430ab2b919b83466a6a6964
31 lines
814 B
Rust
31 lines
814 B
Rust
//! Playlist management: ordered collections of media items.
|
|
|
|
use chrono::{DateTime, Utc};
|
|
use serde::{Deserialize, Serialize};
|
|
use uuid::Uuid;
|
|
|
|
use crate::model::MediaId;
|
|
use crate::users::UserId;
|
|
|
|
/// A user-owned playlist of media items.
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct Playlist {
|
|
pub id: Uuid,
|
|
pub owner_id: UserId,
|
|
pub name: String,
|
|
pub description: Option<String>,
|
|
pub is_public: bool,
|
|
pub is_smart: bool,
|
|
pub filter_query: Option<String>,
|
|
pub created_at: DateTime<Utc>,
|
|
pub updated_at: DateTime<Utc>,
|
|
}
|
|
|
|
/// An item within a playlist at a specific position.
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct PlaylistItem {
|
|
pub playlist_id: Uuid,
|
|
pub media_id: MediaId,
|
|
pub position: i32,
|
|
pub added_at: DateTime<Utc>,
|
|
}
|