From 6234af405c8f06c3ac956e89b1eb3480d33f4f22 Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Thu, 9 Nov 2023 18:09:00 +0100 Subject: [PATCH] datadir --- .gitignore | 4 ---- src/nextcast/data_dir.py | 18 +++++++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index eaa5a56..6a17f12 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,4 @@ /.venv/ /.idea/ /.git/ - -/data -/src/nextcast/data/ - /*.zip diff --git a/src/nextcast/data_dir.py b/src/nextcast/data_dir.py index cbe16cc..59c9b39 100644 --- a/src/nextcast/data_dir.py +++ b/src/nextcast/data_dir.py @@ -4,28 +4,32 @@ from pathlib import Path def get_audio_dir() -> Path: - return Path('data') / 'audio' + return datadir() / 'audio' def get_feed_dir() -> Path: - return Path('data') / 'feed' + return datadir() / 'feed' def get_podcast_dir() -> Path: - return Path('data') / 'podcast' + return datadir() / 'podcast' def get_mpv_watch_later_dir() -> Path: - return Path('data') / 'watch_later' + return datadir() / 'watch_later' def get_timestamp_file(): - return Path('data') / 'timestamps.json' + return datadir() / 'timestamps.json' def get_subscription_file(): - return Path('data') / 'subscriptions.json' + return datadir() / 'subscriptions.json' def get_credential_file(): - return Path('data') / 'nc_logins.json' + return datadir() / 'nc_logins.json' + + +def datadir() -> Path: + return Path.home() / 'nextcast'