From 30808e8cec2baafbf4b5b42c06c7ca61519c6c24 Mon Sep 17 00:00:00 2001 From: Soispha Date: Sat, 6 Jan 2024 17:11:10 +0100 Subject: fix(sys/nixpkgs/pkgs/ytc/scr/main): Also delete the file if no id is set --- sys/nixpkgs/pkgs/ytc/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/nixpkgs/pkgs/ytc/src') 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()); -- cgit 1.4.1