Favorites improvements

This commit is contained in:
Arkadiusz Fal
2022-12-11 16:00:20 +01:00
parent 784fc8cfc6
commit f6a261662c
9 changed files with 169 additions and 52 deletions

View File

@@ -6,9 +6,9 @@ struct FavoriteItem: Codable, Equatable, Identifiable, Defaults.Serializable {
case subscriptions
case popular
case trending(String, String?)
case channel(String, String)
case channel(String, String, String)
case playlist(String)
case channelPlaylist(String, String)
case channelPlaylist(String, String, String)
case searchQuery(String, String, String, String)
var label: String {
@@ -21,9 +21,9 @@ struct FavoriteItem: Codable, Equatable, Identifiable, Defaults.Serializable {
let trendingCountry = Country(rawValue: country)!
let trendingCategory = category.isNil ? nil : TrendingCategory(rawValue: category!)
return "\(trendingCountry.flag) \(trendingCountry.id) \(trendingCategory?.name ?? "Trending")"
case let .channel(_, name):
case let .channel(_, _, name):
return name
case let .channelPlaylist(_, name):
case let .channelPlaylist(_, _, name):
return name
case let .searchQuery(text, date, duration, order):
var label = "Search: \"\(text)\""