mirror of
https://github.com/agersant/polaris
synced 2024-11-10 10:14:12 +00:00
Updated dependencies
This commit is contained in:
parent
15a10f0ba8
commit
b71a1f6768
4 changed files with 1113 additions and 619 deletions
1686
Cargo.lock
generated
1686
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
16
Cargo.toml
16
Cargo.toml
|
@ -12,21 +12,22 @@ app_dirs = "1.1.1"
|
|||
diesel = { version = "0.99.0", features = ["sqlite"] }
|
||||
diesel_infer_schema = { version = "0.99.0", features = ["sqlite"] }
|
||||
diesel_migrations = { version = "0.99.0", features = ["sqlite"] }
|
||||
error-chain = "0.11.0"
|
||||
error-chain = "0.12.0"
|
||||
getopts = "0.2.15"
|
||||
hyper = "0.11.2"
|
||||
id3 = "0.2.3"
|
||||
image = "0.15.0"
|
||||
image = "0.20.0"
|
||||
iron = "0.5.1"
|
||||
rustfm-scrobble = "0.9.1"
|
||||
lewton = "0.6.2"
|
||||
lewton = "0.9.1"
|
||||
log = "0.3.8"
|
||||
md5 = "0.4.0"
|
||||
metaflac = "0.1.8"
|
||||
mount = "0.3.0"
|
||||
mp3-duration = "0.1.0"
|
||||
params = { git = "https://github.com/euclio/params", branch="update" }
|
||||
rand = "0.3.15"
|
||||
regex = "0.2.2"
|
||||
rand = "0.5.5"
|
||||
regex = "1.0.5"
|
||||
ring = "0.11.0"
|
||||
reqwest = "0.6.2"
|
||||
router = "0.5.1"
|
||||
|
@ -36,18 +37,17 @@ serde_derive = "1.0"
|
|||
serde_json = "1.0"
|
||||
serde-xml-rs = "0.2.1"
|
||||
staticfile = "0.4.0"
|
||||
simplelog = "0.5.2"
|
||||
toml = "0.4.5"
|
||||
typemap = "0.3"
|
||||
url = "1.2.0"
|
||||
log = "0.3.8"
|
||||
simplelog = "0.4.2"
|
||||
|
||||
[dependencies.rusqlite]
|
||||
version = "0.12.0"
|
||||
features = ["bundled"]
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
uuid = "0.5.0"
|
||||
uuid = "0.7.1"
|
||||
|
||||
[target.'cfg(windows)'.dependencies.winapi]
|
||||
version = "0.3.3"
|
||||
|
|
23
src/main.rs
23
src/main.rs
|
@ -64,7 +64,7 @@ use iron::prelude::*;
|
|||
use mount::Mount;
|
||||
#[cfg(unix)]
|
||||
use simplelog::SimpleLogger;
|
||||
use simplelog::{LogLevelFilter, TermLogger};
|
||||
use simplelog::{Level, LevelFilter, TermLogger};
|
||||
use staticfile::Static;
|
||||
use std::path::Path;
|
||||
use std::sync::mpsc::channel;
|
||||
|
@ -87,10 +87,11 @@ mod utils;
|
|||
mod vfs;
|
||||
|
||||
static LOG_CONFIG: simplelog::Config = simplelog::Config {
|
||||
time: Some(simplelog::LogLevel::Error),
|
||||
level: Some(simplelog::LogLevel::Error),
|
||||
target: Some(simplelog::LogLevel::Error),
|
||||
location: Some(simplelog::LogLevel::Error),
|
||||
time: Some(Level::Error),
|
||||
level: Some(Level::Error),
|
||||
target: Some(Level::Error),
|
||||
location: Some(Level::Error),
|
||||
time_format: None,
|
||||
};
|
||||
|
||||
fn main() {
|
||||
|
@ -140,7 +141,7 @@ fn init_log(log_level: LogLevelFilter, options: &getopts::Matches) -> Result<()>
|
|||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
fn init_log(log_level: LogLevelFilter, _: &getopts::Matches) -> Result<()> {
|
||||
fn init_log(log_level: LevelFilter, _: &getopts::Matches) -> Result<()> {
|
||||
if let Err(e) = TermLogger::init(log_level, LOG_CONFIG) {
|
||||
bail!("Error starting terminal logger: {}", e);
|
||||
};
|
||||
|
@ -181,11 +182,11 @@ fn run() -> Result<()> {
|
|||
}
|
||||
|
||||
let log_level = match matches.opt_str("l").as_ref().map(String::as_ref) {
|
||||
Some("0") => LogLevelFilter::Off,
|
||||
Some("1") => LogLevelFilter::Error,
|
||||
Some("2") => LogLevelFilter::Info,
|
||||
Some("3") => LogLevelFilter::Debug,
|
||||
_ => LogLevelFilter::Info,
|
||||
Some("0") => LevelFilter::Off,
|
||||
Some("1") => LevelFilter::Error,
|
||||
Some("2") => LevelFilter::Info,
|
||||
Some("3") => LevelFilter::Debug,
|
||||
_ => LevelFilter::Info,
|
||||
};
|
||||
|
||||
init_log(log_level, &matches)?;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
use image;
|
||||
use image::FilterType;
|
||||
use image::GenericImage;
|
||||
use image::GenericImageView;
|
||||
use image::ImageBuffer;
|
||||
use image::ImageFormat;
|
||||
use std::cmp;
|
||||
use std::collections::hash_map::DefaultHasher;
|
||||
use std::fs::{DirBuilder, File};
|
||||
use std::fs::{DirBuilder};
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::path::*;
|
||||
|
||||
|
@ -52,10 +52,9 @@ pub fn get_thumbnail(real_path: &Path, max_dimension: u32) -> Result<PathBuf> {
|
|||
);
|
||||
final_image.save(&out_path)?;
|
||||
} else {
|
||||
let mut out_file = File::create(&out_path)?;
|
||||
let final_image =
|
||||
source_image.resize_exact(max_dimension, out_dimension, FilterType::Lanczos3);
|
||||
final_image.save(&mut out_file, ImageFormat::PNG)?;
|
||||
final_image.save(&out_path)?;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue