forked from DebaucheryLibrarian/traxxx
Fixed SFW determination in image path function.
This commit is contained in:
parent
44523609c1
commit
f91437e03c
|
@ -47,6 +47,7 @@
|
|||
>
|
||||
|
||||
<Logo
|
||||
v-if="!sfw"
|
||||
:photo="tag.poster"
|
||||
favicon
|
||||
/>
|
||||
|
|
|
@ -24,13 +24,41 @@ async function init() {
|
|||
const app = createApp(Container);
|
||||
const events = mitt();
|
||||
|
||||
function getPath(media, type, options) {
|
||||
const path = (store.state.ui.sfw && media.assetPath)
|
||||
|| (media.isS3 && config.media.s3Path)
|
||||
|| (options?.local && config.media.assetPath)
|
||||
|| config.media.mediaPath;
|
||||
function getBasePath(media, type, options) {
|
||||
if (store.state.ui.sfw) {
|
||||
return config.media.assetPath;
|
||||
}
|
||||
|
||||
const filename = type && !options?.original ? media[type] : media.path;
|
||||
if (media.isS3) {
|
||||
return config.media.s3Path;
|
||||
}
|
||||
|
||||
if (options?.local) {
|
||||
return config.media.assetPath;
|
||||
}
|
||||
|
||||
return config.media.mediaPath;
|
||||
}
|
||||
|
||||
function getFilename(media, type, options) {
|
||||
if (store.state.ui.sfw && type && !options?.original) {
|
||||
return media.sfw[type];
|
||||
}
|
||||
|
||||
if (store.state.ui.sfw) {
|
||||
return media.sfw.path;
|
||||
}
|
||||
|
||||
if (type && !options?.original) {
|
||||
return media[type];
|
||||
}
|
||||
|
||||
return media.path;
|
||||
}
|
||||
|
||||
function getPath(media, type, options) {
|
||||
const path = getBasePath(media, type, options);
|
||||
const filename = getFilename(media, type, options);
|
||||
|
||||
return `${path}/${filename}`;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue