From 9d49f3dd68f31d8d4b86519a32a7b33c761afe15 Mon Sep 17 00:00:00 2001 From: Arkadiusz Fal Date: Mon, 25 Sep 2023 21:37:30 +0200 Subject: [PATCH] Add podcasts and releases tabs for channels in Invidious --- Model/Applications/InvidiousAPI.swift | 2 +- Model/Channel.swift | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Model/Applications/InvidiousAPI.swift b/Model/Applications/InvidiousAPI.swift index 0693386d..2a3c191b 100644 --- a/Model/Applications/InvidiousAPI.swift +++ b/Model/Applications/InvidiousAPI.swift @@ -123,7 +123,7 @@ final class InvidiousAPI: Service, ObservableObject, VideosAPI { content.json.dictionaryValue["videos"]?.arrayValue.map(self.extractVideo) ?? [] } - ["latest", "playlists", "streams", "shorts", "channels", "videos"].forEach { type in + ["latest", "playlists", "streams", "shorts", "channels", "videos", "releases", "podcasts"].forEach { type in configureTransformer(pathPattern("channels/*/\(type)"), requestMethods: [.get]) { (content: Entity) -> ChannelPage in self.extractChannelPage(from: content.json) } diff --git a/Model/Channel.swift b/Model/Channel.swift index 3944a3d8..3f2b4f61 100644 --- a/Model/Channel.swift +++ b/Model/Channel.swift @@ -10,6 +10,8 @@ struct Channel: Identifiable, Hashable { case livestreams case shorts case channels + case releases + case podcasts static func from(_ name: String) -> Self? { let rawValueMatch = allCases.first { $0.rawValue == name } @@ -45,6 +47,10 @@ struct Channel: Identifiable, Hashable { return "1.square" case .channels: return "person.3" + case .releases: + return "square.stack" + case .podcasts: + return "radio" } }