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

@@ -71,7 +71,7 @@ struct Invidious::User
Invidious::Database::Playlists.update_description(playlist.id, description)
videos = item["videos"]?.try &.as_a?.try &.each_with_index do |video_id, idx|
raise InfoException.new("Playlist cannot have more than 500 videos") if idx > 500
raise InfoException.new("Playlist cannot have more than #{CONFIG.playlist_length_limit} videos") if idx > 500
video_id = video_id.try &.as_s?
next if !video_id