Steps 7 and 8: torrents, OPML, and polish
librqbit replaces the vendored BitTorrent 4.2.1 tree. Torrents download in place because seeding serves the files it downloaded, so the planned stage-then-move would have broken it. The stall budget now also covers magnet metadata resolution, which otherwise never returns against a dead swarm and wedged the scan. Adds add/rm/import/export, tracing setup, systemd units and README. A successful swarm download is unverified: no reachable peers here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RPyeapneuXrCdojsaiXGbe
This commit is contained in:
18
src/feed.rs
18
src/feed.rs
@@ -9,10 +9,7 @@ use crate::config::Feed as FeedCfg;
|
||||
#[derive(Debug, Default)]
|
||||
pub struct ParsedFeed {
|
||||
pub title: Option<String>,
|
||||
pub link: Option<String>,
|
||||
pub ttl_mins: Option<u64>,
|
||||
/// Feed-level explicit flag; per the original, it overrides the entry level.
|
||||
pub explicit: bool,
|
||||
pub entries: Vec<Entry>,
|
||||
}
|
||||
|
||||
@@ -148,9 +145,7 @@ fn from_rss(ch: rss::Channel) -> ParsedFeed {
|
||||
|
||||
ParsedFeed {
|
||||
title: non_empty(Some(ch.title())),
|
||||
link: non_empty(Some(ch.link())),
|
||||
ttl_mins: ch.ttl().and_then(|t| t.trim().parse().ok()),
|
||||
explicit,
|
||||
entries,
|
||||
}
|
||||
}
|
||||
@@ -205,13 +200,7 @@ fn from_atom(feed: atom_syndication::Feed) -> ParsedFeed {
|
||||
|
||||
ParsedFeed {
|
||||
title: non_empty(Some(feed.title().as_str())),
|
||||
link: feed
|
||||
.links()
|
||||
.iter()
|
||||
.find(|l| l.rel() == "alternate")
|
||||
.map(|l| l.href().to_owned()),
|
||||
ttl_mins: None,
|
||||
explicit: false,
|
||||
entries,
|
||||
}
|
||||
}
|
||||
@@ -261,7 +250,6 @@ mod tests {
|
||||
|
||||
assert_eq!(feed.title.as_deref(), Some("Test Cast"));
|
||||
assert_eq!(feed.ttl_mins, Some(45));
|
||||
assert!(!feed.explicit, "feed-level explicit is 'no'");
|
||||
assert_eq!(feed.entries.len(), 3);
|
||||
|
||||
let ep = &feed.entries[0];
|
||||
@@ -296,8 +284,10 @@ mod tests {
|
||||
<enclosure url="https://x/a.mp3" length="1" type="audio/mpeg"/></item>
|
||||
</channel></rss>"#;
|
||||
let feed = parse(xml).unwrap();
|
||||
assert!(feed.explicit);
|
||||
assert!(feed.entries[0].explicit, "feed level must win");
|
||||
assert!(
|
||||
feed.entries[0].explicit,
|
||||
"the entry says nothing; the feed-level flag must still mark it explicit"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user