diff --git a/flake.nix b/flake.nix index 666937b..777b4a3 100644 --- a/flake.nix +++ b/flake.nix @@ -1,18 +1,6 @@ { description = "Archivr - An open-source archive manager"; - nixConfig = { - extra-substituters = [ - "https://cache.thegeneralist01.com/" - "https://cache.garnix.io/" - "https://cache.nixos.org/" - ]; - extra-trusted-public-keys = [ - "cache.thegeneralist01.com:jkKcenR877r7fQuWq6cr0JKv2piqBWmYLAYsYsSJnT4=" - "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" - ]; - }; - inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; outputs = @@ -33,7 +21,7 @@ pname = "archivr"; version = "0.1.0"; src = pkgs.lib.cleanSource ./.; - cargoHash = "sha256-4m+4SMYA/rJ0eHEOc32zA2VdZI1pqzB5NenD0R0f2zM="; + cargoHash = "sha256-y47+Fmp3BID86aPnLtrvzg40lOr9cHyg/38+onisK7w="; nativeBuildInputs = [ pkgs.pkg-config ]; }; archivr = pkgs.stdenv.mkDerivation { @@ -61,7 +49,6 @@ }; in { - default = archivr; archivr = archivr; archivr-unwrapped = archivr_unwrapped; } diff --git a/src/main.rs b/src/main.rs index 1da0cb3..240ea55 100644 --- a/src/main.rs +++ b/src/main.rs @@ -77,7 +77,7 @@ enum Source { // INFO: yt-dlp supports a lot of sites; so, when archiving (for example) a website, the user // -> should be asked whether they want to archive the whole website or just the video(s) on it. fn determine_source(path: &str) -> Source { - // INFO: Extractor URLs can be found here: + // INFO: Extractors' URLs can be found here: // -> https://github.com/yt-dlp/yt-dlp/tree/dfc0a84c192a7357dd1768cc345d590253a14fe5/yt_dlp/extractor // TEST: X posts can have multiple videos. @@ -272,7 +272,13 @@ fn main() -> Result<()> { // Dir or whatever. it's midnight and my brain ain't wording/braining. if hash_exists { println!("File already archived."); - let _ = fs::remove_file(store_path.join("temp").join(×tamp)); + let _ = fs::remove_file( + store_path + .join("temp") + .join(×tamp) + .join(format!("{timestamp}{file_extension}")), + ); + process::exit(0); } else { move_temp_to_raw( &store_path @@ -282,7 +288,6 @@ fn main() -> Result<()> { &hash, &store_path, )?; - let _ = fs::remove_file(store_path.join("temp").join(×tamp)); println!("File archived successfully."); }