initialized empty playlist explorer view

This commit is contained in:
euzu
2025-07-29 18:14:43 +02:00
parent d691a29be1
commit 4ada26c207
25 changed files with 308 additions and 140 deletions
+18 -9
View File
@@ -5,18 +5,27 @@ use serde::{Deserialize, Serialize};
pub const PROTOCOL_VERSION: u8 = 1;
pub struct ProtocolHandlerMemory {
pub token: Option<String>,
pub admin: bool,
#[derive(Default)]
pub enum UserRole {
#[default]
Unauthorized,
Admin,
User,
}
impl Default for ProtocolHandlerMemory {
fn default() -> Self {
Self {
token: None,
admin: false,
}
impl UserRole {
pub fn is_admin(&self) -> bool {
self.eq(&UserRole::Admin)
}
pub fn is_user(&self) -> bool {
self.eq(&UserRole::User)
}
}
#[derive(Default)]
pub struct ProtocolHandlerMemory {
pub token: Option<String>,
pub role: UserRole,
}
pub enum ProtocolHandler {