summaryrefslogtreecommitdiff
path: root/Sora
diff options
context:
space:
mode:
Diffstat (limited to 'Sora')
-rw-r--r--Sora/Data/Booru/BooruManager.swift24
1 files changed, 12 insertions, 12 deletions
diff --git a/Sora/Data/Booru/BooruManager.swift b/Sora/Data/Booru/BooruManager.swift
index b3fb031..ae49b6b 100644
--- a/Sora/Data/Booru/BooruManager.swift
+++ b/Sora/Data/Booru/BooruManager.swift
@@ -209,7 +209,18 @@ class BooruManager: ObservableObject {
}
}
- // MARK: - Private Helpers
+ func updateTagsCacheSize() {
+ cacheSize = tagsCacheFileURL.flatMap { url in
+ ByteCountFormatter.string(
+ fromByteCount: Int64(
+ (try? FileManager.default.attributesOfItem(atPath: url.path)[.size] as? Int) ?? 0
+ ),
+ countStyle: .file
+ )
+ }
+ }
+
+ // MARK: - Private Methods
private func urlForPosts(page: Int, limit: Int, tags: [String]) -> URL? {
let tagString = tags.joined(separator: "+")
@@ -305,17 +316,6 @@ class BooruManager: ObservableObject {
currentTask = nil
}
- func updateTagsCacheSize() {
- cacheSize = tagsCacheFileURL.flatMap { url in
- ByteCountFormatter.string(
- fromByteCount: Int64(
- (try? FileManager.default.attributesOfItem(atPath: url.path)[.size] as? Int) ?? 0
- ),
- countStyle: .file
- )
- }
- }
-
// MARK: - Deinitialisation
deinit { currentTask?.cancel() }
}