Frontend: Set Modified* flags #243

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-02-07 17:24:24 +01:00
parent c583d7e994
commit 5fba038442
2 changed files with 27 additions and 4 deletions

View file

@ -11,7 +11,6 @@ class Photo extends Abstract {
PhotoPath: "",
PhotoName: "",
PhotoTitle: "",
PhotoTitleChanged: false,
PhotoDescription: "",
PhotoNotes: "",
PhotoArtist: "",
@ -37,13 +36,15 @@ class Photo extends Abstract {
LocationID: "",
Place: null,
PlaceID: "",
LocationChanged: false,
LocationEstimated: false,
PhotoCountry: "",
PhotoYear: 0,
PhotoMonth: 0,
TakenAtLocal: "",
TakenAtChanged: false,
ModifiedDate: false,
ModifiedTitle: false,
ModifiedDetails: false,
ModifiedLocation: false,
TimeZone: "",
Files: [],
Labels: [],
@ -219,6 +220,28 @@ class Photo extends Abstract {
.then((response) => Promise.resolve(this.setValues(response.data)));
}
update() {
const values = this.getValues(true);
if(values.PhotoTitle) {
values.ModifiedTitle = true
}
if(values.PhotoLat || values.PhotoLng || values.PhotoAltitude) {
values.ModifiedLocation = true
}
if(values.TakenAt || values.TimeZone) {
values.ModifiedDate = true
}
if(values.CameraID || values.LensID || values.PhotoCountry) {
values.ModifiedDetails = true
}
return Api.put(this.getEntityResource(), values).then((response) => Promise.resolve(this.setValues(response.data)));
}
static getCollectionResource() {
return "photos";
}

View file

@ -143,7 +143,7 @@
"primary": "#c8bdb1",
"secondary-dark": "#353839",
"secondary": "#A8A8A8",
"secondary-light": "#B8B8B8",
"secondary-light": "#cdccca",
"accent": "#656565",
"error": "#FF76DC",
"info": "#5A94DD",