mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
fixed: 1.readme加载不正常, 2.文件目录加载性能优化
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
if @project.forge?
|
||||
is_dir = @sub_entries.is_a?(Array)
|
||||
file_name = entry['name']
|
||||
file_type = File.extname(file_name.to_s)[1..-1]
|
||||
direct_download = download_type(file_type)
|
||||
@@ -9,16 +10,16 @@ if @project.forge?
|
||||
json.type entry['type']
|
||||
json.size entry['size']
|
||||
|
||||
json.content (direct_download || image_type) ? nil : decode64_content(entry, @owner, @repository, @ref, @path)
|
||||
json.content (direct_download || image_type || is_dir) ? nil : decode64_content(entry, @owner, @repository, @ref, @path)
|
||||
json.target entry['target']
|
||||
|
||||
download_url =
|
||||
if image_type
|
||||
dir_path = [@owner.login, @repository.identifier, "raw/branch", @ref].join('/')
|
||||
render_download_image_url(dir_path, entry['path'], decode64_content(entry, @owner, @repository, @ref))
|
||||
is_dir ? "" : render_download_image_url(dir_path, entry['path'], decode64_content(entry, @owner, @repository, @ref))
|
||||
else
|
||||
# entry['download_url']
|
||||
render_download_file_url(@owner, @repository, entry['path'].to_s, @ref)
|
||||
is_dir ? "" : render_download_file_url(@owner, @repository, entry['path'].to_s, @ref)
|
||||
end
|
||||
json.download_url download_url
|
||||
|
||||
|
||||
Reference in New Issue
Block a user