diff options
Diffstat (limited to 'Sora/Data')
| -rw-r--r-- | Sora/Data/Booru/BooruProvider.swift | 9 | ||||
| -rw-r--r-- | Sora/Data/Settings/Settings.swift | 12 |
2 files changed, 20 insertions, 1 deletions
diff --git a/Sora/Data/Booru/BooruProvider.swift b/Sora/Data/Booru/BooruProvider.swift index e742fef..3b3b126 100644 --- a/Sora/Data/Booru/BooruProvider.swift +++ b/Sora/Data/Booru/BooruProvider.swift @@ -1,4 +1,13 @@ enum BooruProvider: String, CaseIterable, Decodable, Encodable { case yandere case safebooru + + func formatted() -> String { + switch self { + case .yandere: + return "yande.re" + case .safebooru: + return "Safebooru" + } + } } diff --git a/Sora/Data/Settings/Settings.swift b/Sora/Data/Settings/Settings.swift index 3ffa114..c70f1ba 100644 --- a/Sora/Data/Settings/Settings.swift +++ b/Sora/Data/Settings/Settings.swift @@ -4,7 +4,7 @@ class Settings: ObservableObject { #if DEBUG @AppStorage("detailViewType") var detailViewType: BooruPostFileType = .sample #else - @AppStorage("detailViewType") var detailViewType: PostFileType = .original + @AppStorage("detailViewType") var detailViewType: BooruPostFileType = .original #endif @AppStorage("thumbnailType") var thumbnailType: BooruPostFileType = .preview @AppStorage("searchSuggestions") var searchSuggestions: Bool = false @@ -68,4 +68,14 @@ class Settings: ObservableObject { bookmarks = currentBookmarks } + + func removeBookmark(withID: UUID) { + var currentBookmarks = bookmarks + + currentBookmarks.removeAll { bookmark in + bookmark.id == withID + } + + bookmarks = currentBookmarks + } } |