mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
Message when the video doesn't exist in playlist
This commit is contained in:
parent
4ab54f284c
commit
9fd30ab1cc
1 changed files with 10 additions and 0 deletions
|
@ -7,6 +7,11 @@ module Invidious::Routes::Embed
|
|||
playlist = get_playlist(plid)
|
||||
offset = env.params.query["index"]?.try &.to_i? || 0
|
||||
videos = get_playlist_videos(playlist, offset: offset)
|
||||
if videos.empty?
|
||||
url = "/playlist?list=#{plid}"
|
||||
raise NotFoundException.new("The video requested doesn't exist in the playlist. " \
|
||||
"Click <a href='#{url}'>here</a> for the playlist home page.")
|
||||
end
|
||||
rescue ex : NotFoundException
|
||||
return error_template(404, ex)
|
||||
rescue ex
|
||||
|
@ -62,6 +67,11 @@ module Invidious::Routes::Embed
|
|||
playlist = get_playlist(plid)
|
||||
offset = env.params.query["index"]?.try &.to_i? || 0
|
||||
videos = get_playlist_videos(playlist, offset: offset)
|
||||
if videos.empty?
|
||||
url = "/playlist?list=#{plid}"
|
||||
raise NotFoundException.new("The video requested doesn't exist in the playlist. " \
|
||||
"Click <a href='#{url}'>here</a> for the playlist home page.")
|
||||
end
|
||||
rescue ex : NotFoundException
|
||||
return error_template(404, ex)
|
||||
rescue ex
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue