From 1fd979b8e0e08d08e6a4605e5365f68ff09767be Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Sun, 18 Jul 2021 22:11:03 -0400 Subject: [PATCH] Skip archived files which cannot be downloaded --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index c8d191c..a8065fc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -162,12 +162,11 @@ pub async fn main() -> Result<()> { debug!(duration = ?files_resp.wait, "sleeping"); sleep(files_resp.wait).await; - // Filter out replaced/deleted files (indicated by null category) + // Filter out replaced/deleted files (indicated by null category) and archived files let files = files_resp .files()? .into_iter() .filter(|file| match file.category { - Some(_) => true, None => { info!( name = file.file_name, @@ -176,6 +175,8 @@ pub async fn main() -> Result<()> { ); false } + Some(category) if category == "ARCHIVED" => false, + Some(_) => true, }); for api_file in files {