Tied consent warning to session.
This commit is contained in:
10
src/media.js
10
src/media.js
@@ -126,7 +126,7 @@ function toBaseSource(rawSource) {
|
||||
return null;
|
||||
}
|
||||
|
||||
function baseSourceToBaseMedia(baseSource, role, metadata) {
|
||||
function baseSourceToBaseMedia(baseSource, role, metadata, options) {
|
||||
if (Array.isArray(baseSource)) {
|
||||
if (baseSource.length > 0) {
|
||||
return {
|
||||
@@ -134,6 +134,7 @@ function baseSourceToBaseMedia(baseSource, role, metadata) {
|
||||
id: nanoid(),
|
||||
role,
|
||||
sources: baseSource,
|
||||
...options,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -146,6 +147,7 @@ function baseSourceToBaseMedia(baseSource, role, metadata) {
|
||||
id: nanoid(),
|
||||
role,
|
||||
sources: [baseSource],
|
||||
...options,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -299,6 +301,8 @@ async function storeImageFile(media, hashDir, hashSubDir, filename, filedir, fil
|
||||
const info = await image.metadata();
|
||||
const isProcessed = media.meta.subtype !== 'jpeg' || media.process;
|
||||
|
||||
console.log(media);
|
||||
|
||||
if (media.process) {
|
||||
Object.entries(media.process).forEach(([operation, options]) => {
|
||||
if (image[operation]) {
|
||||
@@ -727,9 +731,9 @@ async function associateAvatars(profiles) {
|
||||
? {
|
||||
...profile,
|
||||
avatarBaseMedia: toBaseMedias([profile.avatar], 'avatars', {
|
||||
credit: (profile.credit !== undefined && (profile.network?.name || profile.site?.name)) || null,
|
||||
credit: profile.credit || profile.entity?.name || null,
|
||||
scraper: profile.scraper || null,
|
||||
})[0],
|
||||
}, { stats: true })[0],
|
||||
}
|
||||
: profile
|
||||
));
|
||||
|
||||
Reference in New Issue
Block a user