~hime/aqua

4e7d49c6caea6439e7b0240aabd4e55dda033d2f — Robbie Straw 7 years ago a516bc5
(fix) misc warnings in aqua-thumbfix
1 files changed, 9 insertions(+), 10 deletions(-)

M src/bin/aqua_thumbfix.rs
M src/bin/aqua_thumbfix.rs => src/bin/aqua_thumbfix.rs +9 -10
@@ 5,21 5,16 @@ extern crate clap;
extern crate diesel;
extern crate dotenv;
extern crate env_logger;
extern crate image;

use aqua::models::{Entry, EntryTag, Tag, NewEntry};
use aqua::models::{Entry, EntryTag, Tag};
use aqua::schema;
use aqua::util::processing;
use clap::{Arg, App};
use diesel::prelude::*;
use diesel::pg::PgConnection;
use dotenv::dotenv;
use std::{env, fs};
use std::error::Error;
use std::fs::OpenOptions;
use std::io::Read;
use std::path::{Path, PathBuf};
use std::time::Duration;
use std::env;
use std::path::PathBuf;

fn main() {
    dotenv().expect("must provide .env file, see README (TODO: haha jk)");


@@ 38,7 33,11 @@ fn main() {


    let content_store = matches.value_of("CONTENT_PATH").unwrap();
    process_entries(&content_store[..]);

    match process_entries(&content_store[..]) {
        Ok(_) => info!("a-ok!"),
        Err(msg) => warn!("thumbfix encountered an error: {:?}", msg),
    }
}

fn establish_connection() -> processing::Result<PgConnection> {


@@ 61,7 60,7 @@ fn process_entries(content_store: &str) -> processing::Result<()> {
        .load::<(Entry, EntryTag)>(&conn)?;

    info!("found {} entries in need of thumbs", entries.len());
    for &(ref entry, ref mapping) in &entries {
    for &(ref entry, ref _mapping) in &entries {
        let ext = entry.mime.as_ref()
            .unwrap()
            .splitn(2, "/")