32 lines
877 B
JavaScript
32 lines
877 B
JavaScript
|
|
import {getContext} from "svelte";
|
||
|
|
|
||
|
|
export function imgurl(record, width = "", height = "", mode = "") {
|
||
|
|
// let argumentString = "-o";
|
||
|
|
// if (mode) {
|
||
|
|
// argumentString += "-mode_fit";
|
||
|
|
// }
|
||
|
|
// if (width) {
|
||
|
|
// argumentString += "-w_" + width;
|
||
|
|
// }
|
||
|
|
// if (height) {
|
||
|
|
// argumentString += "-h_" + height;
|
||
|
|
// }
|
||
|
|
// let pathAr = record._file.path.split(".");
|
||
|
|
// let ext = pathAr.pop();
|
||
|
|
// let filename = record._file.path.replace("." + ext, "");
|
||
|
|
// let cache = "cache/"
|
||
|
|
// if (!mode && !width && !height) {
|
||
|
|
// argumentString = "";
|
||
|
|
// cache = "";
|
||
|
|
// }
|
||
|
|
|
||
|
|
const channel = getContext("channel")
|
||
|
|
return channel.filesUrl + `/thumbs/${record._file.path}`;
|
||
|
|
}
|
||
|
|
|
||
|
|
export function fileurl(record) {
|
||
|
|
|
||
|
|
const channel = getContext("channel")
|
||
|
|
return channel.filesUrl + `/${record._file.path}`;
|
||
|
|
}
|