Support for channel "Courses" in Playlet backend

This commit is contained in:
Brahim Hadriche committed 2025-01-16 17:44:56 -05:00
1 parent 28c10022bd
commit 2f8679bc1c
5 files changed
+24 -1

No files matched your search

+4
View File
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- Support for channel "Courses" in Playlet backend
### Fixed
- Web app tech refresh
@@ -215,6 +215,9 @@ function InitializeTabs()
"playlists": function(authorId as string, author as string, params as string) as object
return CreateChannelFeed("Playlists", "channel_playlists", authorId, author, params)
end function
"courses": function(authorId as string, author as string, params as string) as object
return CreateChannelFeed("Courses", "channel_courses", authorId, author, params)
end function
}
end function
@@ -442,6 +442,14 @@ namespace Invidious
if response.StatusCode() = 200
json = response.Json()
' Courses are not yet implemented in Invidious.
' In this case, Invidious returns 200, but the response is empty.
if json = invalid
json = {
playlists: []
}
end if
return {
items: json.playlists
continuation: json.continuation
@@ -496,7 +496,7 @@ namespace Http
return true
end if
if _tab = "playlists" or _tab = "podcasts" or _tab = "releases"
if _tab = "playlists" or _tab = "podcasts" or _tab = "releases" or _tab = "courses"
result = {
"playlists": channel.items
}
@@ -166,6 +166,14 @@ channel_releases:
paginationType: Continuation
tryCount: 3
# This is implemented only by Playlet backend.
channel_courses:
title: Channel courses
url: /api/v1/channels/{ucid}/courses
responseHandler: ChannelPlaylistsHandler
paginationType: Continuation
tryCount: 3
# This is implemented only by Playlet backend.
# Created because auto-generated channels don't have tabs except for "featured"
channel_featured: