2021-06-27 04:59:55 +05:30
|
|
|
import Defaults
|
|
|
|
|
2021-09-19 16:36:54 +05:30
|
|
|
extension Defaults.Keys {
|
|
|
|
#if os(tvOS)
|
|
|
|
static let layout = Key<ListingLayout>("listingLayout", default: .cells)
|
|
|
|
#endif
|
|
|
|
|
2021-09-25 13:48:22 +05:30
|
|
|
static let instances = Key<[Instance]>("instances", default: [])
|
|
|
|
|
2021-09-19 16:36:54 +05:30
|
|
|
static let searchSortOrder = Key<SearchQuery.SortOrder>("searchSortOrder", default: .relevance)
|
|
|
|
static let searchDate = Key<SearchQuery.Date?>("searchDate")
|
|
|
|
static let searchDuration = Key<SearchQuery.Duration?>("searchDuration")
|
|
|
|
|
|
|
|
static let selectedPlaylistID = Key<String?>("selectedPlaylistID")
|
|
|
|
static let showingAddToPlaylist = Key<Bool>("showingAddToPlaylist", default: false)
|
|
|
|
static let videoIDToAddToPlaylist = Key<String?>("videoIDToAddToPlaylist")
|
|
|
|
|
|
|
|
static let recentlyOpened = Key<[RecentItem]>("recentlyOpened", default: [])
|
2021-09-25 13:48:22 +05:30
|
|
|
static let quality = Key<Stream.ResolutionSetting>("quality", default: .hd720pFirstThenBest)
|
2021-09-19 16:36:54 +05:30
|
|
|
}
|
|
|
|
|
2021-07-22 18:13:13 +05:30
|
|
|
enum ListingLayout: String, CaseIterable, Identifiable, Defaults.Serializable {
|
|
|
|
case list, cells
|
|
|
|
|
|
|
|
var id: String {
|
|
|
|
rawValue
|
|
|
|
}
|
|
|
|
|
|
|
|
var name: String {
|
|
|
|
switch self {
|
|
|
|
case .list:
|
|
|
|
return "List"
|
|
|
|
case .cells:
|
|
|
|
return "Cells"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|