summaryrefslogtreecommitdiffstats
path: root/src/paths.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2018-11-08 01:52:31 -0500
committerJesse Luehrs <doy@tozt.net>2018-11-08 01:52:31 -0500
commitbd7c31233de96d96e16f9c15e22d014514f7a173 (patch)
tree10d1cc4bc6a88475e38e5b137928b3f74e6fdf35 /src/paths.rs
parentde41e542cb74d192ffd48600569b7d9fdc9e6cdd (diff)
downloadlastfm-query-bd7c31233de96d96e16f9c15e22d014514f7a173.tar.gz
lastfm-query-bd7c31233de96d96e16f9c15e22d014514f7a173.zip
stop passing the api key on the command line
Diffstat (limited to 'src/paths.rs')
-rw-r--r--src/paths.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/paths.rs b/src/paths.rs
index a3f1eb8..badb783 100644
--- a/src/paths.rs
+++ b/src/paths.rs
@@ -4,3 +4,10 @@ pub fn db_path() -> failure::Fallible<std::path::PathBuf> {
.data_dir()
.join("tracks.sqlite"))
}
+
+pub fn api_key_path() -> failure::Fallible<std::path::PathBuf> {
+ Ok(directories::ProjectDirs::from("", "", "lastfm-query")
+ .ok_or_else(|| failure::err_msg("couldn't determine config directory"))?
+ .config_dir()
+ .join("lastfm-api-key"))
+}