Move image blobs into separate tables (#618)

* Scene cover fallback to database
* Fix panic if studio not found
* Fix movie studio not being imported/exported
This commit is contained in:
WithoutPants
2020-06-23 09:19:19 +10:00
committed by GitHub
parent f8048dc27c
commit 7a74658a73
31 changed files with 1456 additions and 131 deletions

View File

@@ -338,9 +338,8 @@ func createMovies(tx *sqlx.Tx, n int, o int) error {
name = getMovieStringValue(index, name)
movie := models.Movie{
Name: sql.NullString{String: name, Valid: true},
FrontImage: []byte(models.DefaultMovieImage),
Checksum: utils.MD5FromString(name),
Name: sql.NullString{String: name, Valid: true},
Checksum: utils.MD5FromString(name),
}
created, err := mqb.Create(movie, tx)
@@ -385,8 +384,6 @@ func createPerformers(tx *sqlx.Tx, n int, o int) error {
performer := models.Performer{
Name: sql.NullString{String: getPerformerStringValue(index, name), Valid: true},
Checksum: getPerformerStringValue(i, checksumField),
// just use movie image
Image: []byte(models.DefaultMovieImage),
Favorite: sql.NullBool{Bool: getPerformerBoolValue(i), Valid: true},
}
@@ -450,7 +447,6 @@ func createStudio(tx *sqlx.Tx, name string, parentID *int64) (*models.Studio, er
sqb := models.NewStudioQueryBuilder()
studio := models.Studio{
Name: sql.NullString{String: name, Valid: true},
Image: []byte(models.DefaultStudioImage),
Checksum: utils.MD5FromString(name),
}