about summary refs log tree commit diff stats
path: root/sys/nixpkgs/pkgs/ytc
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2024-01-06 17:11:10 +0100
committerSoispha <soispha@vhack.eu>2024-01-06 17:11:53 +0100
commit30808e8cec2baafbf4b5b42c06c7ca61519c6c24 (patch)
tree9ae8718cf6f702b83e70c1a89fbbce8f7303d3aa /sys/nixpkgs/pkgs/ytc
parentfix(sys/nixpkgs/pkgs/ytc/scr/main): Stop mpv from spamming up stdout (diff)
downloadnixos-config-30808e8cec2baafbf4b5b42c06c7ca61519c6c24.tar.gz
nixos-config-30808e8cec2baafbf4b5b42c06c7ca61519c6c24.zip
fix(sys/nixpkgs/pkgs/ytc/scr/main): Also delete the file if no id is set
Diffstat (limited to 'sys/nixpkgs/pkgs/ytc')
-rw-r--r--sys/nixpkgs/pkgs/ytc/src/main.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/nixpkgs/pkgs/ytc/src/main.rs b/sys/nixpkgs/pkgs/ytc/src/main.rs
index eccd3c2c..552e85d3 100644
--- a/sys/nixpkgs/pkgs/ytc/src/main.rs
+++ b/sys/nixpkgs/pkgs/ytc/src/main.rs
@@ -151,10 +151,10 @@ fn main() -> Result<()> {
 
         let status = mpv.status().context("Failed to run mpv")?;
         if let Some(code) = status.code() {
-            if let Some(id) = id {
-                if code == 0 {
+            if code == 0 {
+                fs::remove_file(&path)?;
+                if let Some(id) = id {
                     println!("\x1b[32;1mMarking {} as watched!\x1b[0m", id);
-                    fs::remove_file(&path)?;
                     let mut ytcc = StdCmd::new("ytcc");
                     ytcc.stdout(stdout());
                     ytcc.stderr(stderr());