Fix Invidious trending categories

This commit is contained in:
Arkadiusz Fal 2023-05-27 00:24:53 +02:00
parent b1637c5ef1
commit 80a644eb7a
2 changed files with 5 additions and 1 deletions

View File

@ -236,7 +236,7 @@ final class InvidiousAPI: Service, ObservableObject, VideosAPI {
func trending(country: Country, category: TrendingCategory?) -> Resource { func trending(country: Country, category: TrendingCategory?) -> Resource {
resource(baseURL: account.url, path: "\(Self.basePath)/trending") resource(baseURL: account.url, path: "\(Self.basePath)/trending")
.withParam("type", category?.name) .withParam("type", category?.type)
.withParam("region", country.rawValue) .withParam("region", country.rawValue)
} }

View File

@ -41,4 +41,8 @@ enum TrendingCategory: String, CaseIterable, Identifiable, Defaults.Serializable
var controlLabel: String { var controlLabel: String {
id == "default" ? "All".localized() : title id == "default" ? "All".localized() : title
} }
var type: String {
rawValue.capitalized
}
} }