From 80a644eb7afba5de16a8872c347ce8bb5f1425f0 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Sat, 27 May 2023 00:24:53 +0200 Subject: [PATCH] Fix Invidious trending categories --- Model/Applications/InvidiousAPI.swift | 2 +- Model/TrendingCategory.swift | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Model/Applications/InvidiousAPI.swift b/Model/Applications/InvidiousAPI.swift index fd444542..b5c28b9d 100644 --- a/Model/Applications/InvidiousAPI.swift +++ b/Model/Applications/InvidiousAPI.swift @@ -236,7 +236,7 @@ final class InvidiousAPI: Service, ObservableObject, VideosAPI { func trending(country: Country, category: TrendingCategory?) -> Resource { resource(baseURL: account.url, path: "\(Self.basePath)/trending") - .withParam("type", category?.name) + .withParam("type", category?.type) .withParam("region", country.rawValue) } diff --git a/Model/TrendingCategory.swift b/Model/TrendingCategory.swift index 4cf0bc15..6f18506e 100644 --- a/Model/TrendingCategory.swift +++ b/Model/TrendingCategory.swift @@ -41,4 +41,8 @@ enum TrendingCategory: String, CaseIterable, Identifiable, Defaults.Serializable var controlLabel: String { id == "default" ? "All".localized() : title } + + var type: String { + rawValue.capitalized + } }