@ -163,9 +163,9 @@ module Invidious::Routes::Playlists
end
end
begin
begin
video s = get_playlist_videos ( playlist , offset : ( page - 1 ) * 100 )
item s = get_playlist_videos ( playlist , offset : ( page - 1 ) * 100 )
rescue ex
rescue ex
video s = [ ] of PlaylistVideo
item s = [ ] of PlaylistVideo
end
end
csrf_token = generate_response ( sid , { " :edit_playlist " } , HMAC_KEY )
csrf_token = generate_response ( sid , { " :edit_playlist " } , HMAC_KEY )
@ -174,7 +174,7 @@ module Invidious::Routes::Playlists
page_nav_html = Frontend :: Pagination . nav_numeric ( locale ,
page_nav_html = Frontend :: Pagination . nav_numeric ( locale ,
base_url : " /playlist?list= #{ playlist . id } " ,
base_url : " /playlist?list= #{ playlist . id } " ,
current_page : page ,
current_page : page ,
show_next : ( video s. size == 100 )
show_next : ( item s. size == 100 )
)
)
templated " edit_playlist "
templated " edit_playlist "
@ -254,9 +254,9 @@ module Invidious::Routes::Playlists
begin
begin
query = Invidious :: Search :: Query . new ( env . params . query , :playlist , region )
query = Invidious :: Search :: Query . new ( env . params . query , :playlist , region )
video s = query . process . select ( SearchVideo ) . map ( & . as ( SearchVideo ) )
item s = query . process . select ( SearchVideo ) . map ( & . as ( SearchVideo ) )
rescue ex
rescue ex
video s = [ ] of SearchVideo
item s = [ ] of SearchVideo
end
end
# Pagination
# Pagination
@ -264,7 +264,7 @@ module Invidious::Routes::Playlists
page_nav_html = Frontend :: Pagination . nav_numeric ( locale ,
page_nav_html = Frontend :: Pagination . nav_numeric ( locale ,
base_url : " /add_playlist_items?list= #{ playlist . id } &q= #{ query_encoded } " ,
base_url : " /add_playlist_items?list= #{ playlist . id } &q= #{ query_encoded } " ,
current_page : page ,
current_page : page ,
show_next : ( video s. size >= 20 )
show_next : ( item s. size >= 20 )
)
)
env . set " add_playlist_items " , plid
env . set " add_playlist_items " , plid
@ -433,7 +433,7 @@ module Invidious::Routes::Playlists
end
end
begin
begin
video s = get_playlist_videos ( playlist , offset : ( page - 1 ) * 200 )
item s = get_playlist_videos ( playlist , offset : ( page - 1 ) * 200 )
rescue ex
rescue ex
return error_template ( 500 , " Error encountered while retrieving playlist videos.<br> #{ ex . message } " )
return error_template ( 500 , " Error encountered while retrieving playlist videos.<br> #{ ex . message } " )
end
end