Fix includes for publishing

This commit is contained in:
Edward Shen 2021-07-15 02:45:05 -04:00
parent 3786827f20
commit d3434e8408
Signed by: edward
GPG key ID: 19182661E818369F
3 changed files with 38 additions and 27 deletions

View file

@ -4,7 +4,14 @@ version = "0.5.0"
license = "GPL-3.0-or-later" license = "GPL-3.0-or-later"
authors = ["Edward Shen <code@eddie.sh>"] authors = ["Edward Shen <code@eddie.sh>"]
edition = "2018" edition = "2018"
include = ["src/**/*", "db_queries", "LICENSE", "README.md", "sqlx-data.json"] include = [
"src/**/*",
"db_queries",
"LICENSE",
"README.md",
"sqlx-data.json",
"settings.sample.yaml"
]
description = "A MangaDex@Home implementation in Rust." description = "A MangaDex@Home implementation in Rust."
repository = "https://github.com/edward-shen/mangadex-home-rs" repository = "https://github.com/edward-shen/mangadex-home-rs"

View file

@ -260,31 +260,35 @@ impl Display for InvalidCombination {
impl Error for InvalidCombination {} impl Error for InvalidCombination {}
fn print_preamble_and_warnings(args: &Config) -> Result<(), Box<dyn Error>> { fn print_preamble_and_warnings(args: &Config) -> Result<(), Box<dyn Error>> {
println!(concat!( let build_string = option_env!("VERGEN_GIT_SHA_SHORT")
env!("CARGO_PKG_NAME"), .map(|git_sha| format!(" ({})", git_sha))
" ", .unwrap_or_default();
env!("CARGO_PKG_VERSION"),
" (", println!(
env!("VERGEN_GIT_SHA_SHORT"), concat!(
")", env!("CARGO_PKG_NAME"),
" Copyright (C) 2021 ", " ",
env!("CARGO_PKG_AUTHORS"), env!("CARGO_PKG_VERSION"),
"\n\n", "{} Copyright (C) 2021 ",
env!("CARGO_PKG_NAME"), env!("CARGO_PKG_AUTHORS"),
" is free software: you can redistribute it and/or modify\n\ "\n\n",
it under the terms of the GNU General Public License as published by\n\ env!("CARGO_PKG_NAME"),
the Free Software Foundation, either version 3 of the License, or\n\ " is free software: you can redistribute it and/or modify\n\
(at your option) any later version.\n\n", it under the terms of the GNU General Public License as published by\n\
env!("CARGO_PKG_NAME"), the Free Software Foundation, either version 3 of the License, or\n\
" is distributed in the hope that it will be useful,\n\ (at your option) any later version.\n\n",
but WITHOUT ANY WARRANTY; without even the implied warranty of\n\ env!("CARGO_PKG_NAME"),
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\ " is distributed in the hope that it will be useful,\n\
GNU General Public License for more details.\n\n\ but WITHOUT ANY WARRANTY; without even the implied warranty of\n\
You should have received a copy of the GNU General Public License\n\ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n\
along with ", GNU General Public License for more details.\n\n\
env!("CARGO_PKG_NAME"), You should have received a copy of the GNU General Public License\n\
". If not, see <https://www.gnu.org/licenses/>.\n" along with ",
)); env!("CARGO_PKG_NAME"),
". If not, see <https://www.gnu.org/licenses/>.\n"
),
build_string
);
if args.ephemeral_disk_encryption { if args.ephemeral_disk_encryption {
error!("Encrypted files are _very_ broken; caveat emptor!"); error!("Encrypted files are _very_ broken; caveat emptor!");

View file

@ -111,7 +111,7 @@ pub async fn load_geo_ip_data(license_key: ClientSecret) -> Result<(), DbLoadErr
} }
}) })
.unwrap_or(SystemTime::UNIX_EPOCH); .unwrap_or(SystemTime::UNIX_EPOCH);
let duration = match SystemTime::now().duration_since(dbg!(db_date_created)) { let duration = match SystemTime::now().duration_since(db_date_created) {
Ok(time) => Duration::from_std(time).expect("duration to fit"), Ok(time) => Duration::from_std(time).expect("duration to fit"),
Err(_) => { Err(_) => {
warn!("Clock may have gone backwards?"); warn!("Clock may have gone backwards?");