Skip to content

Commit

Permalink
actor add bug fix;
Browse files Browse the repository at this point in the history
  • Loading branch information
varg1714 committed May 24, 2024
1 parent 5877117 commit a91f0b5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions internal/db/film.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func CreateFilms(source string, actor string, models []model.ObjThumb) error {
})
}

return errors.WithStack(db.CreateInBatches(films, 100).Error)
return errors.WithStack(db.CreateInBatches(&films, 100).Error)

}

Expand Down Expand Up @@ -100,7 +100,7 @@ func CreateCacheFile(magnet string, fileId string, name string) error {
Code: code,
}

return errors.WithStack(db.Create(magnetCache).Error)
return errors.WithStack(db.Create(&magnetCache).Error)

}

Expand All @@ -119,7 +119,7 @@ func UpdateCacheFile(magnet string, fileId string, name string) error {
Code: code,
}

return errors.WithStack(db.Where("code = ?", code).Save(magnetCache).Error)
return errors.WithStack(db.Where("code = ?", code).Save(&magnetCache).Error)

}

Expand All @@ -131,7 +131,8 @@ func CreateActor(dir string, name string, url string) error {
Url: url,
}

return errors.WithStack(db.Create(actor).Error)
err := db.Create(&actor).Error
return errors.WithStack(err)

}

Expand Down Expand Up @@ -178,7 +179,7 @@ func QueryVirtualFilm(storageId uint, name string) model.VirtualFile {

func CreateVirtualFile(virtualFile model.VirtualFile) error {

return errors.WithStack(db.Create(virtualFile).Error)
return errors.WithStack(db.Create(&virtualFile).Error)

}

Expand All @@ -202,7 +203,7 @@ func Rename(storageId uint, dir, oldName, newName string) error {
return db.Where("storage_id = ? and dir_name = ? and old_name = ?", storageId, dir, oldName).Save(replacement).Error
} else {
replacement.NewName = newName
return errors.WithStack(db.Create(replacement).Error)
return errors.WithStack(db.Create(&replacement).Error)
}

}
Expand Down

0 comments on commit a91f0b5

Please sign in to comment.