file paths

This commit is contained in:
2024-10-09 23:36:24 +03:00
parent e9537862ca
commit 986d3420cb
4 changed files with 17 additions and 10 deletions
+4 -2
View File
@@ -2,7 +2,8 @@ export function imgurl(channel, record) {
if (record._file.mime === "image/svg+xml") {
return fileurl(channel, record);
}
return channel.disks[record._file.disk] + `/thumbs/${record._file.path}`;
const pathAr = record._file.path.split("/");
return channel.disks[record._file.disk] + `/${pathAr[0]}/thumbs/${pathAr[1]}`;
}
export function fileurl(channel, record) {
@@ -17,7 +18,8 @@ export function htmlurl(channel, record, preset) {
if (record._file.width > 0) {
let presetUrl = url;
if (preset) {
presetUrl = channel.disks[record._file.disk] + `/templates/${preset}/${record._file.path}`;
const pathAr = record._file.path.split("/");
presetUrl = channel.disks[record._file.disk] + `/${pathAr[0]}/templates/${preset}/${pathAr[1]}`;
}
html = `<img src="${presetUrl}" alt="${record._file.path}" />`
} else if (record._file.mime === "image/svg+xml") {