From 064056fc0c2c8d977db5342511136ce0fbb0ac7a Mon Sep 17 00:00:00 2001 From: Antoine Gersant Date: Sun, 29 Sep 2019 00:34:45 -0700 Subject: [PATCH] Formatting --- src/db/schema.rs | 138 +++++++++++++++++++++++------------------------ src/server.rs | 11 ++-- 2 files changed, 77 insertions(+), 72 deletions(-) diff --git a/src/db/schema.rs b/src/db/schema.rs index 9fa28d1..172052b 100644 --- a/src/db/schema.rs +++ b/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, - artist -> Nullable, - year -> Nullable, - album -> Nullable, - artwork -> Nullable, - date_added -> Integer, - } + directories (id) { + id -> Integer, + path -> Text, + parent -> Nullable, + artist -> Nullable, + year -> Nullable, + album -> Nullable, + artwork -> Nullable, + 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, - disc_number -> Nullable, - title -> Nullable, - artist -> Nullable, - album_artist -> Nullable, - year -> Nullable, - album -> Nullable, - artwork -> Nullable, - duration -> Nullable, - } + songs (id) { + id -> Integer, + path -> Text, + parent -> Text, + track_number -> Nullable, + disc_number -> Nullable, + title -> Nullable, + artist -> Nullable, + album_artist -> Nullable, + year -> Nullable, + album -> Nullable, + artwork -> Nullable, + duration -> Nullable, + } } table! { - users (id) { - id -> Integer, - name -> Text, - password_hash -> Text, - admin -> Integer, - lastfm_username -> Nullable, - lastfm_session_key -> Nullable, - } + users (id) { + id -> Integer, + name -> Text, + password_hash -> Text, + admin -> Integer, + lastfm_username -> Nullable, + lastfm_session_key -> Nullable, + } } 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, ); diff --git a/src/server.rs b/src/server.rs index a4a4c9b..48613a2 100644 --- a/src/server.rs +++ b/src/server.rs @@ -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), + )) }