mirror of
https://github.com/whoeevee/EeveeSpotifyReborn.git
synced 2026-01-09 00:23:20 +01:00
34 lines
861 B
Swift
Executable File
34 lines
861 B
Swift
Executable File
import Foundation
|
|
|
|
class OfflineHelper {
|
|
static private let applicationSupportPath = FileManager.default.urls(
|
|
for: .applicationSupportDirectory, in: .userDomainMask
|
|
)
|
|
.first!
|
|
|
|
//
|
|
|
|
static private let persistentCachePath = applicationSupportPath
|
|
.appendingPathComponent("PersistentCache")
|
|
|
|
static private let remoteConfigPath = applicationSupportPath
|
|
.appendingPathComponent("remote-config")
|
|
|
|
//
|
|
|
|
static private func resetPersistentCache() throws {
|
|
try FileManager.default.removeItem(at: self.persistentCachePath)
|
|
}
|
|
|
|
static private func resetRemoteConfig() throws {
|
|
try FileManager.default.removeItem(at: self.remoteConfigPath)
|
|
}
|
|
|
|
//
|
|
|
|
static func resetData() {
|
|
try? resetPersistentCache()
|
|
try? resetRemoteConfig()
|
|
}
|
|
}
|