summaryrefslogtreecommitdiff
path: root/Sora/Views
diff options
context:
space:
mode:
Diffstat (limited to 'Sora/Views')
-rw-r--r--Sora/Views/Generic/GenericListView.swift16
-rw-r--r--Sora/Views/Post/Details/PostDetailsImageView.swift8
2 files changed, 13 insertions, 11 deletions
diff --git a/Sora/Views/Generic/GenericListView.swift b/Sora/Views/Generic/GenericListView.swift
index 7c568d6..004a278 100644
--- a/Sora/Views/Generic/GenericListView.swift
+++ b/Sora/Views/Generic/GenericListView.swift
@@ -121,12 +121,12 @@ struct GenericListView<T: Identifiable & Hashable & GenericItem>: View {
.pickerStyle(.menu)
Picker("Collection", selection: $selectedCollectionOption) {
- Text(CollectionPickerOption.all.name(settings)).tag(CollectionPickerOption.all)
+ Text(CollectionPickerOption.all.name(settings: settings))
+ .tag(CollectionPickerOption.all)
if items.contains(where: { $0.folder == nil }) {
- Text(CollectionPickerOption.uncategorized.name(settings)).tag(
- CollectionPickerOption.uncategorized
- )
+ Text(CollectionPickerOption.uncategorized.name(settings: settings))
+ .tag(CollectionPickerOption.uncategorized)
}
ForEach(settings.folders.filter { $0.topLevelName == nil }, id: \.id) { folder in
@@ -225,12 +225,12 @@ struct GenericListView<T: Identifiable & Hashable & GenericItem>: View {
Menu {
Picker("Collection", selection: $selectedCollectionOption) {
- Text(CollectionPickerOption.all.name(settings)).tag(CollectionPickerOption.all)
+ Text(CollectionPickerOption.all.name(settings: settings))
+ .tag(CollectionPickerOption.all)
if items.contains(where: { $0.folder == nil }) {
- Text(CollectionPickerOption.uncategorized.name(settings)).tag(
- CollectionPickerOption.uncategorized
- )
+ Text(CollectionPickerOption.uncategorized.name(settings: settings))
+ .tag(CollectionPickerOption.uncategorized)
}
ForEach(settings.folders.filter { $0.topLevelName == nil }, id: \.id) { folder in
diff --git a/Sora/Views/Post/Details/PostDetailsImageView.swift b/Sora/Views/Post/Details/PostDetailsImageView.swift
index a62171e..9ec2079 100644
--- a/Sora/Views/Post/Details/PostDetailsImageView.swift
+++ b/Sora/Views/Post/Details/PostDetailsImageView.swift
@@ -187,6 +187,8 @@ struct PostDetailsImageView<Placeholder: View>: View {
guard let url = self.url else { return }
let provider = manager.provider
+ let detailViewQuality = settings.detailViewQuality
+ let saveTagsToFile = settings.saveTagsToFile
URLSession.shared.dataTask(with: url) { data, _, _ in
guard let data, let post else { return }
@@ -203,11 +205,11 @@ struct PostDetailsImageView<Placeholder: View>: View {
to:
picturesURL
.appendingPathComponent(
- "\(post.id)_\(settings.detailViewQuality.rawValue.lowercased()).\(url.pathExtension)"
+ "\(post.id)_\(detailViewQuality.rawValue.lowercased()).\(url.pathExtension)"
)
)
- if settings.saveTagsToFile {
+ if saveTagsToFile {
try post.tags.joined(separator: "\n").write(
to: picturesURL.appendingPathComponent(
"\(post.id).txt"
@@ -221,7 +223,7 @@ struct PostDetailsImageView<Placeholder: View>: View {
Task {
await sendLocalNotification(
title: "Sora",
- body: "Image \(settings.saveTagsToFile ? "and tags" : "") saved (\(post.id))"
+ body: "Image \(saveTagsToFile ? "and tags" : "") saved (\(post.id))"
)
}
#endif