2023-08-18 03:48:34 +00:00
|
|
|
use config::define_config;
|
|
|
|
use config_derive::ConfigOption;
|
2023-08-15 12:45:08 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
2023-08-18 03:48:34 +00:00
|
|
|
use std::path::PathBuf;
|
2023-08-15 12:45:08 +00:00
|
|
|
|
2023-08-18 03:48:34 +00:00
|
|
|
define_config! {
|
2023-08-15 12:45:08 +00:00
|
|
|
Language(Language),
|
|
|
|
MusicPath(MusicPath),
|
|
|
|
PlaylistDatabasePath(PlaylistDatabasePath),
|
|
|
|
}
|
|
|
|
|
2023-08-18 03:48:34 +00:00
|
|
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, ConfigOption)]
|
|
|
|
pub struct Language(String);
|
2023-08-15 12:45:08 +00:00
|
|
|
|
2023-08-18 03:48:34 +00:00
|
|
|
impl std::ops::Deref for Language {
|
|
|
|
type Target = String;
|
|
|
|
fn deref(&self) -> &Self::Target {
|
|
|
|
&self.0
|
2023-08-15 12:45:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-18 03:48:34 +00:00
|
|
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, ConfigOption)]
|
|
|
|
pub struct MusicPath(PathBuf);
|
2023-08-15 12:45:08 +00:00
|
|
|
|
2023-08-18 03:48:34 +00:00
|
|
|
impl std::ops::Deref for MusicPath {
|
2023-08-15 12:45:08 +00:00
|
|
|
type Target = PathBuf;
|
|
|
|
fn deref(&self) -> &Self::Target {
|
|
|
|
&self.0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-18 03:48:34 +00:00
|
|
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, ConfigOption)]
|
|
|
|
pub struct PlaylistDatabasePath(PathBuf);
|
2023-08-15 12:45:08 +00:00
|
|
|
|
2023-08-18 03:48:34 +00:00
|
|
|
impl std::ops::Deref for PlaylistDatabasePath {
|
|
|
|
type Target = PathBuf;
|
2023-08-15 12:45:08 +00:00
|
|
|
fn deref(&self) -> &Self::Target {
|
|
|
|
&self.0
|
|
|
|
}
|
|
|
|
}
|