diff --git a/CHANGELOG.md b/CHANGELOG.md index e312ee04..af8bcf8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - A bug where a the right video will not play if selected too quickly +- A bug where a bookmarked but deleted playlist can't be removed from bookmarks ## [0.24.5] - 2024-07-03 diff --git a/playlet-lib/src/components/Services/Invidious/InvidiousService.bs b/playlet-lib/src/components/Services/Invidious/InvidiousService.bs index ae20b298..8af2baed 100644 --- a/playlet-lib/src/components/Services/Invidious/InvidiousService.bs +++ b/playlet-lib/src/components/Services/Invidious/InvidiousService.bs @@ -354,7 +354,20 @@ namespace Invidious function PlaylistHandler(context as object) as object response = context.response - if response.StatusCode() = 200 + statusCode = response.StatusCode() + if statusCode = 404 + response.OverrideStatusCode(200) + return { + isLastPage: true + items: [{ + "type": "playlist" + "playlistId": context.feedSource.pathParams.plid + "title": "[Playlist not found]" + }] + } + end if + + if statusCode = 200 json = response.Json() return { items: json.videos @@ -391,7 +404,6 @@ namespace Invidious function VideoInfoHandler(context as object) as object response = context.response - feedSource = context.feedSource statusCode = response.StatusCode() if statusCode >= 500 @@ -403,8 +415,9 @@ namespace Invidious response.OverrideStatusCode(200) return { items: [{ - "videoId": feedSource.pathParams.id "type": "video" + "videoId": context.feedSource.pathParams.id + "title": "[Video not available]" }] } end if @@ -423,7 +436,19 @@ namespace Invidious function PlaylistInfoHandler(context as object) as object response = context.response - if response.StatusCode() = 200 + statusCode = response.StatusCode() + if statusCode = 404 + response.OverrideStatusCode(200) + return { + items: [{ + "type": "playlist" + "playlistId": context.feedSource.pathParams.plid + "title": "[Playlist not found]" + }] + } + end if + + if statusCode = 200 json = response.Json() json.type = "playlist" return { diff --git a/playlet-lib/src/components/VideoFeed/VideoRowListRowContentTask.bs b/playlet-lib/src/components/VideoFeed/VideoRowListRowContentTask.bs index c7e17bda..6873cf32 100644 --- a/playlet-lib/src/components/VideoFeed/VideoRowListRowContentTask.bs +++ b/playlet-lib/src/components/VideoFeed/VideoRowListRowContentTask.bs @@ -116,7 +116,9 @@ function VideoRowListRowContentTask(input as object) as object if response.result.items.Count() > 0 pageType = feedSource.state.paginationType - if pageType = PaginationType.Continuation and hasContinuation + if response.result.isLastPage = true + feedSource.state.loadState = FeedLoadState.Loaded + else if pageType = PaginationType.Continuation and hasContinuation feedSource.state.loadState = FeedLoadState.LoadedPage else if pageType = PaginationType.Pages feedSource.state.loadState = FeedLoadState.LoadedPage