mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 13:33:42 +00:00
add migration for old profiles to new format
This commit is contained in:
parent
54915dcea1
commit
ef7a486fd4
@ -204,6 +204,7 @@ struct YatteeApp: App {
|
||||
URLBookmarkModel.shared.refreshAll()
|
||||
|
||||
migrateHomeHistoryItems()
|
||||
migrateQualityProfiles()
|
||||
}
|
||||
|
||||
func migrateHomeHistoryItems() {
|
||||
@ -221,6 +222,16 @@ struct YatteeApp: App {
|
||||
Defaults[.homeHistoryItems] = -1
|
||||
}
|
||||
|
||||
@Default(.qualityProfiles) private var qualityProfilesData
|
||||
|
||||
func migrateQualityProfiles() {
|
||||
for profile in qualityProfilesData where profile.order.isEmpty {
|
||||
var updatedProfile = profile
|
||||
updatedProfile.order = Array(QualityProfile.Format.allCases.indices)
|
||||
QualityProfilesModel.shared.update(profile, updatedProfile)
|
||||
}
|
||||
}
|
||||
|
||||
var navigationStyle: NavigationStyle {
|
||||
#if os(iOS)
|
||||
return horizontalSizeClass == .compact ? .tab : .sidebar
|
||||
|
Loading…
Reference in New Issue
Block a user