mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-22 11:31:01 +00:00
Calculate media URI properly even when MEDIA_UPLOAD_DIRECTORY configured
This commit is contained in:
parent
112c034e27
commit
9e5ec0c9df
1 changed files with 5 additions and 1 deletions
|
@ -156,7 +156,11 @@ impl Media {
|
|||
if self.is_remote {
|
||||
Ok(self.remote_url.clone().unwrap_or_default())
|
||||
} else {
|
||||
let file_path = self.file_path.replace(path::MAIN_SEPARATOR, "/");
|
||||
let file_path = self.file_path.replace(path::MAIN_SEPARATOR, "/").replacen(
|
||||
&CONFIG.media_directory,
|
||||
"static/media",
|
||||
1,
|
||||
); // "static/media" from plume::routs::plume_media_files()
|
||||
Ok(ap_url(&format!(
|
||||
"{}/{}",
|
||||
Instance::get_local()?.public_domain,
|
||||
|
|
Loading…
Reference in a new issue