Add podcasts and releases tabs for channels in Invidious

This commit is contained in:
Arkadiusz Fal 2023-09-25 21:37:30 +02:00
parent a1e8a50aaf
commit 9d49f3dd68
2 changed files with 7 additions and 1 deletions

View File

@ -123,7 +123,7 @@ final class InvidiousAPI: Service, ObservableObject, VideosAPI {
content.json.dictionaryValue["videos"]?.arrayValue.map(self.extractVideo) ?? [] 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<JSON>) -> ChannelPage in configureTransformer(pathPattern("channels/*/\(type)"), requestMethods: [.get]) { (content: Entity<JSON>) -> ChannelPage in
self.extractChannelPage(from: content.json) self.extractChannelPage(from: content.json)
} }

View File

@ -10,6 +10,8 @@ struct Channel: Identifiable, Hashable {
case livestreams case livestreams
case shorts case shorts
case channels case channels
case releases
case podcasts
static func from(_ name: String) -> Self? { static func from(_ name: String) -> Self? {
let rawValueMatch = allCases.first { $0.rawValue == name } let rawValueMatch = allCases.first { $0.rawValue == name }
@ -45,6 +47,10 @@ struct Channel: Identifiable, Hashable {
return "1.square" return "1.square"
case .channels: case .channels:
return "person.3" return "person.3"
case .releases:
return "square.stack"
case .podcasts:
return "radio"
} }
} }