Skip to content

Commit

Permalink
Fix playlist export for playlists with more than 100 videos
Browse files Browse the repository at this point in the history
  • Loading branch information
omarroth committed Jul 28, 2020
1 parent b508787 commit 62f015f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/invidious.cr
Original file line number Diff line number Diff line change
Expand Up @@ -2449,8 +2449,8 @@ get "/subscription_manager" do |env|
json.field "privacy", playlist.privacy.to_s
json.field "videos" do
json.array do
get_playlist_videos(PG_DB, playlist, offset: 0, locale: locale, continuation: nil).each_with_index do |video, index|
json.string video.id
PG_DB.query_all("SELECT id FROM playlist_videos WHERE plid = $1 ORDER BY array_position($2, index) LIMIT 500", playlist.id, playlist.index, as: String).each do |video_id|
json.string video_id
end
end
end
Expand Down Expand Up @@ -2563,7 +2563,9 @@ post "/data_control" do |env|
playlist = create_playlist(PG_DB, title, privacy, user)
PG_DB.exec("UPDATE playlists SET description = $1 WHERE id = $2", description, playlist.id)

videos = item["videos"]?.try &.as_a?.try &.each do |video_id|
videos = item["videos"]?.try &.as_a?.try &.each_with_index do |video_id, idx|
raise "Playlist cannot have more than 500 videos" if idx > 500

video_id = video_id.try &.as_s?
next if !video_id

Expand Down

1 comment on commit 62f015f

@pshane4
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Omar.

F a n t a s t i c work here--I've been using invidio.us for quite a while now.
Bad news though--it's no longer working [on any browser].

Any recommendations?
I'm using Mint, have never had any problems before,
and would like to continue with it.
I attached a screen shot to let you know what it looks like on my end.

-Much appreciation and kindest regards

invidio

Please sign in to comment.