edit-date: fix saveMany call (fix #203)
parent
34340de5f1
commit
6c49ace00a
|
@ -335,12 +335,11 @@ export default class EditDate extends Mixins(GlobalMixin) {
|
||||||
const offset = date.getTime() - pDate.getTime();
|
const offset = date.getTime() - pDate.getTime();
|
||||||
const scale = diff > 0 ? diffNew / diff : 0;
|
const scale = diff > 0 ? diffNew / diff : 0;
|
||||||
const pDateNew = new Date(dateNew.getTime() - offset * scale);
|
const pDateNew = new Date(dateNew.getTime() - offset * scale);
|
||||||
const res = await axios.patch<any>(
|
await axios.patch<any>(generateUrl(EDIT_API_URL, { id: p.fileid }), {
|
||||||
generateUrl(EDIT_API_URL, { id: p.fileid }),
|
raw: {
|
||||||
{
|
DateTimeOriginal: this.getExifFormat(pDateNew),
|
||||||
date: this.getExifFormat(pDateNew),
|
},
|
||||||
}
|
});
|
||||||
);
|
|
||||||
emit("files:file:updated", { fileid: p.fileid });
|
emit("files:file:updated", { fileid: p.fileid });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.response?.data?.message) {
|
if (e.response?.data?.message) {
|
||||||
|
|
Loading…
Reference in New Issue