Invidious is an alternative front-end to YouTube
Fix Ameba Lint/UselessAssign
syeopite89a0761a19f4
diff --git a/spec/http_server/handlers/static_assets_handler_spec.cr b/spec/http_server/handlers/static_assets_handler_spec.crindex 9b7a363e..373d59fd 100644--- a/spec/http_server/handlers/static_assets_handler_spec.cr+++ b/spec/http_server/handlers/static_assets_handler_spec.cr@@ -106,8 +106,7 @@ Spectator.describe StaticAssetsHandler dofile_link = "/#{File.basename(temporary_file.path)}"# Make request- headers = HTTP::Headers{"Range" => "bytes=0-2"}- response = handle HTTP::Request.new("GET", file_link, headers)+ handle HTTP::Request.new("GET", file_link, HTTP::Headers{"Range" => "bytes=0-2"})# Mutate file on disktemporary_file << "Something else"diff --git a/src/invidious/http_server/static_assets_handler.cr b/src/invidious/http_server/static_assets_handler.crindex 8f2c1b7e..94add5a8 100644--- a/src/invidious/http_server/static_assets_handler.cr+++ b/src/invidious/http_server/static_assets_handler.cr@@ -71,7 +71,7 @@ module Invidious::HttpServer# Writes file data to the cacheprivate def flush_io_to_cache(io, file_path, file_info)- if @@cached_files.sum(&.[1].size) + (size = file_info.size) < CACHE_LIMIT+ if @@cached_files.sum(&.[1].size) + file_info.size < CACHE_LIMITdata_slice = io.to_slice@@cached_files[file_path] = CachedFile.new(data_slice, file_info.size, file_info.modification_time)end