fix(ruby): correct file name for conversion instead of changing download link

This commit is contained in:
sshakndr
2025-03-18 12:52:54 +07:00
parent c8288b3141
commit 1a73be6a12
3 changed files with 14 additions and 5 deletions

View File

@ -30,11 +30,20 @@ class ServiceConverter
@document_converter_url = ServiceConverter.config_manager.document_server_converter_uri.to_s
# get the url of the converted file
def self.get_converted_data(document_uri, from_ext, to_ext, document_revision_id, is_async, file_pass, lang = nil)
def self.get_converted_data(
document_uri,
from_ext,
to_ext,
document_revision_id,
is_async,
file_pass,
lang = nil,
title = nil
)
from_ext = File.extname(document_uri).downcase if from_ext.nil? # get the current document extension
# get the current document name or uuid
title = File.basename(URI.parse(document_uri).path)
title = File.basename(URI.parse(document_uri).path) if title.nil?
title = UUID.generate.to_s if title.nil?
# get the document key