Allow to set maximum custom playlist length via a config variable.

This commit is contained in:
Jakub Filo
2022-08-27 22:36:07 +02:00
parent a7d9df5516
commit 4818b89ab1
7 changed files with 19 additions and 8 deletions

View File

@@ -226,8 +226,8 @@ module Invidious::Routes::API::V1::Authenticated
return error_json(403, "Invalid user")
end
if playlist.index.size >= 500
return error_json(400, "Playlist cannot have more than 500 videos")
if playlist.index.size >= CONFIG.playlist_length_limit
return error_json(400, "Playlist cannot have more than #{CONFIG.playlist_length_limit} videos")
end
video_id = env.params.json["videoId"].try &.as(String)