Formatting
This commit is contained in:
parent
e079574879
commit
24c6fcb4f4
4 changed files with 11 additions and 8 deletions
|
@ -112,7 +112,7 @@ fn get_endpoints(db: Arc<DB>, index_channel: Arc<Mutex<Sender<index::Command>>>)
|
||||||
auth_api_mount.mount("/recent/",
|
auth_api_mount.mount("/recent/",
|
||||||
move |request: &mut Request| self::recent(request, db.deref()));
|
move |request: &mut Request| self::recent(request, db.deref()));
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
let db = db.clone();
|
let db = db.clone();
|
||||||
auth_api_mount.mount("/search/",
|
auth_api_mount.mount("/search/",
|
||||||
move |request: &mut Request| self::search(request, db.deref()));
|
move |request: &mut Request| self::search(request, db.deref()));
|
||||||
|
|
10
src/index.rs
10
src/index.rs
|
@ -382,7 +382,7 @@ pub fn update<T>(db: &T) -> Result<()>
|
||||||
clean(db)?;
|
clean(db)?;
|
||||||
populate(db)?;
|
populate(db)?;
|
||||||
info!("Library index update took {} seconds",
|
info!("Library index update took {} seconds",
|
||||||
start.elapsed().as_secs());
|
start.elapsed().as_secs());
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -579,12 +579,12 @@ pub fn get_recent_albums<T>(db: &T, count: i64) -> Result<Vec<Directory>>
|
||||||
pub fn search<T>(db: &T, query: &str) -> Result<Vec<CollectionFile>>
|
pub fn search<T>(db: &T, query: &str) -> Result<Vec<CollectionFile>>
|
||||||
where T: ConnectionSource + VFSSource
|
where T: ConnectionSource + VFSSource
|
||||||
{
|
{
|
||||||
Ok(vec![])
|
Ok(vec![])
|
||||||
// Find dirs with matching path and parent not matching
|
// Find dirs with matching path and parent not matching
|
||||||
|
|
||||||
|
|
||||||
// Find songs with matching title/album/artist
|
// Find songs with matching title/album/artist
|
||||||
// Remove songs within a matched directory
|
// Remove songs within a matched directory
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -115,7 +115,10 @@ fn run() -> Result<()> {
|
||||||
options.optopt("p", "port", "set polaris to run on a custom port", "PORT");
|
options.optopt("p", "port", "set polaris to run on a custom port", "PORT");
|
||||||
options.optopt("d", "database", "set the path to index database", "FILE");
|
options.optopt("d", "database", "set the path to index database", "FILE");
|
||||||
options.optopt("w", "web", "set the path to web client files", "DIRECTORY");
|
options.optopt("w", "web", "set the path to web client files", "DIRECTORY");
|
||||||
options.optopt("l", "log", "set the log level to a value between 0 (off) and 3 (debug)", "LEVEL");
|
options.optopt("l",
|
||||||
|
"log",
|
||||||
|
"set the log level to a value between 0 (off) and 3 (debug)",
|
||||||
|
"LEVEL");
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
options.optflag("f",
|
options.optflag("f",
|
||||||
|
|
|
@ -76,7 +76,7 @@ pub fn count<T>(db: &T) -> Result<i64>
|
||||||
use db::users::dsl::*;
|
use db::users::dsl::*;
|
||||||
let connection = db.get_connection();
|
let connection = db.get_connection();
|
||||||
let count = users.count().get_result(connection.deref())?;
|
let count = users.count().get_result(connection.deref())?;
|
||||||
Ok(count)
|
Ok(count)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_admin<T>(db: &T, username: &str) -> Result<bool>
|
pub fn is_admin<T>(db: &T, username: &str) -> Result<bool>
|
||||||
|
|
Loading…
Add table
Reference in a new issue