paths: remove hardcoded basepath

Before we were hardcoding the basepath with dirs, which isn't that
useful for testing, previews, or for android. Let's fix that.

This also moves the db and cache directories into our root DataPaths.
This is a breaking change, we don't have a migration step. sorry.

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin committed 2024-11-13 09:55:56 -08:00
1 parent 6c9693dbf0
commit fab1257f6e
11 files changed
+167 -144

No files matched your search

+5 -1
View File
@@ -1,5 +1,6 @@
use crate::app_style::NotedeckTextStyle;
use crate::imgcache::ImageCache;
use crate::storage::{DataPath, DataPathType};
use crate::ui::ProfilePic;
use crate::user_account::UserAccount;
use crate::{colors, images, DisplayName};
@@ -126,7 +127,10 @@ mod previews {
impl<'a> ProfilePreviewPreview<'a> {
pub fn new() -> Self {
let profile = test_profile_record();
let cache = ImageCache::new(ImageCache::rel_datadir().into());
let path = DataPath::new("previews")
.path(DataPathType::Cache)
.join(ImageCache::rel_dir());
let cache = ImageCache::new(path);
ProfilePreviewPreview { profile, cache }
}
}