mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-02 08:53:13 +05:30
Fix Performance/ChainedCallWithNoBang issues
This commit is contained in:
parent
e91421253e
commit
e969c1490a
@ -105,11 +105,11 @@ end
|
|||||||
|
|
||||||
def scope_includes_scope(scope, subset)
|
def scope_includes_scope(scope, subset)
|
||||||
methods, endpoint = scope.split(":")
|
methods, endpoint = scope.split(":")
|
||||||
methods = methods.split(";").map(&.upcase).reject(&.empty?).sort
|
methods = methods.split(";").map(&.upcase).reject(&.empty?).sort!
|
||||||
endpoint = endpoint.downcase
|
endpoint = endpoint.downcase
|
||||||
|
|
||||||
subset_methods, subset_endpoint = subset.split(":")
|
subset_methods, subset_endpoint = subset.split(":")
|
||||||
subset_methods = subset_methods.split(";").map(&.upcase).sort
|
subset_methods = subset_methods.split(";").map(&.upcase).sort!
|
||||||
subset_endpoint = subset_endpoint.downcase
|
subset_endpoint = subset_endpoint.downcase
|
||||||
|
|
||||||
if methods.empty?
|
if methods.empty?
|
||||||
|
@ -16,7 +16,7 @@ class Invidious::Jobs::PullPopularVideosJob < Invidious::Jobs::BaseJob
|
|||||||
loop do
|
loop do
|
||||||
videos = db.query_all(QUERY, as: ChannelVideo)
|
videos = db.query_all(QUERY, as: ChannelVideo)
|
||||||
.sort_by(&.published)
|
.sort_by(&.published)
|
||||||
.reverse
|
.reverse!
|
||||||
|
|
||||||
POPULAR_VIDEOS.set(videos)
|
POPULAR_VIDEOS.set(videos)
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ module Invidious::Routes::API::Manifest
|
|||||||
end
|
end
|
||||||
|
|
||||||
audio_streams = video.audio_streams
|
audio_streams = video.audio_streams
|
||||||
video_streams = video.video_streams.sort_by { |stream| {stream["width"].as_i, stream["fps"].as_i} }.reverse
|
video_streams = video.video_streams.sort_by { |stream| {stream["width"].as_i, stream["fps"].as_i} }.reverse!
|
||||||
|
|
||||||
manifest = XML.build(indent: " ", encoding: "UTF-8") do |xml|
|
manifest = XML.build(indent: " ", encoding: "UTF-8") do |xml|
|
||||||
xml.element("MPD", "xmlns": "urn:mpeg:dash:schema:mpd:2011",
|
xml.element("MPD", "xmlns": "urn:mpeg:dash:schema:mpd:2011",
|
||||||
|
@ -236,7 +236,7 @@ def get_spys_proxies(country_code = "US")
|
|||||||
proxies << {ip: ip, port: port, score: score}
|
proxies << {ip: ip, port: port, score: score}
|
||||||
end
|
end
|
||||||
|
|
||||||
proxies = proxies.sort_by { |proxy| proxy[:score] }.reverse
|
proxies = proxies.sort_by { |proxy| proxy[:score] }.reverse!
|
||||||
return proxies
|
return proxies
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user