mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-23 00:29:53 +05:30
Lookback 50 videos
This commit is contained in:
parent
a1d6411f1f
commit
678b10dbcf
@ -47,9 +47,8 @@ module Invidious::Routes::API::V1::Misc
|
|||||||
end
|
end
|
||||||
|
|
||||||
# includes into the playlist a maximum of 20 videos, before the offset
|
# includes into the playlist a maximum of 20 videos, before the offset
|
||||||
lookback = 20
|
|
||||||
if offset > 0
|
if offset > 0
|
||||||
lookback = offset < lookback ? offset : lookback
|
lookback = offset < 50 ? offset : 50
|
||||||
response = playlist.to_json(offset - lookback, locale)
|
response = playlist.to_json(offset - lookback, locale)
|
||||||
json_response = JSON.parse(response)
|
json_response = JSON.parse(response)
|
||||||
else
|
else
|
||||||
@ -58,6 +57,7 @@ module Invidious::Routes::API::V1::Misc
|
|||||||
# First we find the actual offset, and then we lookback
|
# First we find the actual offset, and then we lookback
|
||||||
# it shouldn't happen often though
|
# it shouldn't happen often though
|
||||||
|
|
||||||
|
lookback = 0
|
||||||
response = playlist.to_json(offset, locale, video_id: video_id)
|
response = playlist.to_json(offset, locale, video_id: video_id)
|
||||||
json_response = JSON.parse(response)
|
json_response = JSON.parse(response)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user