some typos

This commit is contained in:
Philipp Häfelfinger 2019-04-06 00:00:01 +02:00
parent 528e74b9fe
commit edf5105680

View File

@ -77,27 +77,27 @@ func updatePiwigoCategoriesFromServer(piwigoApi piwigo.PiwigoCategoryApi, db dat
return err return err
} }
for _, pwgcat := range categories { for _, pwgCat := range categories {
dbcat, err := db.GetCategoryByPiwigoId(pwgcat.Id) dbCat, err := db.GetCategoryByPiwigoId(pwgCat.Id)
if err == datastore.ErrorRecordNotFound { if err == datastore.ErrorRecordNotFound {
logrus.Debugf("Adding category %s", pwgcat.Key) logrus.Debugf("Adding category %s", pwgCat.Key)
dbcat = datastore.CategoryData{ dbCat = datastore.CategoryData{
PiwigoId: pwgcat.Id, PiwigoId: pwgCat.Id,
} }
} else if err != nil { } else if err != nil {
return err return err
} }
if dbcat.Name == pwgcat.Name && dbcat.Key == pwgcat.Key && dbcat.PiwigoParentId == pwgcat.ParentId { if dbCat.Name == pwgCat.Name && dbCat.Key == pwgCat.Key && dbCat.PiwigoParentId == pwgCat.ParentId {
logrus.Debugf("No changes for category %s", dbcat.Key) logrus.Debugf("No changes for category %s", dbCat.Key)
continue continue
} }
dbcat.Name = pwgcat.Name dbCat.Name = pwgCat.Name
dbcat.Key = pwgcat.Key dbCat.Key = pwgCat.Key
dbcat.PiwigoParentId = pwgcat.ParentId dbCat.PiwigoParentId = pwgCat.ParentId
err = db.SaveCategory(dbcat) err = db.SaveCategory(dbCat)
if err != nil { if err != nil {
return err return err
} }