mirror of
https://github.com/yattee/yattee.git
synced 2026-10-26 22:52:52 +00:00
Remove dead code found by Periphery on all platforms
Delete declarations that Periphery reports unused on every platform that compiles them (iOS, macOS, tvOS), including nine views used only by their own previews. Platform-gated code still used on another platform, device- only MPV render paths, migration models, CloudKit record names, App Intents metadata and unused parameters are kept.
This commit is contained in:
@@ -63,24 +63,6 @@ actor PlayerControlsBackupService {
|
||||
return presets
|
||||
}
|
||||
|
||||
/// Checks if a valid backup exists.
|
||||
/// - Returns: True if a valid backup file exists.
|
||||
func hasValidBackup() async -> Bool {
|
||||
guard fileManager.fileExists(atPath: backupFileURL.path) else {
|
||||
return false
|
||||
}
|
||||
|
||||
// Try to decode to verify it's valid
|
||||
do {
|
||||
let data = try Data(contentsOf: backupFileURL)
|
||||
_ = try decoder.decode([LayoutPreset].self, from: data)
|
||||
return true
|
||||
} catch {
|
||||
LoggingService.shared.error("Backup file exists but is invalid: \(error.localizedDescription)")
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
/// Attempts to create a recovered preset from corrupted data.
|
||||
/// - Parameter data: The corrupted data.
|
||||
/// - Returns: A recovered preset if partial recovery is possible.
|
||||
@@ -117,16 +99,6 @@ actor PlayerControlsBackupService {
|
||||
return nil
|
||||
}
|
||||
|
||||
/// Deletes the backup file.
|
||||
func deleteBackup() async throws {
|
||||
guard fileManager.fileExists(atPath: backupFileURL.path) else {
|
||||
return
|
||||
}
|
||||
|
||||
try fileManager.removeItem(at: backupFileURL)
|
||||
LoggingService.shared.info("Deleted player controls backup")
|
||||
}
|
||||
|
||||
// MARK: - Helpers
|
||||
|
||||
private func formattedDate() -> String {
|
||||
|
||||
Reference in New Issue
Block a user