init
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
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}`;
|
||||
}
|
||||
Reference in New Issue
Block a user