333 lines
10 KiB
Go
333 lines
10 KiB
Go
package entity
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
var FileFixtures = map[string]File{
|
|
"exampleFileName.jpg": {
|
|
ID: 1000000,
|
|
Photo: PhotoFixtures.Pointer("19800101_000002_D640C559"),
|
|
PhotoID: 1000000,
|
|
PhotoUUID: "pt9jtdre2lvl0yh7",
|
|
FileUUID: "ft8es39w45bnlqdw",
|
|
FileName: "exampleFileName.jpg",
|
|
OriginalName: "exampleFileNameOriginal.jpg",
|
|
FileHash: "2cad9168fa6acc5c5c2965ddf6ec465ca42fd818",
|
|
FileModified: time.Date(2020, 3, 6, 2, 6, 51, 0, time.UTC),
|
|
FileSize: 4278906,
|
|
FileType: "jpg",
|
|
FileMime: "image/jpg",
|
|
FilePrimary: true,
|
|
FileSidecar: false,
|
|
FileVideo: false,
|
|
FileMissing: false,
|
|
FileDuplicate: true,
|
|
FilePortrait: true,
|
|
FileWidth: 3648,
|
|
FileHeight: 2736,
|
|
FileOrientation: 0,
|
|
FileAspectRatio: 1.33333,
|
|
FileMainColor: "green",
|
|
FileColors: "929299991",
|
|
FileLuminance: "8836BD496",
|
|
FileDiff: 968,
|
|
FileChroma: 25,
|
|
FileNotes: "",
|
|
FileError: "",
|
|
Share: []FileShare{
|
|
FileShareFixtures.Get("FileShare1", 0, 0, ""),
|
|
FileShareFixtures.Get("FileShare2", 0, 0, ""),
|
|
},
|
|
Sync: []FileSync{},
|
|
Links: []Link{},
|
|
CreatedAt: time.Date(2020, 3, 6, 2, 6, 51, 0, time.UTC),
|
|
CreatedIn: 2,
|
|
UpdatedAt: time.Date(2020, 3, 28, 14, 6, 0, 0, time.UTC),
|
|
UpdatedIn: 0,
|
|
DeletedAt: nil,
|
|
},
|
|
"exampleDNGFile.dng": {
|
|
ID: 1000001,
|
|
Photo: PhotoFixtures.Pointer("Photo01"),
|
|
PhotoID: 1000001,
|
|
PhotoUUID: "pt9jtdre2lvl0yh8",
|
|
FileUUID: "ft9es39w45bnlqdw",
|
|
FileName: "exampleDNGFile.dng",
|
|
OriginalName: "exampleDNGFile.dng",
|
|
FileHash: "3cad9168fa6acc5c5c2965ddf6ec465ca42fd818",
|
|
FileModified: time.Date(2019, 3, 6, 2, 6, 51, 0, time.UTC),
|
|
FileSize: 661858,
|
|
FileType: "dng",
|
|
FileMime: "image/dng",
|
|
FilePrimary: true,
|
|
FileSidecar: false,
|
|
FileVideo: false,
|
|
FileMissing: false,
|
|
FileDuplicate: false,
|
|
FilePortrait: false,
|
|
FileWidth: 1200,
|
|
FileHeight: 1600,
|
|
FileOrientation: 6,
|
|
FileAspectRatio: 0.75,
|
|
FileMainColor: "gold",
|
|
FileColors: "5552E2222",
|
|
FileLuminance: "444428399",
|
|
FileDiff: 747,
|
|
FileChroma: 12,
|
|
FileNotes: "File notes for dng",
|
|
FileError: "",
|
|
Share: []FileShare{},
|
|
Sync: []FileSync{},
|
|
Links: []Link{},
|
|
CreatedAt: time.Date(2019, 3, 6, 2, 6, 51, 0, time.UTC),
|
|
CreatedIn: 2,
|
|
UpdatedAt: time.Date(2020, 3, 28, 14, 6, 0, 0, time.UTC),
|
|
UpdatedIn: 0,
|
|
DeletedAt: nil,
|
|
},
|
|
"exampleXmpFile.xmp": {
|
|
ID: 1000002,
|
|
Photo: PhotoFixtures.Pointer("Photo01"),
|
|
PhotoID: 1000001,
|
|
PhotoUUID: "pt9jtdre2lvl0yh8",
|
|
FileUUID: "ft1es39w45bnlqdw",
|
|
FileName: "exampleXmpFile.xmp",
|
|
OriginalName: "exampleXmpFile.xmp",
|
|
FileHash: "ocad9168fa6acc5c5c2965ddf6ec465ca42fd818",
|
|
FileModified: time.Date(2019, 3, 6, 2, 6, 51, 0, time.UTC),
|
|
FileSize: 858,
|
|
FileType: "xmp",
|
|
FileMime: "text/xmp",
|
|
FilePrimary: false,
|
|
FileSidecar: true,
|
|
FileVideo: false,
|
|
FileMissing: false,
|
|
FileDuplicate: false,
|
|
FilePortrait: false,
|
|
FileWidth: 0,
|
|
FileHeight: 0,
|
|
FileOrientation: 0,
|
|
FileAspectRatio: 0,
|
|
FileMainColor: "",
|
|
FileColors: "",
|
|
FileLuminance: "",
|
|
FileDiff: 0,
|
|
FileChroma: 0,
|
|
FileNotes: "File notes for xmp",
|
|
FileError: "",
|
|
Share: []FileShare{},
|
|
Sync: []FileSync{},
|
|
Links: []Link{},
|
|
CreatedAt: time.Date(2019, 3, 6, 2, 6, 51, 0, time.UTC),
|
|
CreatedIn: 2,
|
|
UpdatedAt: time.Date(2020, 3, 28, 14, 6, 0, 0, time.UTC),
|
|
UpdatedIn: 0,
|
|
DeletedAt: nil,
|
|
},
|
|
"bridge.jpg": {
|
|
ID: 1000003,
|
|
Photo: PhotoFixtures.Pointer("Photo04"),
|
|
PhotoID: 1000004,
|
|
PhotoUUID: "pt9jtdre2lvl0y11",
|
|
FileUUID: "ft2es39w45bnlqdw",
|
|
FileName: "bridge.jpg",
|
|
OriginalName: "bridgeOriginal.jpg",
|
|
FileHash: "pcad9168fa6acc5c5c2965ddf6ec465ca42fd818",
|
|
FileModified: time.Date(2017, 2, 6, 2, 6, 51, 0, time.UTC),
|
|
FileSize: 961858,
|
|
FileType: "jpg",
|
|
FileMime: "image/jpg",
|
|
FilePrimary: true,
|
|
FileSidecar: false,
|
|
FileVideo: false,
|
|
FileMissing: false,
|
|
FileDuplicate: false,
|
|
FilePortrait: false,
|
|
FileWidth: 1200,
|
|
FileHeight: 1600,
|
|
FileOrientation: 6,
|
|
FileAspectRatio: 0.75,
|
|
FileMainColor: "magenta",
|
|
FileColors: "225221C1E",
|
|
FileLuminance: "DC42844C8",
|
|
FileDiff: 986,
|
|
FileChroma: 32,
|
|
FileNotes: "",
|
|
FileError: "",
|
|
Share: []FileShare{},
|
|
Sync: []FileSync{},
|
|
Links: []Link{},
|
|
CreatedAt: time.Date(2019, 1, 1, 2, 6, 51, 0, time.UTC),
|
|
CreatedIn: 2,
|
|
UpdatedAt: time.Date(2020, 3, 28, 14, 6, 0, 0, time.UTC),
|
|
UpdatedIn: 0,
|
|
DeletedAt: nil,
|
|
},
|
|
"reunion.jpg": {
|
|
ID: 1000004,
|
|
Photo: PhotoFixtures.Pointer("Photo05"),
|
|
PhotoID: 1000005,
|
|
PhotoUUID: "pt9jtdre2lvl0y12",
|
|
FileUUID: "ft3es39w45bnlqdw",
|
|
FileName: "reunion.jpg",
|
|
OriginalName: "reunionOriginal.jpg",
|
|
FileHash: "acad9168fa6acc5c5c2965ddf6ec465ca42fd818",
|
|
FileModified: time.Date(2017, 1, 6, 2, 6, 51, 0, time.UTC),
|
|
FileSize: 81858,
|
|
FileType: "jpg",
|
|
FileMime: "image/jpg",
|
|
FilePrimary: true,
|
|
FileSidecar: false,
|
|
FileVideo: false,
|
|
FileMissing: false,
|
|
FileDuplicate: false,
|
|
FilePortrait: false,
|
|
FileWidth: 1200,
|
|
FileHeight: 1600,
|
|
FileOrientation: 6,
|
|
FileAspectRatio: 0.75,
|
|
FileMainColor: "blue",
|
|
FileColors: "266111000",
|
|
FileLuminance: "DC42844C8",
|
|
FileDiff: 800,
|
|
FileChroma: 4,
|
|
FileNotes: "",
|
|
FileError: "Error",
|
|
Share: []FileShare{},
|
|
Sync: []FileSync{},
|
|
Links: []Link{},
|
|
CreatedAt: time.Date(2018, 1, 1, 2, 6, 51, 0, time.UTC),
|
|
CreatedIn: 2,
|
|
UpdatedAt: time.Date(2029, 3, 28, 14, 6, 0, 0, time.UTC),
|
|
UpdatedIn: 0,
|
|
DeletedAt: nil,
|
|
},
|
|
"Quality1FavoriteTrue.jpg": {
|
|
ID: 1000005,
|
|
Photo: PhotoFixtures.Pointer("Photo17"),
|
|
PhotoID: 1000017,
|
|
PhotoUUID: "pt9jtdre2lvl0y24",
|
|
FileUUID: "ft4es39w45bnlqdw",
|
|
FileName: "Quality1FavoriteTrue.jpg",
|
|
OriginalName: "Quality1FavoriteTrue.jpg",
|
|
FileHash: "acad9168fa6acc5c5c2965ddf6ec465ca42fd819",
|
|
FileModified: time.Date(2017, 1, 6, 2, 6, 51, 0, time.UTC),
|
|
FileSize: 500,
|
|
FileType: "jpg",
|
|
FileMime: "image/jpg",
|
|
FilePrimary: true,
|
|
FileSidecar: false,
|
|
FileVideo: false,
|
|
FileMissing: false,
|
|
FileDuplicate: false,
|
|
FilePortrait: false,
|
|
FileWidth: 1200,
|
|
FileHeight: 1600,
|
|
FileOrientation: 6,
|
|
FileAspectRatio: 0.75,
|
|
FileMainColor: "blue",
|
|
FileColors: "266111000",
|
|
FileLuminance: "DC42844C8",
|
|
FileDiff: 800,
|
|
FileChroma: 26,
|
|
FileNotes: "",
|
|
FileError: "",
|
|
Share: []FileShare{},
|
|
Sync: []FileSync{},
|
|
Links: []Link{},
|
|
CreatedAt: time.Date(2018, 1, 1, 2, 6, 51, 0, time.UTC),
|
|
CreatedIn: 2,
|
|
UpdatedAt: time.Date(2029, 3, 28, 14, 6, 0, 0, time.UTC),
|
|
UpdatedIn: 0,
|
|
DeletedAt: nil,
|
|
},
|
|
"missing.jpg": {
|
|
ID: 1000006,
|
|
Photo: PhotoFixtures.Pointer("Photo15"),
|
|
PhotoID: 1000015,
|
|
PhotoUUID: "pt9jtdre2lvl0y22",
|
|
FileUUID: "ft5es39w45bnlqdw",
|
|
FileName: "missing.jpg",
|
|
OriginalName: "missing.jpg",
|
|
FileHash: "acad9168fa6acc5c5c2965ddf6ec465ca42fd819",
|
|
FileModified: time.Date(2017, 1, 6, 2, 6, 51, 0, time.UTC),
|
|
FileSize: 500,
|
|
FileType: "jpg",
|
|
FileMime: "image/jpg",
|
|
FilePrimary: true,
|
|
FileSidecar: false,
|
|
FileVideo: false,
|
|
FileMissing: true,
|
|
FileDuplicate: false,
|
|
FilePortrait: false,
|
|
FileWidth: 1200,
|
|
FileHeight: 1600,
|
|
FileOrientation: 6,
|
|
FileAspectRatio: 0.75,
|
|
FileMainColor: "blue",
|
|
FileColors: "266111000",
|
|
FileLuminance: "DC42844C8",
|
|
FileDiff: 800,
|
|
FileChroma: 26,
|
|
FileNotes: "",
|
|
FileError: "",
|
|
Share: []FileShare{},
|
|
Sync: []FileSync{},
|
|
Links: []Link{},
|
|
CreatedAt: time.Date(2018, 1, 1, 2, 6, 51, 0, time.UTC),
|
|
CreatedIn: 2,
|
|
UpdatedAt: time.Date(2029, 3, 28, 14, 6, 0, 0, time.UTC),
|
|
UpdatedIn: 0,
|
|
DeletedAt: nil,
|
|
},
|
|
"Photo18.jpg": {
|
|
ID: 1000007,
|
|
Photo: nil, // no pointer here because related photo is deleted
|
|
PhotoID: 1000018,
|
|
PhotoUUID: "pt9jtdre2lvl0y25",
|
|
FileUUID: "ft6es39w45bnlqdw",
|
|
FileName: "Photo18.jpg",
|
|
OriginalName: "Photo18.jpg",
|
|
FileHash: "acad9168fa6acc5c5c2965ddf6ec465ca42fd820",
|
|
FileModified: time.Date(2017, 1, 6, 2, 6, 51, 0, time.UTC),
|
|
FileSize: 500,
|
|
FileType: "jpg",
|
|
FileMime: "image/jpg",
|
|
FilePrimary: true,
|
|
FileSidecar: false,
|
|
FileVideo: false,
|
|
FileMissing: false,
|
|
FileDuplicate: false,
|
|
FilePortrait: false,
|
|
FileWidth: 1200,
|
|
FileHeight: 1600,
|
|
FileOrientation: 6,
|
|
FileAspectRatio: 0.75,
|
|
FileMainColor: "green",
|
|
FileColors: "266111000",
|
|
FileLuminance: "DC42844C8",
|
|
FileDiff: 800,
|
|
FileChroma: 0,
|
|
FileNotes: "",
|
|
FileError: "",
|
|
Share: []FileShare{},
|
|
Sync: []FileSync{},
|
|
Links: []Link{},
|
|
CreatedAt: time.Date(2018, 1, 1, 2, 6, 51, 0, time.UTC),
|
|
CreatedIn: 2,
|
|
UpdatedAt: time.Date(2029, 3, 28, 14, 6, 0, 0, time.UTC),
|
|
UpdatedIn: 0,
|
|
DeletedAt: nil,
|
|
},
|
|
}
|
|
|
|
var FileFixturesExampleJPG = FileFixtures["exampleFileName.jpg"]
|
|
var FileFixturesExampleXMP = FileFixtures["exampleXmpFile.xmp"]
|
|
|
|
// CreateFileFixtures inserts known entities into the database for testing.
|
|
func CreateFileFixtures() {
|
|
for _, entity := range FileFixtures {
|
|
Db().Create(&entity)
|
|
}
|
|
}
|