Drop the start-up pass that folds files WordPress listed twice (#83)
Before 0.6.0 the parser took WordPress's numbered player URLs (?_=2) for separate files and downloaded some episodes twice. Since then it drops the repeats while reading (same_file_key), and merge_repeated_enclosures cleaned up what was already stored. Production has run it; on every start since it has only cost a query that finds nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
15
src/main.rs
15
src/main.rs
@@ -422,21 +422,6 @@ async fn daemon(
|
||||
Err(e) => tracing::warn!(error = ?e, "could not retire feeds whose OPML is no longer in config"),
|
||||
}
|
||||
|
||||
// Before the parser knew WordPress's numbered player URLs, a file it listed twice was
|
||||
// downloaded twice. The repeats fold into the first, and their spare copies are deleted.
|
||||
match ctx.db.merge_repeated_enclosures(feed::same_file_key).await {
|
||||
Ok((0, _)) => {}
|
||||
Ok((n, spare)) => {
|
||||
for path in &spare {
|
||||
if let Err(e) = std::fs::remove_file(path) {
|
||||
tracing::warn!(path, error = %e, "could not delete a spare copy");
|
||||
}
|
||||
}
|
||||
tracing::info!(enclosures = n, files = spare.len(), "folded files WordPress listed twice");
|
||||
}
|
||||
Err(e) => tracing::warn!(error = ?e, "could not fold files WordPress listed twice"),
|
||||
}
|
||||
|
||||
let (tx_cmd, mut rx_cmd) = mpsc::channel::<Cmd>(64);
|
||||
|
||||
let web = start_web(&ctx, &config_path, web_addr, &tx_cmd, &events).await?;
|
||||
|
||||
Reference in New Issue
Block a user