cleaning up manager, tying it to add files

This commit is contained in:
2020-06-19 17:12:21 -04:00
parent 7610e3f168
commit e75991da22
11 changed files with 140 additions and 148 deletions

View File

@@ -74,7 +74,7 @@ func (db *DB) RetrieveWatchedFiles() ([]File, error) {
// InitialiseFileInDatabase should be called before any file is copied/renamed/diff'd/patched,
// and this should be checked before any operation occurs on a file. Any loss of data is completely as a result
// of losing references
func (db *DB) InitialiseFileInDatabase(file File) (int, error) {
func (db *DB) InitializeFileInDatabase(file File) (int, error) {
if err := db.Save(&file); err != nil {
db.Err(err).Msg("Error initialising file in database")
return file.ID, err
@@ -179,7 +179,7 @@ func (db *DB) RetrieveDiffsByID(ID int) (DiffObject, error) {
// UpdateDescription is a simple function to set the label on a patch
func (db *DB) UpdateDescription(patchID int, description string) error {
fmt.Println("attempting to path with id ", patchID, " description ", description)
if err := db.Update(&DiffObject{ID: patchID, Description: description}); err != nil {
if err := db.Update(&DiffObject{ID: patchID}); err != nil {
db.Err(err).Msg("Error changing diff label")
return err
}