A couple of fixes

This commit is contained in:
Brahim Hadriche committed 2025-01-10 16:33:21 -05:00
1 parent c95bb85c6e
commit 3daa94dee1
3 files changed
+65

No files matched your search

+2
View File
@@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Web app tech refresh
- Web app "Open in Invidious" when built-in backend is selected
- Playlist continuation showing invalid items at the end of playlists
## [0.35.5] - 2025-01-09
@@ -82,6 +82,12 @@ namespace InvidiousContent
childCount = node.getChildCount()
newNodes = []
for each video in item.videos
' TODO:P1 sometimes we're parsing "recommended playlists" that
' show up in the end of the playlist. We should ignore them,
' until the parsing is fixed.
if ValidString(video.type) = "playlist"
continue for
end if
video.type = "video"
videoNode = ToVideoContentNode(invalid, video, instance)
if videoNode <> invalid
@@ -385,6 +385,8 @@ namespace Http
return m.GetPlaylist(context)
else if route.StartsWith("/playlet-invidious-backend/api/v1/channels/")
return m.GetChannel(context)
else if route.StartsWith("/playlet-invidious-backend/channel")
return m.RedirectChannel(context)
end if
return false
@@ -529,6 +531,61 @@ namespace Http
return false
end function
@get("/playlet-invidious-backend/watch")
function RedirectWatch(context as object) as boolean
request = context.request
response = context.response
videoId = request.query.v
if StringUtils.IsNullOrEmpty(videoId)
response.Json({
"error": "Missing 'v' query parameter"
})
response.http_code = 400
return true
end if
response.Redirect(`https://redirect.invidious.io/watch?v=${videoId}`)
return true
end function
@get("/playlet-invidious-backend/playlist")
function RedirectPlaylist(context as object) as boolean
request = context.request
response = context.response
playlistId = request.query.list
if StringUtils.IsNullOrEmpty(playlistId)
response.Json({
"error": "Missing 'list' query parameter"
})
response.http_code = 400
return true
end if
response.Redirect(`https://redirect.invidious.io/playlist?list=${playlistId}`)
return true
end function
function RedirectChannel(context as object) as boolean
request = context.request
response = context.response
route = request.route
channelId = route.Mid("/playlet-invidious-backend/channel/".Len())
if StringUtils.IsNullOrEmpty(channelId)
response.Json({
"error": "Missing 'channelId' path parameter"
})
response.http_code = 400
return true
end if
response.Redirect(`https://redirect.invidious.io/channel/${channelId}`)
return true
end function
end class
end namespace