Formatting
This commit is contained in:
parent
165ed277b6
commit
064056fc0c
2 changed files with 77 additions and 72 deletions
138
src/db/schema.rs
138
src/db/schema.rs
|
@ -1,98 +1,98 @@
|
|||
table! {
|
||||
ddns_config (id) {
|
||||
id -> Integer,
|
||||
host -> Text,
|
||||
username -> Text,
|
||||
password -> Text,
|
||||
}
|
||||
ddns_config (id) {
|
||||
id -> Integer,
|
||||
host -> Text,
|
||||
username -> Text,
|
||||
password -> Text,
|
||||
}
|
||||
}
|
||||
|
||||
table! {
|
||||
directories (id) {
|
||||
id -> Integer,
|
||||
path -> Text,
|
||||
parent -> Nullable<Text>,
|
||||
artist -> Nullable<Text>,
|
||||
year -> Nullable<Integer>,
|
||||
album -> Nullable<Text>,
|
||||
artwork -> Nullable<Text>,
|
||||
date_added -> Integer,
|
||||
}
|
||||
directories (id) {
|
||||
id -> Integer,
|
||||
path -> Text,
|
||||
parent -> Nullable<Text>,
|
||||
artist -> Nullable<Text>,
|
||||
year -> Nullable<Integer>,
|
||||
album -> Nullable<Text>,
|
||||
artwork -> Nullable<Text>,
|
||||
date_added -> Integer,
|
||||
}
|
||||
}
|
||||
|
||||
table! {
|
||||
misc_settings (id) {
|
||||
id -> Integer,
|
||||
auth_secret -> Binary,
|
||||
index_sleep_duration_seconds -> Integer,
|
||||
index_album_art_pattern -> Text,
|
||||
prefix_url -> Text,
|
||||
}
|
||||
misc_settings (id) {
|
||||
id -> Integer,
|
||||
auth_secret -> Binary,
|
||||
index_sleep_duration_seconds -> Integer,
|
||||
index_album_art_pattern -> Text,
|
||||
prefix_url -> Text,
|
||||
}
|
||||
}
|
||||
|
||||
table! {
|
||||
mount_points (id) {
|
||||
id -> Integer,
|
||||
source -> Text,
|
||||
name -> Text,
|
||||
}
|
||||
mount_points (id) {
|
||||
id -> Integer,
|
||||
source -> Text,
|
||||
name -> Text,
|
||||
}
|
||||
}
|
||||
|
||||
table! {
|
||||
playlist_songs (id) {
|
||||
id -> Integer,
|
||||
playlist -> Integer,
|
||||
path -> Text,
|
||||
ordering -> Integer,
|
||||
}
|
||||
playlist_songs (id) {
|
||||
id -> Integer,
|
||||
playlist -> Integer,
|
||||
path -> Text,
|
||||
ordering -> Integer,
|
||||
}
|
||||
}
|
||||
|
||||
table! {
|
||||
playlists (id) {
|
||||
id -> Integer,
|
||||
owner -> Integer,
|
||||
name -> Text,
|
||||
}
|
||||
playlists (id) {
|
||||
id -> Integer,
|
||||
owner -> Integer,
|
||||
name -> Text,
|
||||
}
|
||||
}
|
||||
|
||||
table! {
|
||||
songs (id) {
|
||||
id -> Integer,
|
||||
path -> Text,
|
||||
parent -> Text,
|
||||
track_number -> Nullable<Integer>,
|
||||
disc_number -> Nullable<Integer>,
|
||||
title -> Nullable<Text>,
|
||||
artist -> Nullable<Text>,
|
||||
album_artist -> Nullable<Text>,
|
||||
year -> Nullable<Integer>,
|
||||
album -> Nullable<Text>,
|
||||
artwork -> Nullable<Text>,
|
||||
duration -> Nullable<Integer>,
|
||||
}
|
||||
songs (id) {
|
||||
id -> Integer,
|
||||
path -> Text,
|
||||
parent -> Text,
|
||||
track_number -> Nullable<Integer>,
|
||||
disc_number -> Nullable<Integer>,
|
||||
title -> Nullable<Text>,
|
||||
artist -> Nullable<Text>,
|
||||
album_artist -> Nullable<Text>,
|
||||
year -> Nullable<Integer>,
|
||||
album -> Nullable<Text>,
|
||||
artwork -> Nullable<Text>,
|
||||
duration -> Nullable<Integer>,
|
||||
}
|
||||
}
|
||||
|
||||
table! {
|
||||
users (id) {
|
||||
id -> Integer,
|
||||
name -> Text,
|
||||
password_hash -> Text,
|
||||
admin -> Integer,
|
||||
lastfm_username -> Nullable<Text>,
|
||||
lastfm_session_key -> Nullable<Text>,
|
||||
}
|
||||
users (id) {
|
||||
id -> Integer,
|
||||
name -> Text,
|
||||
password_hash -> Text,
|
||||
admin -> Integer,
|
||||
lastfm_username -> Nullable<Text>,
|
||||
lastfm_session_key -> Nullable<Text>,
|
||||
}
|
||||
}
|
||||
|
||||
joinable!(playlist_songs -> playlists (playlist));
|
||||
joinable!(playlists -> users (owner));
|
||||
|
||||
allow_tables_to_appear_in_same_query!(
|
||||
ddns_config,
|
||||
directories,
|
||||
misc_settings,
|
||||
mount_points,
|
||||
playlist_songs,
|
||||
playlists,
|
||||
songs,
|
||||
users,
|
||||
ddns_config,
|
||||
directories,
|
||||
misc_settings,
|
||||
mount_points,
|
||||
playlist_songs,
|
||||
playlists,
|
||||
songs,
|
||||
users,
|
||||
);
|
||||
|
|
|
@ -34,7 +34,12 @@ pub fn get_server(
|
|||
.manage(db)
|
||||
.manage(command_sender)
|
||||
.mount(&api_url, crate::api::get_routes())
|
||||
.mount(&swagger_url, StaticFiles::from(swagger_dir_path).rank(swagger_routes_rank))
|
||||
.mount(&web_url, StaticFiles::from(web_dir_path).rank(web_routes_rank))
|
||||
)
|
||||
.mount(
|
||||
&swagger_url,
|
||||
StaticFiles::from(swagger_dir_path).rank(swagger_routes_rank),
|
||||
)
|
||||
.mount(
|
||||
&web_url,
|
||||
StaticFiles::from(web_dir_path).rank(web_routes_rank),
|
||||
))
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue