1
0
mirror of https://github.com/yattee/yattee.git synced 2024-12-13 13:50:32 +05:30
yattee/Shared/Defaults.swift

34 lines
1010 B
Swift
Raw Normal View History

2021-06-27 04:59:55 +05:30
import Defaults
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"
}
}
}
2021-06-27 04:59:55 +05:30
extension Defaults.Keys {
2021-07-19 04:02:46 +05:30
#if os(tvOS)
static let layout = Key<ListingLayout>("listingLayout", default: .cells)
#endif
2021-06-28 20:32:13 +05:30
static let searchQuery = Key<String>("searchQuery", default: "")
2021-07-08 04:09:18 +05:30
2021-07-22 18:13:13 +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")
2021-07-08 22:48:36 +05:30
static let selectedPlaylistID = Key<String?>("selectedPlaylistID")
static let showingAddToPlaylist = Key<Bool>("showingAddToPlaylist", default: false)
static let videoIDToAddToPlaylist = Key<String?>("videoIDToAddToPlaylist")
2021-06-27 04:59:55 +05:30
}