fix: minor fixes
- restore default debug level when logging to file - return early from generating epubs if there are no articles - fix serialization bug in creating attributes
This commit is contained in:
parent
8691b0166f
commit
d50bbdfb58
3 changed files with 12 additions and 2 deletions
|
@ -155,7 +155,13 @@ impl<'a> TryFrom<ArgMatches<'a>> for AppConfig {
|
|||
arg_matches.is_present("verbosity") && !arg_matches.is_present("log-to-file"),
|
||||
)
|
||||
.log_level(match arg_matches.occurrences_of("verbosity") {
|
||||
0 => LogLevel::Off,
|
||||
0 => {
|
||||
if !arg_matches.is_present("log-to-file") {
|
||||
LogLevel::Off
|
||||
} else {
|
||||
LogLevel::Debug
|
||||
}
|
||||
}
|
||||
1 => LogLevel::Error,
|
||||
2 => LogLevel::Warn,
|
||||
3 => LogLevel::Info,
|
||||
|
|
|
@ -18,6 +18,10 @@ pub fn generate_epubs(
|
|||
app_config: &AppConfig,
|
||||
successful_articles_table: &mut Table,
|
||||
) -> Result<(), Vec<PaperoniError>> {
|
||||
if articles.is_empty() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let bar = if app_config.can_disable_progress_bar {
|
||||
ProgressBar::hidden()
|
||||
} else {
|
||||
|
|
|
@ -103,7 +103,7 @@ pub fn serialize_to_xhtml<W: std::io::Write>(
|
|||
let attrs_str = attrs
|
||||
.map
|
||||
.iter()
|
||||
.filter(|(k, _)| &k.local != "\"")
|
||||
.filter(|(k, _)| !k.local.contains("\""))
|
||||
.map(|(k, v)| {
|
||||
format!(
|
||||
"{}=\"{}\"",
|
||||
|
|
Loading…
Reference in a new issue