This commit is contained in:
Arkadiusz Fal
2022-06-30 01:31:51 +02:00
parent 25ef0a4383
commit f8fe2961ca
6 changed files with 68 additions and 3 deletions

View File

@@ -44,6 +44,10 @@ final class PipedAPI: Service, ObservableObject, VideosAPI {
self.extractChannel(from: content.json)
}
configureTransformer(pathPattern("user/*")) { (content: Entity<JSON>) -> Channel? in
self.extractChannel(from: content.json)
}
configureTransformer(pathPattern("playlists/*")) { (content: Entity<JSON>) -> ChannelPlaylist? in
self.extractChannelPlaylist(from: content.json)
}
@@ -133,6 +137,10 @@ final class PipedAPI: Service, ObservableObject, VideosAPI {
resource(baseURL: account.url, path: "c/\(name)")
}
func channelByUsername(_ username: String) -> Resource? {
resource(baseURL: account.url, path: "user/\(username)")
}
func channelVideos(_ id: String) -> Resource {
channel(id)
}