edit-meta: skip undefined EXIF
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/1010/head
parent
b94275030f
commit
921345523e
|
@ -273,6 +273,15 @@ export default defineComponent({
|
||||||
try {
|
try {
|
||||||
// Update EXIF if required
|
// Update EXIF if required
|
||||||
const raw = exifs.get(fileid) ?? {};
|
const raw = exifs.get(fileid) ?? {};
|
||||||
|
|
||||||
|
// Remove undefined keys
|
||||||
|
for (const key in raw) {
|
||||||
|
if ((raw as any)[key] === undefined) {
|
||||||
|
delete (raw as any)[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Save EXIF if required
|
||||||
if (Object.keys(raw).length > 0) {
|
if (Object.keys(raw).length > 0) {
|
||||||
const info = await axios.patch<IImageInfo>(API.IMAGE_SETEXIF(fileid), { raw });
|
const info = await axios.patch<IImageInfo>(API.IMAGE_SETEXIF(fileid), { raw });
|
||||||
dirty = true;
|
dirty = true;
|
||||||
|
|
Loading…
Reference in New Issue