mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Model refactor (#3915)
* Add mockery config file * Move basic file/folder structs to models * Fix hack due to import loop * Move file interfaces to models * Move folder interfaces to models * Move scene interfaces to models * Move scene marker interfaces to models * Move image interfaces to models * Move gallery interfaces to models * Move gallery chapter interfaces to models * Move studio interfaces to models * Move movie interfaces to models * Move performer interfaces to models * Move tag interfaces to models * Move autotag interfaces to models * Regenerate mocks
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
package sqlite
|
||||
|
||||
import (
|
||||
"github.com/stashapp/stash/pkg/file"
|
||||
|
||||
"gopkg.in/guregu/null.v4"
|
||||
|
||||
"github.com/stashapp/stash/pkg/models"
|
||||
)
|
||||
|
||||
// null package does not provide methods to convert null.Int to int pointer
|
||||
@@ -33,27 +33,27 @@ func nullFloatPtr(i null.Float) *float64 {
|
||||
return &v
|
||||
}
|
||||
|
||||
func nullIntFolderIDPtr(i null.Int) *file.FolderID {
|
||||
func nullIntFolderIDPtr(i null.Int) *models.FolderID {
|
||||
if !i.Valid {
|
||||
return nil
|
||||
}
|
||||
|
||||
v := file.FolderID(i.Int64)
|
||||
v := models.FolderID(i.Int64)
|
||||
|
||||
return &v
|
||||
}
|
||||
|
||||
func nullIntFileIDPtr(i null.Int) *file.ID {
|
||||
func nullIntFileIDPtr(i null.Int) *models.FileID {
|
||||
if !i.Valid {
|
||||
return nil
|
||||
}
|
||||
|
||||
v := file.ID(i.Int64)
|
||||
v := models.FileID(i.Int64)
|
||||
|
||||
return &v
|
||||
}
|
||||
|
||||
func nullIntFromFileIDPtr(i *file.ID) null.Int {
|
||||
func nullIntFromFileIDPtr(i *models.FileID) null.Int {
|
||||
if i == nil {
|
||||
return null.NewInt(0, false)
|
||||
}
|
||||
@@ -61,7 +61,7 @@ func nullIntFromFileIDPtr(i *file.ID) null.Int {
|
||||
return null.IntFrom(int64(*i))
|
||||
}
|
||||
|
||||
func nullIntFromFolderIDPtr(i *file.FolderID) null.Int {
|
||||
func nullIntFromFolderIDPtr(i *models.FolderID) null.Int {
|
||||
if i == nil {
|
||||
return null.NewInt(0, false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user