Release 2.21.5: hide generated image copies from media library
This commit is contained in:
1 parent
b80d4aa9c7
commit
9e988c307e
7 files changed
+32
-7
No files matched your search
@@ -737,6 +737,7 @@ test('media library backfills existing image and video uploads', async () => {
|
||||
const uploadDir = await fs.promises.mkdtemp(path.join(os.tmpdir(), 'pulse-media-library-'));
|
||||
await fs.promises.writeFile(path.join(uploadDir, 'legacy.png'), Buffer.from('image'));
|
||||
await fs.promises.writeFile(path.join(uploadDir, 'legacy.thumb.webp'), Buffer.from('thumbnail'));
|
||||
await fs.promises.writeFile(path.join(uploadDir, 'image-playback-' + 'a'.repeat(64) + '.png'), Buffer.from('generated'));
|
||||
await fs.promises.writeFile(path.join(uploadDir, 'legacy.mp4'), Buffer.from('video'));
|
||||
await fs.promises.writeFile(path.join(uploadDir, 'ignore.txt'), Buffer.from('other'));
|
||||
const queries = [];
|
||||
@@ -760,6 +761,20 @@ test('media library backfills existing image and video uploads', async () => {
|
||||
}
|
||||
});
|
||||
|
||||
test('media library omits generated image copies from published asset results', async () => {
|
||||
const generated = 'image-crop-' + 'b'.repeat(64) + '.png';
|
||||
const pool = {
|
||||
async query() {
|
||||
return [[
|
||||
{ id: 1, media_path: '/media/uploads/source.png' },
|
||||
{ id: 2, media_path: '/media/uploads/' + generated }
|
||||
]];
|
||||
}
|
||||
};
|
||||
|
||||
assert.deepEqual((await mediaLibrary.fetchMediaAssets(pool)).map(asset => asset.id), [1]);
|
||||
});
|
||||
|
||||
test('media library counts slide, template background, and region default references', async () => {
|
||||
const queries = [];
|
||||
const pool = {
|
||||
|
||||
Reference in new issue
Block a user