Integrated channel filter, partially restored actor bio.

This commit is contained in:
2024-01-10 02:00:38 +01:00
parent d242eb3b73
commit 63f2bdbe60
19 changed files with 1221 additions and 159 deletions

59
utils/media-path.js Normal file
View File

@@ -0,0 +1,59 @@
const config = {
client: {
media: {
assetPath: '/img',
mediaPath: '/media',
s3Path: 'https://cdndev.traxxx.me',
},
},
};
function getBasePath(media, type, options) {
/*
if (store.state.ui.sfw) {
return config.client.media.assetPath;
}
*/
if (media.isS3) {
return config.client.media.s3Path;
}
if (options?.local) {
return config.client.media.assetPath;
}
return config.client.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;
}
export function getMediaPath(media, type, options) {
console.log('media', media);
if (!media) {
return null;
}
const path = getBasePath(media, type, options);
const filename = getFilename(media, type, options);
console.log(path, filename);
return `${path}/${filename}`;
}