|
|
|
@@ -17,14 +17,15 @@ if @project.forge? |
|
|
|
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('/') |
|
|
|
is_dir ? "" : render_download_image_url(dir_path, entry['path'], decode64_content(entry, @owner, @repository, @ref)) |
|
|
|
else |
|
|
|
# entry['download_url'] |
|
|
|
is_dir ? "" : render_download_file_url(@owner, @repository, entry['path'].to_s, @ref) |
|
|
|
end |
|
|
|
download_url = is_dir ? "" : render_download_file_url(@owner, @repository, entry['path'].to_s, @ref) |
|
|
|
# if image_type |
|
|
|
# # dir_path = [@owner.login, @repository.identifier, "raw/branch", @ref].join('/') |
|
|
|
# # is_dir ? "" : render_download_image_url(dir_path, entry['path'], decode64_content(entry, @owner, @repository, @ref)) |
|
|
|
# is_dir ? "" : render_gitea_raw_url(entry['download_url']) |
|
|
|
# else |
|
|
|
# # entry['download_url'] |
|
|
|
# is_dir ? "" : render_download_file_url(@owner, @repository, entry['path'].to_s, @ref) |
|
|
|
# end |
|
|
|
json.download_url download_url |
|
|
|
|
|
|
|
json.direct_download direct_download |
|
|
|
|