From 0be1ec6fcaf031628c4e394a3cbab91a77e57472 Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Thu, 11 May 2023 18:45:48 +0100 Subject: [PATCH] handle bin/cue, ignore archives and torrents --- src/main.rs | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/src/main.rs b/src/main.rs index 405c5f2..5df2759 100644 --- a/src/main.rs +++ b/src/main.rs @@ -181,24 +181,28 @@ fn handle_dir(path: PathBuf) { if let Some(extension) = inode.path().extension().unwrap_or("none".as_ref()).to_str() { match extension.to_string().to_lowercase().as_ref() { - "doc" => { handle_document(inode) } - "docx" => { handle_document(inode) } - "odt" => { handle_document(inode) } - "rtf" => { handle_document(inode) } - "gif" => { handle_gif( inode) } - "jpg" => { handle_image( inode) } - "jpeg" => { handle_image( inode) } - "png" => { handle_image( inode) } - "iso" => { handle_iso( inode) } - "mp3" => { handle_mp3( inode) } - "pdf" => { handle_pdf( inode) } - "avi" => { handle_video( inode) } - "m4v" => { handle_video( inode) } - "mkv" => { handle_video( inode) } - "mp4" => { handle_video( inode) } - "srt" => { handle_video( inode) } - // todo other documents - _ => { println!("Not sure what to do with file: {:?}.", inode.path()); } + "doc" => { handle_document(inode) } + "docx" => { handle_document(inode) } + "odt" => { handle_document(inode) } + "rtf" => { handle_document(inode) } + "gif" => { handle_gif( inode) } + "jpg" => { handle_image( inode) } + "jpeg" => { handle_image( inode) } + "png" => { handle_image( inode) } + "bin" => { handle_iso( inode) } + "cue" => { handle_iso( inode) } + "iso" => { handle_iso( inode) } + "mp3" => { handle_mp3( inode) } + "pdf" => { handle_pdf( inode) } + "avi" => { handle_video( inode) } + "m4v" => { handle_video( inode) } + "mkv" => { handle_video( inode) } + "mp4" => { handle_video( inode) } + "srt" => { handle_video( inode) } + "7z" => { } + "torrent" => { } + "zip" => { } + _ => { println!("Not sure what to do with file: {:?}.", inode.path()); } } } }