aboutsummaryrefslogtreecommitdiffstats
path: root/sys/nixpkgs/pkgs/yt/src/constants.rs
diff options
context:
space:
mode:
Diffstat (limited to 'sys/nixpkgs/pkgs/yt/src/constants.rs')
-rw-r--r--sys/nixpkgs/pkgs/yt/src/constants.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/sys/nixpkgs/pkgs/yt/src/constants.rs b/sys/nixpkgs/pkgs/yt/src/constants.rs
index 6965ce63..96995f08 100644
--- a/sys/nixpkgs/pkgs/yt/src/constants.rs
+++ b/sys/nixpkgs/pkgs/yt/src/constants.rs
@@ -25,7 +25,6 @@ pub const CONCURRENT: u32 = 5;
pub const DOWNLOAD_DIR: &str = "/tmp/ytcc";
const STATUS_PATH: &str = "ytcc/running";
-
pub fn status_path() -> anyhow::Result<PathBuf> {
let out: PathBuf = format!(
"{}/{}",
@@ -36,3 +35,15 @@ pub fn status_path() -> anyhow::Result<PathBuf> {
fs::create_dir_all(&out.parent().expect("Parent should exist"))?;
Ok(out)
}
+
+const LAST_SELECT: &str = "ytcc/selected";
+pub fn last_select() -> anyhow::Result<PathBuf> {
+ let out: PathBuf = format!(
+ "{}/{}",
+ env::var("XDG_RUNTIME_DIR").expect("This should always exist"),
+ LAST_SELECT
+ )
+ .into();
+ fs::create_dir_all(&out.parent().expect("Parent should exist"))?;
+ Ok(out)
+}