rakepack feeds: Only pull the ones that we can index

This commit is contained in:
Olivier 'reivilibre' 2022-11-27 10:11:13 +00:00
parent 8578ee4b10
commit b254ab1231
1 changed files with 9 additions and 0 deletions

View File

@ -140,6 +140,8 @@ pub fn handle_pack_feed(
Ok(())
}
const USEFUL_RAKEPACKS_TO_PULL_FROM_FEED: [&'static str; 2] = [".icons.pack", ".pages.pack"];
fn find_new_packs(feed_url: Url, processed_list_path: &Path) -> anyhow::Result<BTreeSet<String>> {
let processed_file = OpenOptions::new()
.read(true)
@ -157,6 +159,13 @@ fn find_new_packs(feed_url: Url, processed_list_path: &Path) -> anyhow::Result<B
if line.is_empty() {
continue;
}
if !USEFUL_RAKEPACKS_TO_PULL_FROM_FEED
.iter()
.any(|ext| line.ends_with(ext))
{
// not a sort of rakepack we care about
continue;
}
if processed.contains(&line) {
continue;
}