Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: If8fe8b38c1d9c4fecd40ff71f88d2ae06a6a6964
30 lines
822 B
Rust
30 lines
822 B
Rust
//! Playlist management: ordered collections of media items.
|
|
|
|
use chrono::{DateTime, Utc};
|
|
use serde::{Deserialize, Serialize};
|
|
use uuid::Uuid;
|
|
|
|
use crate::{model::MediaId, 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>,
|
|
}
|