photoprism: github.com/photoprism/photoprism/internal/entity Index | Files

package entity

import "github.com/photoprism/photoprism/internal/entity"

Package entity contains models for data storage based on GORM.

See http://gorm.io/docs/ for more information about GORM.

Additional information concerning data storage can be found in our Developer Guide:

https://github.com/photoprism/photoprism/wiki/Storage

Index

Package Files

account.go account_fixtures.go album.go album_fixtures.go camera.go camera_fixtures.go category.go category_fixtures.go cell.go cell_fixtures.go const.go country.go country_fixtures.go db.go details.go details_fixtures.go duplicate.go entity.go error.go file.go file_fixtures.go file_share.go file_share_fixtures.go file_sync.go file_sync_fixtures.go fixtures.go folder.go folder_fixtures.go keyword.go keyword_fixtures.go label.go label_fixtures.go lens.go lens_fixtures.go link.go link_fixtures.go password.go person.go photo.go photo_album.go photo_album_fixtures.go photo_counts.go photo_fixtures.go photo_keyword.go photo_keyword_fixtures.go photo_label.go photo_location.go photo_optimize.go photo_quality.go photo_yaml.go place.go place_fixtures.go time.go

Constants

const (
    AccountSyncStatusRefresh  = "refresh"
    AccountSyncStatusDownload = "download"
    AccountSyncStatusUpload   = "upload"
    AccountSyncStatusSynced   = "synced"
)
const (
    AlbumDefault = "album"
    AlbumFolder  = "folder"
    AlbumMoment  = "moment"
    AlbumMonth   = "month"
    AlbumState   = "state"
)
const (
    // Data sources.
    SrcAuto     = ""
    SrcManual   = "manual"
    SrcEstimate = "estimate"
    SrcName     = "name"
    SrcMeta     = "meta"
    SrcXmp      = "xmp"
    SrcYaml     = "yaml"
    SrcLocation = classify.SrcLocation
    SrcImage    = classify.SrcImage

    // Sort orders.
    SortOrderAdded     = "added"
    SortOrderNewest    = "newest"
    SortOrderOldest    = "oldest"
    SortOrderName      = "name"
    SortOrderSimilar   = "similar"
    SortOrderRelevance = "relevance"
    SortOrderEdited    = "edited"

    // Unknown values.
    YearUnknown  = -1
    MonthUnknown = -1
    DayUnknown   = -1
    TitleUnknown = "Unknown"

    // Content types.
    TypeDefault = ""
    TypeImage   = "image"
    TypeLive    = "live"
    TypeVideo   = "video"
    TypeRaw     = "raw"
    TypeText    = "text"

    // Root directories.
    RootUnknown   = ""
    RootOriginals = "/"
    RootExamples  = "examples"
    RootSidecar   = "sidecar"
    RootImport    = "import"
    RootPath      = "/"

    // Panorama projections.
    ProjectionDefault         = ""
    ProjectionEquirectangular = "equirectangular"
    ProjectionCubestrip       = "cubestrip"
    ProjectionCylindrical     = "cylindrical"

    // Event names.
    Updated = "updated"
    Created = "created"
    Deleted = "deleted"
)
const (
    MySQL  = "mysql"
    SQLite = "sqlite3"
)

Database drivers (sql dialects).

const (
    FileShareNew     = "new"
    FileShareError   = "error"
    FileShareShared  = "shared"
    FileShareRemoved = "removed"
)
const (
    FileSyncNew        = "new"
    FileSyncIgnore     = "ignore"
    FileSyncExists     = "exists"
    FileSyncDownloaded = "downloaded"
    FileSyncUploaded   = "uploaded"
)
const Day = time.Hour * 24

Variables

var AccountFixtureWebdavDummy = AccountFixtures["webdav-dummy"]
var AccountFixtureWebdavDummy2 = AccountFixtures["webdav-dummy2"]
var AccountFixtures = AccountMap{
    "webdav-dummy": {
        ID:            1000000,
        AccName:       "Test Account",
        AccOwner:      "",
        AccURL:        "http://webdav-dummy/",
        AccType:       "webdav",
        AccKey:        "",
        AccUser:       "admin",
        AccPass:       "photoprism",
        AccError:      "",
        AccErrors:     0,
        AccShare:      true,
        AccSync:       true,
        RetryLimit:    3,
        SharePath:     "/Photos",
        ShareSize:     "",
        ShareExpires:  1,
        SyncPath:      "/Photos",
        SyncStatus:    "",
        SyncInterval:  3600,
        SyncDate:      sql.NullTime{Time: Timestamp()},
        SyncUpload:    true,
        SyncDownload:  true,
        SyncFilenames: true,
        SyncRaw:       true,
        CreatedAt:     Timestamp(),
        UpdatedAt:     Timestamp(),
        DeletedAt:     nil,
    },
    "webdav-dummy2": {
        ID:            1000001,
        AccName:       "Test Account2",
        AccOwner:      "",
        AccURL:        "http://webdav-dummy/",
        AccType:       "webdav",
        AccKey:        "123",
        AccUser:       "admin",
        AccPass:       "photoprism",
        AccError:      "",
        AccErrors:     0,
        AccShare:      false,
        AccSync:       false,
        RetryLimit:    3,
        SharePath:     "/Photos",
        ShareSize:     "",
        ShareExpires:  0,
        SyncPath:      "/Photos",
        SyncStatus:    "test",
        SyncInterval:  3600,
        SyncDate:      sql.NullTime{Time: Timestamp()},
        SyncUpload:    true,
        SyncDownload:  true,
        SyncFilenames: true,
        SyncRaw:       true,
        CreatedAt:     Timestamp(),
        UpdatedAt:     Timestamp(),
        DeletedAt:     nil,
    },
}
var Admin = Person{
    ID:            1,
    UserName:      "admin",
    DisplayName:   "Admin",
    RoleAdmin:     true,
    UserActive:    true,
    UserConfirmed: true,
}

Default admin user.

var AlbumFixtures = AlbumMap{
    "christmas2030": {
        ID:               1000000,
        CoverUID:         "",
        AlbumUID:         "at9lxuqxpogaaba7",
        AlbumSlug:        "christmas2030",
        AlbumType:        AlbumDefault,
        AlbumTitle:       "Christmas2030",
        AlbumDescription: "Wonderful christmas",
        AlbumNotes:       "",
        AlbumOrder:       "oldest",
        AlbumTemplate:    "",
        AlbumFavorite:    false,
        CreatedAt:        time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:        time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
        DeletedAt:        nil,
    },
    "holiday-2030": {
        ID:               1000001,
        CoverUID:         "",
        AlbumUID:         "at9lxuqxpogaaba8",
        AlbumSlug:        "holiday-2030",
        AlbumType:        AlbumDefault,
        AlbumTitle:       "Holiday2030",
        AlbumDescription: "Wonderful christmas",
        AlbumNotes:       "",
        AlbumOrder:       "newest",
        AlbumTemplate:    "",
        AlbumFavorite:    true,
        CreatedAt:        time.Date(2019, 7, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:        time.Date(2020, 2, 1, 0, 0, 0, 0, time.UTC),
        DeletedAt:        nil,
    },
    "berlin-2019": {
        ID:               1000002,
        CoverUID:         "",
        AlbumUID:         "at9lxuqxpogaaba9",
        AlbumSlug:        "berlin-2019",
        AlbumType:        AlbumDefault,
        AlbumTitle:       "Berlin2019",
        AlbumDescription: "Wonderful christmas",
        AlbumNotes:       "",
        AlbumOrder:       "oldest",
        AlbumTemplate:    "",
        AlbumFavorite:    false,
        CreatedAt:        time.Date(2019, 7, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:        time.Date(2020, 2, 1, 0, 0, 0, 0, time.UTC),
        DeletedAt:        nil,
    },
    "april-1990": {
        ID:               1000003,
        CoverUID:         "",
        AlbumUID:         "at1lxuqipogaaba1",
        AlbumSlug:        "april-1990",
        AlbumType:        AlbumFolder,
        AlbumTitle:       "April 1990",
        AlbumDescription: "Spring is the time of year when many things change.",
        AlbumNotes:       "Thunderstorms cause most of the severe spring weather.",
        AlbumOrder:       "oldest",
        AlbumTemplate:    "",
        AlbumFilter:      "path:\"1990/04\"",
        AlbumFavorite:    false,
        CreatedAt:        time.Date(2019, 7, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:        time.Date(2020, 2, 1, 0, 0, 0, 0, time.UTC),
        DeletedAt:        nil,
    },
    "import": {
        ID:               1000004,
        CoverUID:         "",
        AlbumUID:         "at6axuzitogaaiax",
        AlbumSlug:        "import",
        AlbumType:        AlbumDefault,
        AlbumTitle:       "Import Album",
        AlbumDescription: "",
        AlbumNotes:       "",
        AlbumOrder:       "name",
        AlbumTemplate:    "",
        AlbumFilter:      "",
        AlbumFavorite:    false,
        CreatedAt:        time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:        time.Date(2020, 2, 1, 0, 0, 0, 0, time.UTC),
        DeletedAt:        nil,
    },
    "emptyMoment": {
        ID:               1000005,
        CoverUID:         "",
        AlbumUID:         "at7axuzitogaaiax",
        AlbumSlug:        "empty-moment",
        AlbumType:        AlbumMoment,
        AlbumTitle:       "Empty Moment",
        AlbumCategory:    "Fun",
        AlbumLocation:    "Favorite Park",
        AlbumDescription: "",
        AlbumNotes:       "",
        AlbumOrder:       "name",
        AlbumTemplate:    "",
        AlbumFilter:      "",
        AlbumFavorite:    false,
        CreatedAt:        time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:        time.Date(2020, 2, 1, 0, 0, 0, 0, time.UTC),
        DeletedAt:        nil,
    },
}
var CameraFixtures = CameraMap{
    "apple-iphone-se": {
        ID:                1000000,
        CameraSlug:        "apple-iphone-se",
        CameraName:        "Apple iPhone SE",
        CameraMake:        "Apple",
        CameraModel:       "iPhone SE",
        CameraType:        "",
        CameraDescription: "",
        CameraNotes:       "",
        CreatedAt:         time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:         time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        DeletedAt:         nil,
    },
    "canon-eos-5d": {
        ID:                1000001,
        CameraSlug:        "canon-eos-5d",
        CameraName:        "Canon EOS 5D",
        CameraMake:        "Canon",
        CameraModel:       "EOS 5D",
        CameraType:        "",
        CameraDescription: "",
        CameraNotes:       "",
        CreatedAt:         time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:         time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        DeletedAt:         nil,
    },
    "canon-eos-7d": {
        ID:                1000002,
        CameraSlug:        "canon-eos-7d",
        CameraName:        "Canon EOS 7D",
        CameraMake:        "Canon",
        CameraModel:       "EOS 7D",
        CameraType:        "",
        CameraDescription: "",
        CameraNotes:       "",
        CreatedAt:         time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:         time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        DeletedAt:         nil,
    },
    "canon-eos-6d": {
        ID:                1000003,
        CameraSlug:        "canon-eos-6d",
        CameraModel:       "EOS 6D",
        CameraMake:        "Canon",
        CameraType:        "",
        CameraDescription: "",
        CameraNotes:       "",
        CreatedAt:         time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:         time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        DeletedAt:         nil,
    },
    "apple-iphone-6": {
        ID:                1000004,
        CameraSlug:        "apple-iphone-6",
        CameraName:        "Apple iPhone 6",
        CameraMake:        "Apple",
        CameraModel:       "iPhone 6",
        CameraType:        "",
        CameraDescription: "",
        CameraNotes:       "",
        CreatedAt:         time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:         time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        DeletedAt:         nil,
    },
    "apple-iphone-7": {
        ID:                1000005,
        CameraSlug:        "apple-iphone-7",
        CameraName:        "Apple iPhone 7",
        CameraMake:        "Apple",
        CameraModel:       "iPhone 7",
        CameraType:        "",
        CameraDescription: "",
        CameraNotes:       "",
        CreatedAt:         Timestamp(),
        UpdatedAt:         Timestamp(),
        DeletedAt:         nil,
    },
}
var CameraMakes = map[string]string{
    "OLYMPUS OPTICAL CO.,LTD": "Olympus",
    "samsung":                 "Samsung",
}
var CameraModels = map[string]string{
    "WAS-LX1":    "P10 lite",
    "WAS-LX2":    "P10 lite",
    "WAS-LX3":    "P10 lite",
    "WAS-LX1A":   "P10 lite",
    "WAS-LX2J":   "P10 lite",
    "WAS-L03T":   "P10 lite",
    "WAS-AL00":   "P10 lite",
    "WAS-TL10":   "P10 lite",
    "VTR-L29":    "P10",
    "VTR-AL00":   "P10",
    "VTR-TL00":   "P10",
    "VTR-L09":    "P10",
    "EML-AL00":   "P20",
    "EML-L09":    "P20",
    "EML-L09C":   "P20",
    "EML-L29":    "P20",
    "EML-L29C":   "P20",
    "CLT-AL00":   "P20 Pro",
    "CLT-AL01":   "P20 Pro",
    "CLT-TL01":   "P20 Pro",
    "CLT-L09":    "P20 Pro",
    "CLT-L29":    "P20 Pro",
    "ELE-L29":    "P30",
    "ELE-AL00":   "P30",
    "ELE-L04":    "P30",
    "ELE-L09":    "P30",
    "ELE-TL00":   "P30",
    "VOG-L29":    "P30 Pro",
    "VOG-L09":    "P30 Pro",
    "VOG-L04":    "P30 Pro",
    "VOG-AL00":   "P30 Pro",
    "VOG-AL10":   "P30 Pro",
    "VOG-TL00":   "P30 Pro",
    "MAR-L01A":   "P30 lite",
    "MAR-L21A":   "P30 lite",
    "MAR-LX1A":   "P30 lite",
    "MAR-LX1M":   "P30 lite",
    "MAR-LX2":    "P30 lite",
    "MAR-L21MEA": "P30 lite",
    "MAR-L22A":   "P30 lite",
    "MAR-L22B":   "P30 lite",
    "MAR-LX3A":   "P30 lite",
    "ANA-AN00":   "P40",
    "ANA-TN00":   "P40",
    "ELS-AN00":   "P40 Pro",
    "ELS-TN00":   "P40 Pro",
    "ELS-NX9":    "P40 Pro",
    "ELS-N04":    "P40 Pro",
    "JNY-L21A":   "P40 lite",
    "JNY-L01A":   "P40 lite",
    "JNY-L21B":   "P40 lite",
    "JNY-L22A":   "P40 lite",
    "JNY-L02A":   "P40 lite",
    "JNY-L22B":   "P40 lite",
    "STK-LX1":    "Honor 9X",
    "HLK-AL00":   "Honor 9X",
    "HLK-TL00":   "Honor 9X",
    "SNE-AL00":   "Mate 20 lite",
    "SNE-LX1":    "Mate 20 lite",
    "SNE-LX2":    "Mate 20 lite",
    "SNE-LX3":    "Mate 20 lite",
    "INE-LX2":    "Mate 20 lite",
    "HMA-L29":    "Mate 20",
    "HMA-L09":    "Mate 20",
    "HMA-LX9":    "Mate 20",
    "HMA-AL00":   "Mate 20",
    "HMA-TL00":   "Mate 20",
    "LYA-L09":    "Mate 20 Pro",
    "LYA-L29":    "Mate 20 Pro",
    "LYA-AL00":   "Mate 20 Pro",
    "LYA-AL10":   "Mate 20 Pro",
    "LYA-TL00":   "Mate 20 Pro",
    "LYA-L0C":    "Mate 20 Pro",
    "TAS-L09":    "Mate 30",
    "TAS-L29":    "Mate 30",
    "TAS-AL00":   "Mate 30",
    "TAS-TL00":   "Mate 30",
    "LIO-L09":    "Mate 30 Pro",
    "LIO-L29":    "Mate 30 Pro",
    "LIO-AL00":   "Mate 30 Pro",
    "LIO-TL00":   "Mate 30 Pro",
}
var CategoryFixtures = map[string]Category{
    "flower_landscape": {
        LabelID:    1000001,
        Label:      LabelFixtures.Pointer("flower"),
        CategoryID: 1000000,
        Category:   LabelFixtures.Pointer("landscape"),
    },
}
var CellFixtures = CellMap{
    "mexico": {
        ID:           s2.TokenPrefix + "85d1ea7d382c",
        PlaceID:      PlaceFixtures.Get("mexico").ID,
        CellName:     "Adosada Platform",
        CellCategory: "botanical garden",
        Place:        PlaceFixtures.Pointer("mexico"),
        CreatedAt:    Timestamp(),
        UpdatedAt:    Timestamp(),
    },
    "caravan park": {
        ID:      s2.TokenPrefix + "1ef75a71a36c",
        PlaceID: s2.TokenPrefix + "1ef75a71a36c",
        Place: &Place{
            ID:           s2.TokenPrefix + "1ef75a71a36",
            PlaceLabel:   "Mandeni, KwaZulu-Natal, South Africa",
            PlaceCity:    "Mandeni",
            PlaceState:   "KwaZulu-Natal",
            PlaceCountry: "za",
            CreatedAt:    Timestamp(),
            UpdatedAt:    Timestamp(),
        },
        CellName:     "Lobotes Caravan Park",
        CellCategory: "camping",
        CreatedAt:    Timestamp(),
        UpdatedAt:    Timestamp(),
    },
    "zinkwazi": {
        ID:           s2.TokenPrefix + "1ef744d1e28c",
        PlaceID:      PlaceFixtures.Get("zinkwazi").ID,
        Place:        PlaceFixtures.Pointer("zinkwazi"),
        CellName:     "Zinkwazi Beach",
        CellCategory: "beach",
        CreatedAt:    Timestamp(),
        UpdatedAt:    Timestamp(),
    },
    "hassloch": {
        ID:           s2.TokenPrefix + "1ef744d1e280",
        PlaceID:      PlaceFixtures.Get("holidaypark").ID,
        Place:        PlaceFixtures.Pointer("holidaypark"),
        CellName:     "Holiday Park",
        CellCategory: "park",
        CreatedAt:    Timestamp(),
        UpdatedAt:    Timestamp(),
    },
    "emptyNameLongCity": {
        ID:           s2.TokenPrefix + "1ef744d1e281",
        PlaceID:      PlaceFixtures.Get("emptyNameLongCity").ID,
        Place:        PlaceFixtures.Pointer("emptyNameLongCity"),
        CellName:     "",
        CellCategory: "botanical garden",
        CreatedAt:    Timestamp(),
        UpdatedAt:    Timestamp(),
    },
    "emptyNameShortCity": {
        ID:           s2.TokenPrefix + "1ef744d1e282",
        PlaceID:      PlaceFixtures.Get("emptyNameShortCity").ID,
        Place:        PlaceFixtures.Pointer("emptyNameShortCity"),
        CellName:     "",
        CellCategory: "botanical garden",
        CreatedAt:    Timestamp(),
        UpdatedAt:    Timestamp(),
    },
    "veryLongLocName": {
        ID:           s2.TokenPrefix + "1ef744d1e283",
        PlaceID:      PlaceFixtures.Get("veryLongLocName").ID,
        Place:        PlaceFixtures.Pointer("veryLongLocName"),
        CellName:     "longlonglonglonglonglonglonglonglonglonglonglonglongName",
        CellCategory: "cape",
        CreatedAt:    Timestamp(),
        UpdatedAt:    Timestamp(),
    },
    "mediumLongLocName": {
        ID:           s2.TokenPrefix + "1ef744d1e283",
        PlaceID:      PlaceFixtures.Get("mediumLongLocName").ID,
        Place:        PlaceFixtures.Pointer("mediumLongLocName"),
        CellName:     "longlonglonglonglonglongName",
        CellCategory: "botanical garden",
        CreatedAt:    Timestamp(),
        UpdatedAt:    Timestamp(),
    },
}
var CountryFixtures = CountryMap{
    "germany": {
        ID:                 "de",
        CountrySlug:        "germany",
        CountryName:        "Germany",
        CountryDescription: "Country description",
        CountryNotes:       "Country Notes",
        CountryPhoto:       nil,
        CountryPhotoID:     0,
        New:                false,
    },
}
var DetailsFixtures = DetailsMap{
    "lake": {
        PhotoID:   1000000,
        Keywords:  "nature, frog",
        Notes:     "notes",
        Subject:   "Lake",
        Artist:    "Hans",
        Copyright: "copy",
        License:   "MIT",
    },
    "blacklist": {
        PhotoID:   1000001,
        Keywords:  "screenshot, info",
        Notes:     "notes",
        Subject:   "Blacklist",
        Artist:    "Hans",
        Copyright: "copy",
        License:   "MIT",
    },
    "bridge": {
        PhotoID:   1000003,
        Keywords:  "bridge, nature",
        Notes:     "Some Notes!@#$",
        Subject:   "Bridge",
        Artist:    "Jens Mander",
        Copyright: "Copyright 2020",
        License:   "n/a",
    },
}
var Entities = Types{
    "errors":          &Error{},
    "people":          &Person{},
    "accounts":        &Account{},
    "folders":         &Folder{},
    "duplicates":      &Duplicate{},
    "files":           &File{},
    "files_share":     &FileShare{},
    "files_sync":      &FileSync{},
    "photos":          &Photo{},
    "details":         &Details{},
    "places":          &Place{},
    "cells":           &Cell{},
    "cameras":         &Camera{},
    "lenses":          &Lens{},
    "countries":       &Country{},
    "albums":          &Album{},
    "photos_albums":   &PhotoAlbum{},
    "labels":          &Label{},
    "categories":      &Category{},
    "photos_labels":   &PhotoLabel{},
    "keywords":        &Keyword{},
    "photos_keywords": &PhotoKeyword{},
    "passwords":       &Password{},
    "links":           &Link{},
}

List of database entities and their table names.

var FileFixtures = map[string]File{
    "exampleFileName.jpg": {
        ID:              1000000,
        Photo:           PhotoFixtures.Pointer("19800101_000002_D640C559"),
        PhotoID:         PhotoFixtures.Pointer("19800101_000002_D640C559").ID,
        PhotoUID:        PhotoFixtures.Pointer("19800101_000002_D640C559").PhotoUID,
        FileUID:         "ft8es39w45bnlqdw",
        FileName:        "exampleFileName.jpg",
        FileRoot:        RootOriginals,
        OriginalName:    "exampleFileNameOriginal.jpg",
        FileHash:        "2cad9168fa6acc5c5c2965ddf6ec465ca42fd818",
        ModTime:         time.Date(2020, 3, 6, 2, 6, 51, 0, time.UTC).Unix(),
        FileSize:        4278906,
        FileType:        "jpg",
        FileMime:        "image/jpg",
        FilePrimary:     true,
        FileSidecar:     false,
        FileVideo:       false,
        FileMissing:     false,
        FilePortrait:    true,
        FileWidth:       3648,
        FileHeight:      2736,
        FileOrientation: 0,
        FileAspectRatio: 1.33333,
        FileMainColor:   "green",
        FileColors:      "929299991",
        FileLuminance:   "8836BD496",
        FileDiff:        968,
        FileChroma:      25,
        FileError:       "",
        Share: []FileShare{
            FileShareFixtures.Get("FileShare1", 0, 0, ""),
            FileShareFixtures.Get("FileShare2", 0, 0, ""),
        },
        Sync:      []FileSync{},
        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:         PhotoFixtures.Pointer("Photo01").ID,
        PhotoUID:        PhotoFixtures.Pointer("Photo01").PhotoUID,
        FileUID:         "ft9es39w45bnlqdw",
        FileName:        "exampleDNGFile.dng",
        FileRoot:        RootOriginals,
        OriginalName:    "exampleDNGFile.dng",
        FileHash:        "3cad9168fa6acc5c5c2965ddf6ec465ca42fd818",
        ModTime:         time.Date(2019, 3, 6, 2, 6, 51, 0, time.UTC).Unix(),
        FileSize:        661858,
        FileType:        "dng",
        FileMime:        "image/dng",
        FilePrimary:     false,
        FileSidecar:     false,
        FileVideo:       false,
        FileMissing:     false,
        FilePortrait:    false,
        FileWidth:       1200,
        FileHeight:      1600,
        FileOrientation: 6,
        FileAspectRatio: 0.75,
        FileMainColor:   "gold",
        FileColors:      "5552E2222",
        FileLuminance:   "444428399",
        FileDiff:        747,
        FileChroma:      12,
        FileError:       "",
        Share:           []FileShare{},
        Sync:            []FileSync{},
        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:         PhotoFixtures.Pointer("Photo01").ID,
        PhotoUID:        PhotoFixtures.Pointer("Photo01").PhotoUID,
        FileUID:         "ft1es39w45bnlqdw",
        FileName:        "exampleXmpFile.xmp",
        FileRoot:        RootOriginals,
        OriginalName:    "exampleXmpFile.xmp",
        FileHash:        "ocad9168fa6acc5c5c2965ddf6ec465ca42fd818",
        ModTime:         time.Date(2019, 3, 6, 2, 6, 51, 0, time.UTC).Unix(),
        FileSize:        858,
        FileType:        "xmp",
        FileMime:        "text/xmp",
        FilePrimary:     false,
        FileSidecar:     true,
        FileVideo:       false,
        FileMissing:     false,
        FilePortrait:    false,
        FileWidth:       0,
        FileHeight:      0,
        FileOrientation: 0,
        FileAspectRatio: 0,
        FileMainColor:   "",
        FileColors:      "",
        FileLuminance:   "",
        FileDiff:        0,
        FileChroma:      0,
        FileError:       "",
        Share:           []FileShare{},
        Sync:            []FileSync{},
        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:         PhotoFixtures.Pointer("Photo04").ID,
        PhotoUID:        PhotoFixtures.Pointer("Photo04").PhotoUID,
        FileUID:         "ft2es39w45bnlqdw",
        FileName:        "bridge.jpg",
        FileRoot:        RootOriginals,
        OriginalName:    "bridgeOriginal.jpg",
        FileHash:        "pcad9168fa6acc5c5c2965ddf6ec465ca42fd818",
        ModTime:         time.Date(2017, 2, 6, 2, 6, 51, 0, time.UTC).Unix(),
        FileSize:        961858,
        FileType:        "jpg",
        FileMime:        "image/jpg",
        FilePrimary:     true,
        FileSidecar:     false,
        FileVideo:       false,
        FileMissing:     false,
        FilePortrait:    false,
        FileWidth:       1200,
        FileHeight:      1600,
        FileOrientation: 6,
        FileAspectRatio: 0.75,
        FileMainColor:   "magenta",
        FileColors:      "225221C1E",
        FileLuminance:   "DC42844C8",
        FileDiff:        986,
        FileChroma:      32,
        FileError:       "",
        Share:           []FileShare{},
        Sync:            []FileSync{},
        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:         PhotoFixtures.Pointer("Photo05").ID,
        PhotoUID:        PhotoFixtures.Pointer("Photo05").PhotoUID,
        FileUID:         "ft3es39w45bnlqdw",
        FileName:        "reunion.jpg",
        FileRoot:        RootOriginals,
        OriginalName:    "reunionOriginal.jpg",
        FileHash:        "acad9168fa6acc5c5c2965ddf6ec465ca42fd818",
        ModTime:         time.Date(2017, 1, 6, 2, 6, 51, 0, time.UTC).Unix(),
        FileSize:        81858,
        FileType:        "jpg",
        FileMime:        "image/jpg",
        FilePrimary:     true,
        FileSidecar:     false,
        FileVideo:       false,
        FileMissing:     false,
        FilePortrait:    false,
        FileWidth:       1200,
        FileHeight:      1600,
        FileOrientation: 6,
        FileAspectRatio: 0.75,
        FileMainColor:   "blue",
        FileColors:      "266111000",
        FileLuminance:   "DC42844C8",
        FileDiff:        800,
        FileChroma:      4,
        FileError:       "Error",
        Share:           []FileShare{},
        Sync:            []FileSync{},
        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:         PhotoFixtures.Pointer("Photo17").ID,
        PhotoUID:        PhotoFixtures.Pointer("Photo17").PhotoUID,
        FileUID:         "ft4es39w45bnlqdw",
        FileName:        "Quality1FavoriteTrue.jpg",
        FileRoot:        RootOriginals,
        OriginalName:    "Quality1FavoriteTrue.jpg",
        FileHash:        "acad9168fa6acc5c5c2965ddf6ec465ca42fd819",
        ModTime:         time.Date(2017, 1, 6, 2, 6, 51, 0, time.UTC).Unix(),
        FileSize:        500,
        FileType:        "jpg",
        FileMime:        "image/jpg",
        FilePrimary:     true,
        FileSidecar:     false,
        FileVideo:       false,
        FileMissing:     false,
        FilePortrait:    false,
        FileWidth:       1200,
        FileHeight:      1600,
        FileOrientation: 6,
        FileAspectRatio: 0.75,
        FileMainColor:   "blue",
        FileColors:      "266111000",
        FileLuminance:   "DC42844C8",
        FileDiff:        800,
        FileChroma:      26,
        FileError:       "",
        Share:           []FileShare{},
        Sync:            []FileSync{},
        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:         PhotoFixtures.Pointer("Photo15").ID,
        PhotoUID:        PhotoFixtures.Pointer("Photo15").PhotoUID,
        FileUID:         "ft5es39w45bnlqdw",
        FileName:        "missing.jpg",
        FileRoot:        RootOriginals,
        OriginalName:    "missing.jpg",
        FileHash:        "acad9168fa6acc5c5c2965ddf6ec465ca42fd819",
        ModTime:         time.Date(2017, 1, 6, 2, 6, 51, 0, time.UTC).Unix(),
        FileSize:        500,
        FileType:        "jpg",
        FileMime:        "image/jpg",
        FilePrimary:     true,
        FileSidecar:     false,
        FileVideo:       false,
        FileMissing:     true,
        FilePortrait:    false,
        FileWidth:       1200,
        FileHeight:      1600,
        FileOrientation: 6,
        FileAspectRatio: 0.75,
        FileMainColor:   "blue",
        FileColors:      "266111000",
        FileLuminance:   "DC42844C8",
        FileDiff:        800,
        FileChroma:      26,
        FileError:       "",
        Share:           []FileShare{},
        Sync:            []FileSync{},
        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,
        PhotoID:         1000018,
        PhotoUID:        "pt9jtdre2lvl0y25",
        FileUID:         "ft6es39w45bnlqdw",
        FileName:        "Photo18.jpg",
        FileRoot:        RootOriginals,
        OriginalName:    "Photo18.jpg",
        FileHash:        "acad9168fa6acc5c5c2965ddf6ec465ca42fd820",
        ModTime:         time.Date(2017, 1, 6, 2, 6, 51, 0, time.UTC).Unix(),
        FileSize:        500,
        FileType:        "jpg",
        FileMime:        "image/jpg",
        FilePrimary:     true,
        FileSidecar:     false,
        FileVideo:       false,
        FileMissing:     false,
        FilePortrait:    false,
        FileWidth:       1200,
        FileHeight:      1600,
        FileOrientation: 6,
        FileAspectRatio: 0.75,
        FileMainColor:   "green",
        FileColors:      "266111000",
        FileLuminance:   "DC42844C8",
        FileDiff:        800,
        FileChroma:      0,
        FileError:       "",
        Share:           []FileShare{},
        Sync:            []FileSync{},
        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,
    },
    "Video.mp4": {
        ID:              1000008,
        Photo:           PhotoFixtures.Pointer("Photo10"),
        PhotoID:         PhotoFixtures.Pointer("Photo10").ID,
        PhotoUID:        PhotoFixtures.Pointer("Photo10").PhotoUID,
        FileUID:         "ft71s39w45bnlqdw",
        FileName:        "Video.mp4",
        FileRoot:        RootOriginals,
        OriginalName:    "Video.mp4",
        FileHash:        "acad9168fa6acc5c5c2965ddf6ec465ca42fd831",
        ModTime:         time.Date(2017, 1, 6, 2, 6, 51, 0, time.UTC).Unix(),
        FileSize:        500,
        FileType:        "mp4",
        FileMime:        "video/mp4",
        FilePrimary:     true,
        FileSidecar:     false,
        FileVideo:       true,
        FileMissing:     false,
        FilePortrait:    false,
        FileWidth:       1200,
        FileHeight:      1600,
        FileOrientation: 6,
        FileAspectRatio: 0.75,
        FileMainColor:   "green",
        FileColors:      "266111000",
        FileLuminance:   "DC42844C8",
        FileDiff:        800,
        FileChroma:      0,
        FileError:       "",
        Share:           []FileShare{},
        Sync:            []FileSync{},
        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,
    },
    "VideoWithError.mp4": {
        ID:              1000009,
        Photo:           PhotoFixtures.Pointer("Photo10"),
        PhotoID:         PhotoFixtures.Pointer("Photo10").ID,
        PhotoUID:        PhotoFixtures.Pointer("Photo10").PhotoUID,
        FileUID:         "ft72s39w45bnlqdw",
        FileName:        "VideoError.mp4",
        FileRoot:        RootOriginals,
        OriginalName:    "VideoError.mp4",
        FileHash:        "acad9168fa6acc5c5c2965ddf6ec465ca42fd832",
        ModTime:         time.Date(2017, 1, 6, 2, 6, 51, 0, time.UTC).Unix(),
        FileSize:        500,
        FileType:        "mp4",
        FileMime:        "video/mp4",
        FilePrimary:     false,
        FileSidecar:     false,
        FileVideo:       true,
        FileMissing:     false,
        FilePortrait:    false,
        FileWidth:       1200,
        FileHeight:      1600,
        FileOrientation: 6,
        FileAspectRatio: 0.75,
        FileMainColor:   "green",
        FileColors:      "266111000",
        FileLuminance:   "DC42844C8",
        FileDiff:        800,
        FileChroma:      0,
        FileError:       "Error",
        Share:           []FileShare{},
        Sync:            []FileSync{},
        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,
    },
    "bridge1.jpg": {
        ID:              1000010,
        Photo:           PhotoFixtures.Pointer("Photo02"),
        PhotoID:         PhotoFixtures.Pointer("Photo02").ID,
        PhotoUID:        PhotoFixtures.Pointer("Photo02").PhotoUID,
        FileUID:         "ft2es39q45bnlqd0",
        FileName:        "bridge1.jpg",
        FileRoot:        RootOriginals,
        OriginalName:    "bridgeOriginal1.jpg",
        FileHash:        "pcad9168fa6acc5c5c2965ddf6ec465ca42fd828",
        ModTime:         time.Date(2017, 2, 6, 2, 6, 51, 0, time.UTC).Unix(),
        FileSize:        961851,
        FileType:        "jpg",
        FileMime:        "image/jpg",
        FilePrimary:     true,
        FileSidecar:     false,
        FileVideo:       false,
        FileMissing:     false,
        FilePortrait:    false,
        FileWidth:       1200,
        FileHeight:      1600,
        FileOrientation: 6,
        FileAspectRatio: 0.75,
        FileMainColor:   "magenta",
        FileColors:      "225221C1E",
        FileLuminance:   "DC42844C8",
        FileDiff:        986,
        FileChroma:      32,
        FileError:       "",
        Share:           []FileShare{},
        Sync:            []FileSync{},
        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,
    },
    "bridge2.jpg": {
        ID:              1000011,
        Photo:           PhotoFixtures.Pointer("Photo03"),
        PhotoID:         PhotoFixtures.Pointer("Photo03").ID,
        PhotoUID:        PhotoFixtures.Pointer("Photo03").PhotoUID,
        FileUID:         "ft2es49w15bnlqdw",
        FileName:        "bridge2.jpg",
        FileRoot:        RootOriginals,
        OriginalName:    "bridgeOriginal2.jpg",
        FileHash:        "pcad9168fa6acc5c5c2965adf6ec465ca42fd818",
        ModTime:         time.Date(2017, 2, 6, 2, 6, 51, 0, time.UTC).Unix(),
        FileSize:        921858,
        FileType:        "jpg",
        FileMime:        "image/jpg",
        FilePrimary:     true,
        FileSidecar:     false,
        FileVideo:       false,
        FileMissing:     false,
        FilePortrait:    false,
        FileWidth:       1200,
        FileHeight:      1600,
        FileOrientation: 6,
        FileAspectRatio: 0.75,
        FileMainColor:   "magenta",
        FileColors:      "225221C1E",
        FileLuminance:   "DC42844C8",
        FileDiff:        986,
        FileChroma:      32,
        FileError:       "",
        Share:           []FileShare{},
        Sync:            []FileSync{},
        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,
    },
    "bridge3.jpg": {
        ID:              1000012,
        Photo:           PhotoFixtures.Pointer("Photo03"),
        PhotoID:         PhotoFixtures.Pointer("Photo03").ID,
        PhotoUID:        PhotoFixtures.Pointer("Photo03").PhotoUID,
        FileUID:         "ft2es49whhbnlqdn",
        FileName:        "bridge3.jpg",
        FileRoot:        RootOriginals,
        OriginalName:    "bridgeOriginal.jpg",
        FileHash:        "pcad9168fa6acc5c5ba965adf6ec465ca42fd818",
        ModTime:         time.Date(2017, 2, 6, 2, 6, 51, 0, time.UTC).Unix(),
        FileSize:        921851,
        FileType:        "jpg",
        FileMime:        "image/jpg",
        FilePrimary:     false,
        FileSidecar:     false,
        FileVideo:       false,
        FileMissing:     false,
        FilePortrait:    false,
        FileWidth:       1200,
        FileHeight:      1600,
        FileOrientation: 6,
        FileAspectRatio: 0.75,
        FileMainColor:   "magenta",
        FileColors:      "225221C1E",
        FileLuminance:   "DC42844C8",
        FileDiff:        986,
        FileChroma:      32,
        FileError:       "",
        Share:           []FileShare{},
        Sync:            []FileSync{},
        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,
    },
    "bridge.mp4": {
        ID:              1000013,
        Photo:           PhotoFixtures.Pointer("Photo03"),
        PhotoID:         1000003,
        PhotoUID:        PhotoFixtures.Pointer("Photo03").PhotoUID,
        FileUID:         "ft2es49whhbnlqdy",
        FileName:        "bridge.mp4",
        FileRoot:        RootOriginals,
        OriginalName:    "bridgeOriginal.mp4",
        FileHash:        "pcad9168fa6acc5c5ba965adf6ec465ca42fd819",
        ModTime:         time.Date(2017, 2, 6, 2, 6, 51, 0, time.UTC).Unix(),
        FileSize:        921851,
        FileType:        "mp4",
        FileMime:        "image/mp4",
        FilePrimary:     false,
        FileSidecar:     false,
        FileVideo:       true,
        FileMissing:     false,
        FilePortrait:    false,
        FileWidth:       1200,
        FileHeight:      1600,
        FileOrientation: 6,
        FileAspectRatio: 0.75,
        FileMainColor:   "magenta",
        FileColors:      "225221C1E",
        FileLuminance:   "DC42844C8",
        FileDiff:        986,
        FileChroma:      32,
        FileError:       "",
        Share:           []FileShare{},
        Sync:            []FileSync{},
        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,
    },
}
var FileFixturesExampleBridge = FileFixtures["bridge.jpg"]
var FileFixturesExampleBridgeVideo = FileFixtures["bridge.mp4"]
var FileFixturesExampleJPG = FileFixtures["exampleFileName.jpg"]
var FileFixturesExampleXMP = FileFixtures["exampleXmpFile.xmp"]
var FileShareFixtures = FileShareMap{
    "FileShare1": {
        FileID:     1000000,
        AccountID:  1000000,
        RemoteName: "name for remote",
        Status:     FileShareShared,
        Error:      "",
        Errors:     0,
        File:       nil,
        Account:    &AccountFixtureWebdavDummy,
        CreatedAt:  time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:  time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
    },
    "FileShare2": {
        FileID:     1000000,
        AccountID:  1000001,
        RemoteName: "name for remote",
        Status:     FileShareNew,
        Error:      "",
        Errors:     0,
        File:       nil,
        Account:    &AccountFixtureWebdavDummy2,
        CreatedAt:  time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:  time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
    },
}
var FileSyncFixtures = FileSyncMap{
    "FileSync1": {
        FileID:     1000000,
        AccountID:  1000000,
        RemoteName: "name for remote sync",
        Status:     "test",
        Error:      "",
        Errors:     0,
        File:       &FileFixturesExampleJPG,
        Account:    &AccountFixtureWebdavDummy,
        RemoteDate: time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        RemoteSize: int64(888),
        CreatedAt:  time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:  time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
    },
    "FileSync2": {
        FileID:     1000000,
        AccountID:  1000001,
        RemoteName: "name for remote sync",
        Status:     "test",
        Error:      "",
        Errors:     0,
        File:       &FileFixturesExampleJPG,
        Account:    &AccountFixtureWebdavDummy2,
        RemoteDate: time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        RemoteSize: int64(60),
        CreatedAt:  time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:  time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
    },
    "FileSync3": {
        FileID:     1000000,
        AccountID:  1000000,
        RemoteName: "name for remote sync",
        Status:     "new",
        Error:      "",
        Errors:     0,
        File:       &FileFixturesExampleJPG,
        Account:    &AccountFixtureWebdavDummy,
        RemoteDate: time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        RemoteSize: int64(60),
        CreatedAt:  time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:  time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
    },
}
var FolderFixtures = map[string]Folder{
    "1990": {
        Path:          "1990",
        FolderYear:    1990,
        FolderMonth:   0,
        FolderCountry: "zz",
        CreatedAt:     time.Date(2020, 3, 6, 2, 6, 51, 0, time.UTC),
        UpdatedAt:     time.Date(2020, 3, 28, 14, 6, 0, 0, time.UTC),
        DeletedAt:     nil,
    },
    "1990/04": {
        Path:          "1990/04",
        FolderYear:    1990,
        FolderMonth:   4,
        FolderCountry: "zz",
        CreatedAt:     time.Date(2020, 3, 6, 2, 6, 51, 0, time.UTC),
        UpdatedAt:     time.Date(2020, 3, 28, 14, 6, 0, 0, time.UTC),
        DeletedAt:     nil,
    },
}
var Guest = Person{
    ID:            -2,
    PersonUID:     "u000000000000002",
    UserName:      "",
    DisplayName:   "Guest",
    RoleAdmin:     false,
    RoleGuest:     true,
    UserActive:    false,
    UserConfirmed: false,
}

Guest user without own account for link sharing.

var KeywordFixtures = KeywordMap{
    "bridge": {
        ID:      1000000,
        Keyword: "bridge",
        Skip:    false,
    },
    "beach": {
        ID:      1000001,
        Keyword: "beach",
        Skip:    false,
    },
    "flower": {
        ID:      1000002,
        Keyword: "flower",
        Skip:    false,
    },
}
var LabelFixtures = LabelMap{
    "landscape": {
        ID:               1000000,
        LabelUID:         "lt9k3pw1wowuy3c2",
        LabelSlug:        "landscape",
        CustomSlug:       "landscape",
        LabelName:        "Landscape",
        LabelPriority:    0,
        LabelFavorite:    true,
        LabelDescription: "",
        LabelNotes:       "",
        PhotoCount:       1,
        LabelCategories:  []*Label{},
        CreatedAt:        Timestamp(),
        UpdatedAt:        Timestamp(),
        DeletedAt:        nil,
        New:              false,
    },
    "flower": {
        ID:               1000001,
        LabelUID:         "lt9k3pw1wowuy3c3",
        LabelSlug:        "flower",
        CustomSlug:       "flower",
        LabelName:        "Flower",
        LabelPriority:    1,
        LabelFavorite:    true,
        LabelDescription: "",
        LabelNotes:       "",
        PhotoCount:       2,
        LabelCategories:  []*Label{},
        CreatedAt:        Timestamp(),
        UpdatedAt:        Timestamp(),
        DeletedAt:        nil,
        New:              false,
    },
    "cake": {
        ID:               1000002,
        LabelUID:         "lt9k3pw1wowuy3c4",
        LabelSlug:        "cake",
        CustomSlug:       "kuchen",
        LabelName:        "Cake",
        LabelPriority:    5,
        LabelFavorite:    false,
        LabelDescription: "",
        LabelNotes:       "",
        PhotoCount:       3,
        LabelCategories:  []*Label{},
        CreatedAt:        Timestamp(),
        UpdatedAt:        Timestamp(),
        DeletedAt:        nil,
        New:              false,
    },
    "cow": {
        ID:               1000003,
        LabelUID:         "lt9k3pw1wowuy3c5",
        LabelSlug:        "cow",
        CustomSlug:       "kuh",
        LabelName:        "COW",
        LabelPriority:    -1,
        LabelFavorite:    true,
        LabelDescription: "",
        LabelNotes:       "",
        PhotoCount:       4,
        LabelCategories:  []*Label{},
        CreatedAt:        Timestamp(),
        UpdatedAt:        Timestamp(),
        DeletedAt:        nil,
        New:              false,
    },
    "batchdelete": {
        ID:               1000004,
        LabelUID:         "lt9k3pw1wowuy3c6",
        LabelSlug:        "batchdelete",
        CustomSlug:       "batchDelete",
        LabelName:        "BatchDelete",
        LabelPriority:    1,
        LabelFavorite:    true,
        LabelDescription: "",
        LabelNotes:       "",
        PhotoCount:       5,
        LabelCategories:  []*Label{},
        CreatedAt:        Timestamp(),
        UpdatedAt:        Timestamp(),
        DeletedAt:        nil,
        New:              false,
    },
    "updateLabel": {
        ID:               1000005,
        LabelUID:         "lt9k3pw1wowuy3c7",
        LabelSlug:        "updatelabel",
        CustomSlug:       "updateLabel",
        LabelName:        "updateLabel",
        LabelPriority:    2,
        LabelFavorite:    false,
        LabelDescription: "",
        LabelNotes:       "",
        PhotoCount:       1,
        LabelCategories:  []*Label{},
        CreatedAt:        Timestamp(),
        UpdatedAt:        Timestamp(),
        DeletedAt:        nil,
        New:              false,
    },
    "updatePhotoLabel": {
        ID:               1000006,
        LabelUID:         "lt9k3pw1wowuy3c8",
        LabelSlug:        "updatephotolabel",
        CustomSlug:       "updateLabelPhoto",
        LabelName:        "updatePhotoLabel",
        LabelPriority:    2,
        LabelFavorite:    false,
        LabelDescription: "",
        LabelNotes:       "",
        PhotoCount:       1,
        LabelCategories:  []*Label{},
        CreatedAt:        Timestamp(),
        UpdatedAt:        Timestamp(),
        DeletedAt:        nil,
        New:              false,
    },
    "likeLabel": {
        ID:               1000007,
        LabelUID:         "lt9k3pw1wowuy3c9",
        LabelSlug:        "likeLabel",
        CustomSlug:       "likeLabel",
        LabelName:        "likeLabel",
        LabelPriority:    3,
        LabelFavorite:    false,
        LabelDescription: "",
        LabelNotes:       "",
        PhotoCount:       1,
        LabelCategories:  []*Label{},
        CreatedAt:        Timestamp(),
        UpdatedAt:        Timestamp(),
        DeletedAt:        nil,
        New:              false,
    },
    "no-jpeg": {
        ID:               1000008,
        LabelUID:         "lt9k3aa1wowuy310",
        LabelSlug:        "no-jpeg",
        CustomSlug:       "no-jpeg",
        LabelName:        "NO JPEG",
        LabelPriority:    -1,
        LabelFavorite:    false,
        LabelDescription: "",
        LabelNotes:       "",
        PhotoCount:       4,
        LabelCategories:  []*Label{},
        CreatedAt:        Timestamp(),
        UpdatedAt:        Timestamp(),
        DeletedAt:        nil,
        New:              false,
    },
    "apilikeLabel": {
        ID:               1000009,
        LabelUID:         "lt9k3pw1wowuy311",
        LabelSlug:        "apilikeLabel",
        CustomSlug:       "apilikeLabel",
        LabelName:        "apilikeLabel",
        LabelPriority:    -1,
        LabelFavorite:    false,
        LabelDescription: "",
        LabelNotes:       "",
        PhotoCount:       1,
        LabelCategories:  []*Label{},
        CreatedAt:        Timestamp(),
        UpdatedAt:        Timestamp(),
        DeletedAt:        nil,
        New:              false,
    },
    "apidislikeLabel": {
        ID:               1000010,
        LabelUID:         "lt9k3pw1wowuy312",
        LabelSlug:        "apidislikeLabel",
        CustomSlug:       "apidislikeLabel",
        LabelName:        "apidislikeLabel",
        LabelPriority:    -2,
        LabelFavorite:    true,
        LabelDescription: "",
        LabelNotes:       "",
        PhotoCount:       1,
        LabelCategories:  []*Label{},
        CreatedAt:        Timestamp(),
        UpdatedAt:        Timestamp(),
        DeletedAt:        nil,
        New:              false,
    },
}
var LensFixtures = LensMap{
    "lens-f-380": {
        ID:              1000000,
        LensSlug:        "lens-f-380",
        LensName:        "Apple F380",
        LensMake:        "Apple",
        LensModel:       "F380",
        LensType:        "",
        LensDescription: "",
        LensNotes:       "Notes",
        CreatedAt:       time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:       time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        DeletedAt:       nil,
    },
}
var LinkFixtures = LinkMap{
    "1jxf3jfn2k": {
        LinkUID:     "abcfgty",
        LinkToken:   "1jxf3jfn2k",
        LinkExpires: 0,
        ShareUID:    "st9lxuqxpogaaba7",
        CanComment:  true,
        CanEdit:     false,
        CreatedAt:   time.Date(2020, 3, 6, 2, 6, 51, 0, time.UTC),
    },
    "4jxf3jfn2k": {
        LinkToken:   "4jxf3jfn2k",
        LinkExpires: 0,
        ShareUID:    "at9lxuqxpogaaba7",
        CanComment:  true,
        CanEdit:     false,
        CreatedAt:   time.Date(2020, 3, 6, 2, 6, 51, 0, time.UTC),
    },
    "5jxf3jfn2k": {
        LinkToken:   "5jxf3jfn2k",
        LinkExpires: 0,
        ShareUID:    "ft2es39w45bnlqdw",
        ShareSlug:   "ft2es39w45bnlqdw",
        CanComment:  true,
        CanEdit:     false,
        CreatedAt:   time.Date(2020, 3, 6, 2, 6, 51, 0, time.UTC),
    },
    "6jxf3jfn2k": {
        LinkToken:   "6jxf3jfn2k",
        LinkExpires: 0,
        ShareUID:    "st9lxuqxpogaaba7",
        ShareSlug:   "lt9k3pw1wowuy3c3",
        CanComment:  true,
        CanEdit:     false,
        CreatedAt:   time.Date(2020, 3, 6, 2, 6, 51, 0, time.UTC),
    },
    "7jxf3jfn2k": {
        LinkToken:   "7jxf3jfn2k",
        LinkExpires: 0,
        ShareUID:    "st9lxuqxpogaaba7",
        ShareSlug:   "pt9k3pw1wowuy3c3",
        CanComment:  true,
        CanEdit:     false,
        CreatedAt:   time.Date(2020, 3, 6, 2, 6, 51, 0, time.UTC),
    },
}
var PhotoAlbumFixtures = PhotoAlbumMap{
    "1": {
        PhotoUID:  "pt9jtdre2lvl0yh7",
        AlbumUID:  "at9lxuqxpogaaba8",
        Order:     0,
        CreatedAt: time.Date(2020, 3, 6, 2, 6, 51, 0, time.UTC),
        UpdatedAt: time.Date(2020, 3, 28, 14, 6, 0, 0, time.UTC),
        Photo:     PhotoFixtures.Pointer("19800101_000002_D640C559"),
        Album:     AlbumFixtures.Pointer("holiday-2030"),
    },
    "2": {
        PhotoUID:  "pt9jtdre2lvl0y11",
        AlbumUID:  "at9lxuqxpogaaba9",
        Order:     0,
        CreatedAt: time.Date(2020, 2, 6, 2, 6, 51, 0, time.UTC),
        UpdatedAt: time.Date(2020, 4, 28, 14, 6, 0, 0, time.UTC),
        Photo:     PhotoFixtures.Pointer("Photo04"),
        Album:     AlbumFixtures.Pointer("berlin-2019"),
    },
    "3": {
        PhotoUID:  "pt9jtdre2lvl0yh8",
        AlbumUID:  "at9lxuqxpogaaba9",
        Order:     0,
        CreatedAt: time.Date(2020, 2, 6, 2, 6, 51, 0, time.UTC),
        UpdatedAt: time.Date(2020, 4, 28, 14, 6, 0, 0, time.UTC),
        Photo:     PhotoFixtures.Pointer("Photo01"),
        Album:     AlbumFixtures.Pointer("berlin-2019"),
    },
}
var PhotoFixtures = PhotoMap{
    "19800101_000002_D640C559": {
        ID:               1000000,
        PhotoUID:         "pt9jtdre2lvl0yh7",
        TakenAt:          time.Date(2008, 1, 1, 0, 0, 0, 0, time.UTC),
        TakenAtLocal:     time.Date(2008, 1, 1, 0, 0, 0, 0, time.UTC),
        TakenSrc:         "meta",
        PhotoTitle:       "",
        TitleSrc:         "",
        PhotoDescription: "photo description lake",
        PhotoPath:        "2790/02",
        PhotoName:        "19800101_000002_D640C559",
        PhotoQuality:     4,
        PhotoResolution:  2,
        PhotoFavorite:    false,
        PhotoPrivate:     false,
        PhotoLat:         48.519234,
        PhotoLng:         9.057997,
        PhotoAltitude:    0,
        PhotoIso:         0,
        PhotoFocalLength: 0,
        PhotoFNumber:     5,
        PhotoExposure:    "",
        Camera:           CameraFixtures.Pointer("canon-eos-6d"),
        CameraID:         CameraFixtures.Pointer("canon-eos-6d").ID,
        Lens:             LensFixtures.Pointer("lens-f-380"),
        LensID:           LensFixtures.Pointer("lens-f-380").ID,
        CameraSerial:     "",
        CameraSrc:        "",
        PlaceSrc:         "",
        TimeZone:         "",
        PhotoYear:        2790,
        PhotoMonth:       2,
        Details:          DetailsFixtures.Pointer("lake", 1000000),
        DescriptionSrc:   "",
        CellID:           UnknownLocation.ID,
        Cell:             &UnknownLocation,
        PlaceID:          UnknownPlace.ID,
        Place:            &UnknownPlace,
        PhotoCountry:     UnknownPlace.CountryCode(),
        Keywords: []Keyword{
            KeywordFixtures.Get("bridge"),
        },
        Albums: []Album{
            AlbumFixtures.Get("holiday-2030"),
        },
        Files: []File{},
        Labels: []PhotoLabel{
            LabelFixtures.PhotoLabel(1000000, "flower", 38, "image"),
            LabelFixtures.PhotoLabel(1000000, "cake", 38, "manual"),
        },
        CreatedAt: time.Date(2009, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt: time.Date(2008, 1, 1, 0, 0, 0, 0, time.UTC),
        EditedAt:  nil,
        DeletedAt: nil,
    },
    "Photo01": {
        ID:               1000001,
        PhotoUID:         "pt9jtdre2lvl0yh8",
        TakenAt:          time.Date(2006, 1, 1, 2, 0, 0, 0, time.UTC),
        TakenAtLocal:     time.Date(2006, 1, 1, 2, 0, 0, 0, time.UTC),
        TakenSrc:         "meta",
        PhotoTitle:       "",
        TitleSrc:         "",
        PhotoDescription: "photo description blacklist",
        PhotoPath:        "2790/02",
        PhotoName:        "Photo01",
        PhotoQuality:     3,
        PhotoResolution:  2,
        PhotoFavorite:    true,
        PhotoPrivate:     false,
        PhotoLat:         48.519234,
        PhotoLng:         9.057997,
        PhotoAltitude:    0,
        PhotoIso:         0,
        PhotoFocalLength: 0,
        PhotoFNumber:     0,
        PhotoExposure:    "",
        Camera:           CameraFixtures.Pointer("canon-eos-6d"),
        CameraID:         CameraFixtures.Pointer("canon-eos-6d").ID,
        Lens:             LensFixtures.Pointer("lens-f-380"),
        LensID:           LensFixtures.Pointer("lens-f-380").ID,
        CameraSerial:     "",
        CameraSrc:        "",
        Place:            &UnknownPlace,
        PlaceID:          UnknownPlace.ID,
        Cell:             &UnknownLocation,
        CellID:           UnknownLocation.ID,
        PlaceSrc:         "",
        TimeZone:         "",
        PhotoCountry:     UnknownPlace.CountryCode(),
        PhotoYear:        2790,
        PhotoMonth:       2,
        Details:          DetailsFixtures.Pointer("lake", 1000001),
        DescriptionSrc:   "",
        Keywords:         []Keyword{},
        Albums:           []Album{},
        Files:            []File{},
        Labels: []PhotoLabel{
            LabelFixtures.PhotoLabel(1000001, "no-jpeg", 20, "image"),
        },
        CreatedAt: time.Date(2009, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt: time.Date(2008, 1, 1, 0, 0, 0, 0, time.UTC),
        EditedAt:  nil,
        DeletedAt: nil,
    },
    "Photo02": {
        ID:               1000002,
        PhotoUID:         "pt9jtdre2lvl0yh9",
        TakenAt:          time.Date(2008, 1, 1, 0, 0, 0, 0, time.UTC),
        TakenAtLocal:     time.Date(2008, 1, 1, 0, 0, 0, 0, time.UTC),
        TakenSrc:         "meta",
        PhotoTitle:       "",
        TitleSrc:         "",
        PhotoPath:        "1990/03",
        PhotoName:        "Photo02",
        PhotoQuality:     3,
        PhotoResolution:  2,
        PhotoFavorite:    false,
        PhotoPrivate:     false,
        PhotoLat:         48.519234,
        PhotoLng:         9.057997,
        PhotoAltitude:    0,
        PhotoIso:         0,
        PhotoFocalLength: 0,
        PhotoFNumber:     0,
        PhotoExposure:    "",
        CameraSerial:     "",
        CameraSrc:        "",
        PlaceSrc:         "",
        TimeZone:         "",
        PhotoCountry:     UnknownPlace.CountryCode(),
        PhotoYear:        1990,
        PhotoMonth:       3,
        Details:          DetailsFixtures.Pointer("lake", 1000002),
        DescriptionSrc:   "",
        Camera:           CameraFixtures.Pointer("canon-eos-6d"),
        CameraID:         CameraFixtures.Pointer("canon-eos-6d").ID,
        Lens:             LensFixtures.Pointer("lens-f-380"),
        LensID:           LensFixtures.Pointer("lens-f-380").ID,
        Cell:             &UnknownLocation,
        CellID:           UnknownLocation.ID,
        Place:            &UnknownPlace,
        PlaceID:          UnknownPlace.ID,
        Keywords:         []Keyword{},
        Albums:           []Album{},
        Files:            []File{},
        Labels:           []PhotoLabel{LabelFixtures.PhotoLabel(1000002, "cake", 20, "image")},
        CreatedAt:        time.Date(2009, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:        time.Date(2008, 1, 1, 0, 0, 0, 0, time.UTC),
        EditedAt:         nil,
        DeletedAt:        nil,
    },
    "Photo03": {
        ID:               1000003,
        PhotoUID:         "pt9jtdre2lvl0yh0",
        TakenAt:          time.Date(2008, 1, 1, 1, 0, 0, 0, time.UTC),
        TakenAtLocal:     time.Time{},
        TakenSrc:         "meta",
        PhotoTitle:       "",
        TitleSrc:         "",
        PhotoPath:        "1990/04",
        PhotoName:        "Photo03",
        PhotoQuality:     4,
        PhotoResolution:  2,
        PhotoFavorite:    false,
        PhotoPrivate:     false,
        PhotoType:        "image",
        PhotoLat:         48.519234,
        PhotoLng:         9.057997,
        PhotoAltitude:    0,
        PhotoIso:         0,
        PhotoFocalLength: 0,
        PhotoFNumber:     0,
        PhotoExposure:    "",
        CameraSerial:     "",
        CameraSrc:        "",
        Place:            CellFixtures.Pointer("caravan park").Place,
        PlaceID:          CellFixtures.Pointer("caravan park").Place.ID,
        Cell:             CellFixtures.Pointer("caravan park"),
        CellID:           CellFixtures.Pointer("caravan park").ID,
        PlaceSrc:         "",
        TimeZone:         "",
        PhotoCountry:     CellFixtures.Pointer("caravan park").Place.CountryCode(),
        PhotoYear:        1990,
        PhotoMonth:       4,
        Details:          DetailsFixtures.Pointer("bridge", 1000003),
        DescriptionSrc:   "",
        Camera:           CameraFixtures.Pointer("canon-eos-6d"),
        CameraID:         CameraFixtures.Pointer("canon-eos-6d").ID,
        Lens:             LensFixtures.Pointer("lens-f-380"),
        LensID:           LensFixtures.Pointer("lens-f-380").ID,
        Keywords:         []Keyword{},
        Albums:           []Album{},
        Files:            []File{},
        Labels: []PhotoLabel{
            LabelFixtures.PhotoLabel(1000003, "cow", 20, "image"),
            LabelFixtures.PhotoLabel(1000003, "updatePhotoLabel", 20, "manual"),
            LabelFixtures.PhotoLabel(1000000, "landscape", 10, "location"),
        },
        CreatedAt: time.Date(2009, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt: time.Date(2008, 1, 1, 0, 0, 0, 0, time.UTC),
        EditedAt:  nil,
        DeletedAt: nil,
    },
    "Photo04": {
        ID:               1000004,
        PhotoUID:         "pt9jtdre2lvl0y11",
        TakenAt:          time.Date(2014, 7, 17, 15, 42, 12, 0, time.UTC),
        TakenAtLocal:     time.Date(2014, 7, 17, 15, 42, 12, 0, time.UTC),
        TakenSrc:         "meta",
        PhotoTitle:       "Neckarbrücke",
        TitleSrc:         "",
        PhotoPath:        "2014/07",
        PhotoName:        "Photo04",
        PhotoQuality:     3,
        PhotoResolution:  2,
        PhotoFavorite:    false,
        PhotoPrivate:     false,
        PhotoType:        "image",
        PhotoLat:         48.519234,
        PhotoLng:         9.057997,
        PhotoAltitude:    0,
        PhotoIso:         0,
        PhotoFocalLength: 0,
        PhotoFNumber:     0,
        PhotoExposure:    "",
        CameraSerial:     "",
        CameraSrc:        "",
        Place:            PlaceFixtures.Pointer("mexico"),
        PlaceID:          PlaceFixtures.Pointer("mexico").ID,
        Cell:             CellFixtures.Pointer("mexico"),
        CellID:           CellFixtures.Pointer("mexico").ID,
        PlaceSrc:         "",
        TimeZone:         "",
        PhotoCountry:     PlaceFixtures.Pointer("mexico").CountryCode(),
        PhotoYear:        2014,
        PhotoMonth:       7,
        Details:          DetailsFixtures.Pointer("lake", 1000004),
        DescriptionSrc:   "",
        Camera:           CameraFixtures.Pointer("canon-eos-6d"),
        CameraID:         CameraFixtures.Pointer("canon-eos-6d").ID,
        Lens:             LensFixtures.Pointer("lens-f-380"),
        LensID:           LensFixtures.Pointer("lens-f-380").ID,
        Keywords: []Keyword{
            KeywordFixtures.Get("bridge"),
            KeywordFixtures.Get("flower"),
        },
        Albums: []Album{
            AlbumFixtures.Get("berlin-2019"),
        },
        Files:     []File{},
        Labels:    []PhotoLabel{LabelFixtures.PhotoLabel(1000004, "batchdelete", 20, "image")},
        CreatedAt: time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
        EditedAt:  nil,
        DeletedAt: nil,
    },
    "Photo05": {
        ID:               1000005,
        PhotoUID:         "pt9jtdre2lvl0y12",
        TakenAt:          time.Date(2015, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenAtLocal:     time.Date(2015, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenSrc:         "meta",
        PhotoTitle:       "Reunion",
        TitleSrc:         "",
        PhotoPath:        "2014/07",
        PhotoName:        "Photo05",
        PhotoQuality:     3,
        PhotoResolution:  2,
        PhotoFavorite:    false,
        PhotoPrivate:     true,
        PhotoType:        "image",
        PhotoLat:         -21.342636,
        PhotoLng:         55.466944,
        PhotoAltitude:    0,
        PhotoIso:         0,
        PhotoFocalLength: 0,
        PhotoFNumber:     0,
        PhotoExposure:    "",
        CameraSerial:     "123",
        CameraSrc:        "",
        Cell:             CellFixtures.Pointer("mexico"),
        CellID:           CellFixtures.Pointer("mexico").ID,
        PlaceSrc:         "",
        Place:            PlaceFixtures.Pointer("mexico"),
        PlaceID:          PlaceFixtures.Pointer("mexico").ID,
        TimeZone:         "",
        PhotoCountry:     PlaceFixtures.Pointer("mexico").CountryCode(),
        PhotoYear:        2014,
        PhotoMonth:       7,
        Details:          DetailsFixtures.Pointer("lake", 1000005),
        DescriptionSrc:   "",
        Camera:           CameraFixtures.Pointer("canon-eos-6d"),
        CameraID:         CameraFixtures.Pointer("canon-eos-6d").ID,
        Lens:             LensFixtures.Pointer("lens-f-380"),
        LensID:           LensFixtures.Pointer("lens-f-380").ID,
        Keywords:         []Keyword{},
        Albums:           []Album{},
        Files:            []File{},
        Labels:           []PhotoLabel{LabelFixtures.PhotoLabel(1000005, "updateLabel", 20, "image")},
        CreatedAt:        time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:        time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
        EditedAt:         nil,
        DeletedAt:        nil,
    },
    "Photo06": {
        ID:               1000006,
        PhotoUID:         "pt9jtdre2lvl0y13",
        TakenAt:          time.Date(2016, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenAtLocal:     time.Date(2016, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenSrc:         "meta",
        PhotoTitle:       "ToBeUpdated",
        TitleSrc:         "meta",
        PhotoPath:        "2016/11",
        PhotoName:        "Photo06",
        PhotoQuality:     0,
        PhotoResolution:  2,
        PhotoFavorite:    false,
        PhotoPrivate:     false,
        PhotoType:        "image",
        PhotoLat:         -21.342636,
        PhotoLng:         55.466944,
        PhotoAltitude:    0,
        PhotoIso:         0,
        PhotoFocalLength: 0,
        PhotoFNumber:     0,
        PhotoExposure:    "",
        CameraSerial:     "",
        CameraSrc:        "",
        Cell:             &UnknownLocation,
        CellID:           UnknownLocation.ID,
        PlaceSrc:         "",
        Place:            &UnknownPlace,
        PlaceID:          UnknownPlace.ID,
        TimeZone:         "",
        PhotoCountry:     UnknownPlace.CountryCode(),
        PhotoYear:        2014,
        PhotoMonth:       7,
        Details:          DetailsFixtures.Pointer("lake", 1000006),
        DescriptionSrc:   "",
        Camera:           CameraFixtures.Pointer("canon-eos-6d"),
        CameraID:         CameraFixtures.Pointer("canon-eos-6d").ID,
        Lens:             LensFixtures.Pointer("lens-f-380"),
        LensID:           LensFixtures.Pointer("lens-f-380").ID,
        Keywords:         []Keyword{},
        Albums:           []Album{},
        Files:            []File{},
        Labels:           []PhotoLabel{LabelFixtures.PhotoLabel(1000006, "updatePhotoLabel", 20, "image")},
        CreatedAt:        time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:        time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
        EditedAt:         nil,
        DeletedAt:        nil,
    },
    "Photo07": {
        ID:               1000007,
        PhotoUID:         "pt9jtdre2lvl0y14",
        TakenAt:          time.Date(2016, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenAtLocal:     time.Date(2016, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenSrc:         "",
        PhotoTitle:       "ToBeUpdated",
        TitleSrc:         "meta",
        PhotoPath:        "2016/11",
        PhotoName:        "Photo07",
        PhotoQuality:     0,
        PhotoResolution:  0,
        PhotoFavorite:    false,
        PhotoPrivate:     false,
        PhotoType:        "image",
        PhotoLat:         -21.342636,
        PhotoLng:         55.466944,
        PhotoAltitude:    0,
        PhotoIso:         0,
        PhotoFocalLength: 0,
        PhotoFNumber:     0,
        PhotoExposure:    "",
        CameraSerial:     "",
        CameraSrc:        "",
        Cell:             &UnknownLocation,
        CellID:           UnknownLocation.ID,
        PlaceSrc:         "",
        Place:            &UnknownPlace,
        PlaceID:          UnknownPlace.ID,
        TimeZone:         "",
        PhotoCountry:     UnknownPlace.CountryCode(),
        PhotoYear:        2014,
        PhotoMonth:       7,
        Details:          DetailsFixtures.Pointer("lake", 1000007),
        DescriptionSrc:   "",
        Camera:           CameraFixtures.Pointer("canon-eos-6d"),
        CameraID:         CameraFixtures.Pointer("canon-eos-6d").ID,
        Lens:             LensFixtures.Pointer("lens-f-380"),
        LensID:           LensFixtures.Pointer("lens-f-380").ID,
        Keywords:         []Keyword{},
        Albums:           []Album{},
        Files:            []File{},
        Labels:           []PhotoLabel{LabelFixtures.PhotoLabel(1000007, "landscape", 20, "image")},
        CreatedAt:        time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:        time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
        EditedAt:         &editTime,
        DeletedAt:        nil,
    },
    "Photo08": {
        ID:               1000008,
        PhotoUID:         "pt9jtdre2lvl0y15",
        TakenAt:          time.Date(2016, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenAtLocal:     time.Date(2016, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenSrc:         "",
        PhotoTitle:       "Black beach",
        TitleSrc:         "meta",
        PhotoPath:        "2016/11",
        PhotoName:        "Photo08",
        PhotoQuality:     0,
        PhotoResolution:  0,
        PhotoFavorite:    false,
        PhotoPrivate:     false,
        PhotoType:        "image",
        PhotoLat:         0,
        PhotoLng:         0,
        PhotoAltitude:    0,
        PhotoIso:         0,
        PhotoFocalLength: 0,
        PhotoFNumber:     0,
        PhotoExposure:    "",
        CameraSerial:     "",
        CameraSrc:        "",
        TimeZone:         "",
        PhotoCountry:     PlaceFixtures.Pointer("mexico").CountryCode(),
        PhotoYear:        2014,
        PhotoMonth:       7,
        Details:          DetailsFixtures.Pointer("lake", 1000008),
        DescriptionSrc:   "",
        Camera:           CameraFixtures.Pointer("canon-eos-6d"),
        CameraID:         CameraFixtures.Pointer("canon-eos-6d").ID,
        Lens:             LensFixtures.Pointer("lens-f-380"),
        LensID:           LensFixtures.Pointer("lens-f-380").ID,
        Cell:             CellFixtures.Pointer("mexico"),
        CellID:           CellFixtures.Pointer("mexico").ID,
        PlaceSrc:         "manual",
        Place:            PlaceFixtures.Pointer("mexico"),
        PlaceID:          PlaceFixtures.Pointer("mexico").ID,
        Keywords:         []Keyword{},
        Albums:           []Album{},
        Files:            []File{},
        Labels:           []PhotoLabel{LabelFixtures.PhotoLabel(1000008, "landscape", 20, "image")},
        CreatedAt:        time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:        time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
        EditedAt:         nil,
        DeletedAt:        nil,
    },
    "Photo09": {
        ID:               1000009,
        PhotoUID:         "pt9jtdre2lvl0y16",
        TakenAt:          time.Date(2016, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenAtLocal:     time.Date(2016, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenSrc:         "",
        PhotoTitle:       "Title",
        TitleSrc:         "",
        PhotoPath:        "2016/11",
        PhotoName:        "Photo09",
        PhotoQuality:     0,
        PhotoResolution:  0,
        PhotoFavorite:    false,
        PhotoPrivate:     false,
        PhotoType:        "image",
        PhotoLat:         0,
        PhotoLng:         0,
        PhotoAltitude:    0,
        PhotoIso:         0,
        PhotoFocalLength: 0,
        PhotoFNumber:     0,
        PhotoExposure:    "",
        CameraSerial:     "",
        CameraSrc:        "",
        TimeZone:         "",
        PhotoCountry:     PlaceFixtures.Pointer("mexico").CountryCode(),
        PhotoYear:        2014,
        PhotoMonth:       7,
        Details:          DetailsFixtures.Pointer("lake", 1000009),
        DescriptionSrc:   "",
        Camera:           CameraFixtures.Pointer("canon-eos-6d"),
        CameraID:         CameraFixtures.Pointer("canon-eos-6d").ID,
        Lens:             LensFixtures.Pointer("lens-f-380"),
        LensID:           LensFixtures.Pointer("lens-f-380").ID,
        Cell:             CellFixtures.Pointer("mexico"),
        CellID:           CellFixtures.Pointer("mexico").ID,
        PlaceSrc:         "",
        Place:            PlaceFixtures.Pointer("mexico"),
        PlaceID:          PlaceFixtures.Pointer("mexico").ID,
        Keywords:         []Keyword{},
        Albums:           []Album{},
        Files:            []File{},
        Labels:           []PhotoLabel{LabelFixtures.PhotoLabel(1000008, "landscape", 20, "image")},
        CreatedAt:        time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:        time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
        EditedAt:         nil,
        DeletedAt:        nil,
    },
    "Photo10": {
        ID:               1000010,
        PhotoUID:         "pt9jtdre2lvl0y17",
        TakenAt:          time.Date(2016, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenAtLocal:     time.Date(2016, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenSrc:         "",
        PhotoTitle:       "Title",
        TitleSrc:         "",
        PhotoPath:        "2016/11",
        PhotoName:        "Photo10",
        PhotoQuality:     0,
        PhotoResolution:  0,
        PhotoFavorite:    false,
        PhotoPrivate:     false,
        PhotoType:        "image",
        PhotoLat:         0,
        PhotoLng:         0,
        PhotoAltitude:    0,
        PhotoIso:         0,
        PhotoFocalLength: 0,
        PhotoFNumber:     0,
        PhotoExposure:    "",
        CameraSerial:     "",
        CameraSrc:        "",
        TimeZone:         "",
        PhotoCountry:     PlaceFixtures.Pointer("holidaypark").CountryCode(),
        PhotoYear:        2014,
        PhotoMonth:       7,
        Details:          DetailsFixtures.Pointer("lake", 10000010),
        DescriptionSrc:   "",
        Camera:           CameraFixtures.Pointer("canon-eos-6d"),
        CameraID:         CameraFixtures.Pointer("canon-eos-6d").ID,
        Lens:             LensFixtures.Pointer("lens-f-380"),
        LensID:           LensFixtures.Pointer("lens-f-380").ID,
        Cell:             CellFixtures.Pointer("hassloch"),
        CellID:           CellFixtures.Pointer("hassloch").ID,
        PlaceSrc:         "",
        Place:            PlaceFixtures.Pointer("holidaypark"),
        PlaceID:          PlaceFixtures.Pointer("holidaypark").ID,
        Keywords:         []Keyword{},
        Albums:           []Album{},
        Files:            []File{},
        Labels:           []PhotoLabel{LabelFixtures.PhotoLabel(1000008, "landscape", 20, "image")},
        CreatedAt:        time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:        time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
        EditedAt:         nil,
        DeletedAt:        nil,
    },
    "Photo11": {
        ID:               1000011,
        PhotoUID:         "pt9jtdre2lvl0y18",
        TakenAt:          time.Date(2016, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenAtLocal:     time.Date(2016, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenSrc:         "",
        PhotoTitle:       "Title",
        TitleSrc:         "",
        PhotoPath:        "2016/11",
        PhotoName:        "Photo11",
        PhotoQuality:     0,
        PhotoResolution:  0,
        PhotoFavorite:    false,
        PhotoPrivate:     false,
        PhotoType:        "image",
        PhotoLat:         0,
        PhotoLng:         0,
        PhotoAltitude:    0,
        PhotoIso:         0,
        PhotoFocalLength: 0,
        PhotoFNumber:     0,
        PhotoExposure:    "",
        CameraSerial:     "",
        CameraSrc:        "",
        TimeZone:         "",
        PhotoCountry:     PlaceFixtures.Pointer("emptyNameLongCity").CountryCode(),
        PhotoYear:        2014,
        PhotoMonth:       7,
        Details:          DetailsFixtures.Pointer("lake", 10000011),
        DescriptionSrc:   "",
        Camera:           CameraFixtures.Pointer("canon-eos-6d"),
        CameraID:         CameraFixtures.Pointer("canon-eos-6d").ID,
        Lens:             LensFixtures.Pointer("lens-f-380"),
        LensID:           LensFixtures.Pointer("lens-f-380").ID,
        Cell:             CellFixtures.Pointer("emptyNameLongCity"),
        CellID:           CellFixtures.Pointer("emptyNameLongCity").ID,
        PlaceSrc:         "",
        Place:            PlaceFixtures.Pointer("emptyNameLongCity"),
        PlaceID:          PlaceFixtures.Pointer("emptyNameLongCity").ID,
        Keywords:         []Keyword{},
        Albums:           []Album{},
        Files:            []File{},
        Labels:           []PhotoLabel{LabelFixtures.PhotoLabel(1000008, "landscape", 20, "image")},
        CreatedAt:        time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:        time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
        EditedAt:         nil,
        DeletedAt:        nil,
    },
    "Photo12": {
        ID:               1000012,
        PhotoUID:         "pt9jtdre2lvl0y19",
        TakenAt:          time.Date(2016, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenAtLocal:     time.Date(2016, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenSrc:         "",
        PhotoTitle:       "Title",
        TitleSrc:         "",
        PhotoPath:        "2016/11",
        PhotoName:        "Photo12",
        PhotoQuality:     0,
        PhotoResolution:  0,
        PhotoFavorite:    false,
        PhotoPrivate:     false,
        PhotoType:        "image",
        PhotoLat:         0,
        PhotoLng:         0,
        PhotoAltitude:    0,
        PhotoIso:         0,
        PhotoFocalLength: 0,
        PhotoFNumber:     0,
        PhotoExposure:    "",
        Camera:           CameraFixtures.Pointer("canon-eos-6d"),
        CameraID:         CameraFixtures.Pointer("canon-eos-6d").ID,
        Lens:             LensFixtures.Pointer("lens-f-380"),
        LensID:           LensFixtures.Pointer("lens-f-380").ID,
        CameraSerial:     "",
        CameraSrc:        "",
        Cell:             CellFixtures.Pointer("emptyNameShortCity"),
        CellID:           CellFixtures.Pointer("emptyNameShortCity").ID,
        PlaceSrc:         "",
        Place:            PlaceFixtures.Pointer("emptyNameShortCity"),
        PlaceID:          PlaceFixtures.Pointer("emptyNameShortCity").ID,
        TimeZone:         "",
        PhotoCountry:     PlaceFixtures.Pointer("emptyNameShortCity").CountryCode(),
        PhotoYear:        2014,
        PhotoMonth:       7,
        Details:          &Details{},
        DescriptionSrc:   "",
        Keywords:         []Keyword{},
        Albums:           []Album{},
        Files:            []File{},
        Labels:           []PhotoLabel{LabelFixtures.PhotoLabel(1000008, "landscape", 20, "image")},
        CreatedAt:        time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:        time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
        EditedAt:         nil,
        DeletedAt:        nil,
    },
    "Photo13": {
        ID:               1000013,
        PhotoUID:         "pt9jtdre2lvl0y20",
        TakenAt:          time.Date(2016, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenAtLocal:     time.Date(2016, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenSrc:         "",
        PhotoTitle:       "Title",
        TitleSrc:         "",
        PhotoPath:        "2016/11",
        PhotoName:        "Photo13",
        PhotoQuality:     0,
        PhotoResolution:  0,
        PhotoFavorite:    false,
        PhotoPrivate:     false,
        PhotoType:        "image",
        PhotoLat:         0,
        PhotoLng:         0,
        PhotoAltitude:    0,
        PhotoIso:         0,
        PhotoFocalLength: 0,
        PhotoFNumber:     0,
        PhotoExposure:    "",
        CameraSerial:     "",
        CameraSrc:        "",
        Cell:             CellFixtures.Pointer("veryLongLocName"),
        CellID:           CellFixtures.Pointer("veryLongLocName").ID,
        PlaceSrc:         "",
        Place:            PlaceFixtures.Pointer("veryLongLocName"),
        PlaceID:          PlaceFixtures.Pointer("veryLongLocName").ID,
        TimeZone:         "",
        PhotoCountry:     PlaceFixtures.Pointer("veryLongLocName").CountryCode(),
        PhotoYear:        2014,
        PhotoMonth:       7,
        Details:          &Details{},
        DescriptionSrc:   "",
        Camera:           CameraFixtures.Pointer("canon-eos-6d"),
        CameraID:         CameraFixtures.Pointer("canon-eos-6d").ID,
        Lens:             LensFixtures.Pointer("lens-f-380"),
        LensID:           LensFixtures.Pointer("lens-f-380").ID,
        Keywords:         []Keyword{},
        Albums:           []Album{},
        Files:            []File{},
        Labels:           []PhotoLabel{LabelFixtures.PhotoLabel(1000008, "landscape", 20, "image")},
        CreatedAt:        time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:        time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
        EditedAt:         nil,
        DeletedAt:        nil,
    },
    "Photo14": {
        ID:               1000014,
        PhotoUID:         "pt9jtdre2lvl0y21",
        TakenAt:          time.Date(2016, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenAtLocal:     time.Date(2016, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenSrc:         "",
        PhotoTitle:       "Title",
        TitleSrc:         "",
        PhotoPath:        "2016/11",
        PhotoName:        "Photo14",
        PhotoQuality:     0,
        PhotoResolution:  0,
        PhotoFavorite:    false,
        PhotoPrivate:     false,
        PhotoType:        "image",
        PhotoLat:         0,
        PhotoLng:         0,
        PhotoAltitude:    0,
        PhotoIso:         0,
        PhotoFocalLength: 0,
        PhotoFNumber:     0,
        PhotoExposure:    "",
        CameraSerial:     "",
        CameraSrc:        "",
        TimeZone:         "",
        PhotoCountry:     PlaceFixtures.Pointer("mediumLongLocName").CountryCode(),
        PhotoYear:        2014,
        PhotoMonth:       7,
        Details:          &Details{},
        DescriptionSrc:   "",
        Camera:           CameraFixtures.Pointer("canon-eos-6d"),
        CameraID:         CameraFixtures.Pointer("canon-eos-6d").ID,
        Lens:             LensFixtures.Pointer("lens-f-380"),
        LensID:           LensFixtures.Pointer("lens-f-380").ID,
        Cell:             CellFixtures.Pointer("mediumLongLocName"),
        CellID:           CellFixtures.Pointer("mediumLongLocName").ID,
        PlaceSrc:         "",
        Place:            PlaceFixtures.Pointer("mediumLongLocName"),
        PlaceID:          PlaceFixtures.Pointer("mediumLongLocName").ID,
        Keywords:         []Keyword{},
        Albums:           []Album{},
        Files:            []File{},
        Labels:           []PhotoLabel{LabelFixtures.PhotoLabel(1000014, "landscape", 20, "image")},
        CreatedAt:        time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:        time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
        EditedAt:         nil,
        DeletedAt:        nil,
    },
    "Photo15": {
        ID:               1000015,
        PhotoUID:         "pt9jtdre2lvl0y22",
        TakenAt:          time.Date(2013, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenAtLocal:     time.Date(2013, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenSrc:         "location",
        PhotoTitle:       "TitleToBeSet",
        TitleSrc:         "location",
        PhotoDescription: "photo description blacklist",
        PhotoPath:        "1990",
        PhotoName:        "Photo15",
        PhotoQuality:     0,
        PhotoResolution:  0,
        PhotoFavorite:    false,
        PhotoPrivate:     false,
        PhotoType:        "image",
        PhotoLat:         1.234,
        PhotoLng:         4.321,
        PhotoAltitude:    3,
        PhotoIso:         0,
        PhotoFocalLength: 0,
        PhotoFNumber:     0,
        PhotoExposure:    "",
        CameraSerial:     "",
        CameraSrc:        "",
        Place:            &UnknownPlace,
        Cell:             &UnknownLocation,
        PlaceID:          UnknownPlace.ID,
        CellID:           UnknownLocation.ID,
        PlaceSrc:         "location",
        TimeZone:         "",
        PhotoCountry:     UnknownCountry.ID,
        PhotoYear:        0,
        PhotoMonth:       0,
        Details:          DetailsFixtures.Pointer("blacklist", 1000015),
        DescriptionSrc:   "location",
        Camera:           CameraFixtures.Pointer("canon-eos-6d"),
        CameraID:         CameraFixtures.Pointer("canon-eos-6d").ID,
        Lens:             LensFixtures.Pointer("lens-f-380"),
        LensID:           LensFixtures.Pointer("lens-f-380").ID,
        Keywords:         []Keyword{},
        Albums:           []Album{},
        Files:            []File{},
        Labels:           []PhotoLabel{LabelFixtures.PhotoLabel(10000015, "landscape", 20, "image")},
        CreatedAt:        time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:        time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
        EditedAt:         nil,
        DeletedAt:        nil,
    },
    "Photo16": {
        ID:               1000016,
        PhotoUID:         "pt9jtdre2lvl0y23",
        TakenAt:          time.Date(2013, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenAtLocal:     time.Date(2013, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenSrc:         "",
        PhotoTitle:       "ForDeletion",
        TitleSrc:         "",
        PhotoPath:        "1990",
        PhotoName:        "Photo16",
        PhotoQuality:     0,
        PhotoResolution:  0,
        PhotoFavorite:    false,
        PhotoPrivate:     false,
        PhotoType:        "image",
        PhotoLat:         1.234,
        PhotoLng:         4.321,
        PhotoAltitude:    3,
        PhotoIso:         0,
        PhotoFocalLength: 0,
        PhotoFNumber:     0,
        PhotoExposure:    "",
        Camera:           CameraFixtures.Pointer("canon-eos-6d"),
        CameraID:         CameraFixtures.Pointer("canon-eos-6d").ID,
        Lens:             LensFixtures.Pointer("lens-f-380"),
        LensID:           LensFixtures.Pointer("lens-f-380").ID,
        CameraSerial:     "",
        CameraSrc:        "",
        Place:            &UnknownPlace,
        Cell:             &UnknownLocation,
        PlaceID:          UnknownPlace.ID,
        CellID:           UnknownLocation.ID,
        PlaceSrc:         "location",
        TimeZone:         "",
        PhotoCountry:     UnknownCountry.ID,
        PhotoYear:        0,
        PhotoMonth:       0,
        Details:          DetailsFixtures.Pointer("lake", 1000015),
        DescriptionSrc:   "location",
        Keywords:         []Keyword{},
        Albums:           []Album{},
        Files:            []File{},
        Labels:           []PhotoLabel{LabelFixtures.PhotoLabel(10000015, "landscape", 20, "image")},
        CreatedAt:        time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:        time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
        EditedAt:         nil,
        DeletedAt:        nil,
    },
    "Photo17": {
        ID:               1000017,
        PhotoUID:         "pt9jtdre2lvl0y24",
        TakenAt:          time.Date(2013, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenAtLocal:     time.Date(2013, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenSrc:         "",
        PhotoTitle:       "Quality1FavoriteTrue",
        TitleSrc:         "",
        PhotoPath:        "1990/04",
        PhotoName:        "Photo17",
        PhotoQuality:     0,
        PhotoResolution:  0,
        PhotoFavorite:    true,
        PhotoPrivate:     false,
        PhotoType:        "image",
        PhotoLat:         1.234,
        PhotoLng:         4.321,
        PhotoAltitude:    3,
        PhotoIso:         0,
        PhotoFocalLength: 0,
        PhotoFNumber:     0,
        PhotoExposure:    "",
        CameraSerial:     "",
        CameraSrc:        "",
        Camera:           CameraFixtures.Pointer("canon-eos-6d"),
        CameraID:         CameraFixtures.Pointer("canon-eos-6d").ID,
        Lens:             LensFixtures.Pointer("lens-f-380"),
        LensID:           LensFixtures.Pointer("lens-f-380").ID,
        Cell:             CellFixtures.Pointer("mexico"),
        CellID:           CellFixtures.Pointer("mexico").ID,
        PlaceSrc:         "location",
        Place:            PlaceFixtures.Pointer("mexico"),
        PlaceID:          PlaceFixtures.Pointer("mexico").ID,
        TimeZone:         "",
        PhotoCountry:     PlaceFixtures.Pointer("mexico").CountryCode(),
        PhotoYear:        0,
        PhotoMonth:       0,
        Details:          DetailsFixtures.Pointer("lake", 1000015),
        DescriptionSrc:   "location",
        Keywords:         []Keyword{},
        Albums:           []Album{},
        Files:            []File{},
        Labels: []PhotoLabel{
            LabelFixtures.PhotoLabel(10000015, "landscape", 20, "image"),
            LabelFixtures.PhotoLabel(10000018, "likeLabel", 20, "image")},
        CreatedAt: time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
        EditedAt:  nil,
        DeletedAt: nil,
    },
    "Photo18": {
        ID:               1000018,
        PhotoUID:         "pt9jtdre2lvl0y25",
        TakenAt:          time.Date(2013, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenAtLocal:     time.Date(2013, 11, 11, 9, 7, 18, 0, time.UTC),
        TakenSrc:         "",
        PhotoTitle:       "ArchivedChroma0",
        TitleSrc:         "",
        PhotoPath:        "1990/04",
        PhotoName:        "Photo18",
        PhotoQuality:     0,
        PhotoResolution:  0,
        PhotoFavorite:    true,
        PhotoPrivate:     false,
        PhotoType:        "image",
        PhotoLat:         1.234,
        PhotoLng:         4.321,
        PhotoAltitude:    3,
        PhotoIso:         0,
        PhotoFocalLength: 0,
        PhotoFNumber:     0,
        PhotoExposure:    "",
        CameraSerial:     "",
        CameraSrc:        "",
        Camera:           CameraFixtures.Pointer("canon-eos-6d"),
        CameraID:         CameraFixtures.Pointer("canon-eos-6d").ID,
        Lens:             LensFixtures.Pointer("lens-f-380"),
        LensID:           LensFixtures.Pointer("lens-f-380").ID,
        Cell:             CellFixtures.Pointer("mexico"),
        CellID:           CellFixtures.Pointer("mexico").ID,
        PlaceSrc:         "location",
        Place:            PlaceFixtures.Pointer("mexico"),
        PlaceID:          PlaceFixtures.Pointer("mexico").ID,
        TimeZone:         "",
        PhotoCountry:     PlaceFixtures.Pointer("mexico").CountryCode(),
        PhotoYear:        0,
        PhotoMonth:       0,
        Details:          DetailsFixtures.Pointer("lake", 1000015),
        DescriptionSrc:   "location",
        Keywords:         []Keyword{},
        Albums:           []Album{},
        Files:            []File{},
        Labels: []PhotoLabel{
            LabelFixtures.PhotoLabel(10000018, "landscape", 20, "image"),
            LabelFixtures.PhotoLabel(10000018, "likeLabel", 20, "image")},
        CreatedAt: time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
        EditedAt:  nil,
        DeletedAt: &deleteTime,
    },
    "Photo19": {
        ID:               1000019,
        PhotoUID:         "pt9jtxrexxvl0yh0",
        TakenAt:          time.Date(2008, 1, 1, 0, 0, 0, 0, time.UTC),
        TakenAtLocal:     time.Time{},
        TakenSrc:         "",
        PhotoTitle:       "",
        TitleSrc:         "",
        PhotoPath:        "1990/04",
        PhotoName:        "Photo03",
        PhotoQuality:     1,
        PhotoResolution:  2,
        PhotoFavorite:    false,
        PhotoPrivate:     false,
        PhotoType:        "image",
        PhotoLat:         0,
        PhotoLng:         0,
        PhotoAltitude:    0,
        PhotoIso:         0,
        PhotoFocalLength: 0,
        PhotoFNumber:     0,
        PhotoExposure:    "",
        CameraSerial:     "",
        CameraSrc:        "",
        Place:            &UnknownPlace,
        Cell:             &UnknownLocation,
        PlaceID:          UnknownPlace.ID,
        CellID:           UnknownLocation.ID,
        PlaceSrc:         "",
        TimeZone:         "",
        PhotoCountry:     UnknownPlace.CountryCode(),
        PhotoYear:        1990,
        PhotoMonth:       4,
        Details:          DetailsFixtures.Pointer("bridge", 1000019),
        DescriptionSrc:   "",
        Camera:           CameraFixtures.Pointer("canon-eos-6d"),
        CameraID:         CameraFixtures.Pointer("canon-eos-6d").ID,
        Lens:             LensFixtures.Pointer("lens-f-380"),
        LensID:           LensFixtures.Pointer("lens-f-380").ID,
        Keywords:         []Keyword{},
        Albums:           []Album{},
        Files:            []File{},
        Labels:           []PhotoLabel{},
        CreatedAt:        time.Date(2009, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:        time.Date(2008, 1, 1, 0, 0, 0, 0, time.UTC),
        EditedAt:         nil,
        DeletedAt:        nil,
    },
    "Photo20": {
        ID:               1000020,
        PhotoUID:         "pt9jtxrexxvl0y20",
        TakenAt:          time.Date(2008, 1, 1, 0, 0, 0, 0, time.UTC),
        TakenAtLocal:     time.Time{},
        TakenSrc:         "",
        PhotoTitle:       "",
        TitleSrc:         "",
        PhotoPath:        "1990/04",
        PhotoName:        "Photo03",
        PhotoQuality:     1,
        PhotoResolution:  2,
        PhotoFavorite:    false,
        PhotoPrivate:     false,
        PhotoType:        "image",
        PhotoLat:         0,
        PhotoLng:         0,
        PhotoAltitude:    0,
        PhotoIso:         0,
        PhotoFocalLength: 0,
        PhotoFNumber:     0,
        PhotoExposure:    "",
        CameraSerial:     "",
        CameraSrc:        "",
        Place:            &UnknownPlace,
        Cell:             &UnknownLocation,
        PlaceID:          UnknownPlace.ID,
        CellID:           UnknownLocation.ID,
        PlaceSrc:         "",
        TimeZone:         "",
        PhotoCountry:     UnknownPlace.CountryCode(),
        PhotoYear:        1990,
        PhotoMonth:       4,
        Details:          DetailsFixtures.Pointer("bridge", 1000019),
        DescriptionSrc:   "",
        Camera:           CameraFixtures.Pointer("canon-eos-6d"),
        CameraID:         CameraFixtures.Pointer("canon-eos-6d").ID,
        Lens:             LensFixtures.Pointer("lens-f-380"),
        LensID:           LensFixtures.Pointer("lens-f-380").ID,
        Keywords:         []Keyword{},
        Albums:           []Album{},
        Files:            []File{},
        Labels:           []PhotoLabel{},
        CreatedAt:        time.Date(2009, 1, 1, 0, 0, 0, 0, time.UTC),
        UpdatedAt:        time.Date(2008, 1, 1, 0, 0, 0, 0, time.UTC),
        EditedAt:         nil,
        DeletedAt:        nil,
    },
}
var PhotoKeywordFixtures = PhotoKeywordMap{
    "1": {
        PhotoID:   1000004,
        KeywordID: 1000000,
    },
    "2": {
        PhotoID:   1000001,
        KeywordID: 1000001,
    },
    "3": {
        PhotoID:   1000000,
        KeywordID: 1000000,
    },
    "4": {
        PhotoID:   1000003,
        KeywordID: 1000000,
    },
}
var PlaceFixtures = PlacesMap{
    "mexico": {
        ID:            s2.TokenPrefix + "85d1ea7d3278",
        PlaceLabel:    "Teotihuacán, Mexico, Mexico",
        PlaceCity:     "Teotihuacán",
        PlaceState:    "State of Mexico",
        PlaceCountry:  "mx",
        PlaceKeywords: "ancient, pyramid",
        PlaceFavorite: false,
        PhotoCount:    1,
        CreatedAt:     Timestamp(),
        UpdatedAt:     Timestamp(),
    },
    "zinkwazi": {
        ID:            s2.TokenPrefix + "1ef744d1e279",
        PlaceLabel:    "KwaDukuza, KwaZulu-Natal, South Africa",
        PlaceCity:     "KwaDukuza",
        PlaceState:    "KwaZulu-Natal",
        PlaceCountry:  "za",
        PlaceKeywords: "",
        PlaceFavorite: true,
        PhotoCount:    2,
        CreatedAt:     Timestamp(),
        UpdatedAt:     Timestamp(),
    },
    "holidaypark": {
        ID:            s2.TokenPrefix + "1ef744d1e280",
        PlaceLabel:    "Holiday Park, Amusement",
        PlaceCity:     "",
        PlaceState:    "Rheinland-Pfalz",
        PlaceCountry:  "de",
        PlaceKeywords: "",
        PlaceFavorite: true,
        PhotoCount:    2,
        CreatedAt:     Timestamp(),
        UpdatedAt:     Timestamp(),
    },
    "emptyNameLongCity": {
        ID:            s2.TokenPrefix + "1ef744d1e281",
        PlaceLabel:    "labelEmptyNameLongCity",
        PlaceCity:     "longlonglonglonglongcity",
        PlaceState:    "Rheinland-Pfalz",
        PlaceCountry:  "de",
        PlaceKeywords: "",
        PlaceFavorite: true,
        PhotoCount:    2,
        CreatedAt:     Timestamp(),
        UpdatedAt:     Timestamp(),
    },
    "emptyNameShortCity": {
        ID:            s2.TokenPrefix + "1ef744d1e282",
        PlaceLabel:    "labelEmptyNameShortCity",
        PlaceCity:     "shortcity",
        PlaceState:    "Rheinland-Pfalz",
        PlaceCountry:  "de",
        PlaceKeywords: "",
        PlaceFavorite: true,
        PhotoCount:    2,
        CreatedAt:     Timestamp(),
        UpdatedAt:     Timestamp(),
    },
    "veryLongLocName": {
        ID:            s2.TokenPrefix + "1ef744d1e283",
        PlaceLabel:    "labelVeryLongLocName",
        PlaceCity:     "Mainz",
        PlaceState:    "Rheinland-Pfalz",
        PlaceCountry:  "de",
        PlaceKeywords: "",
        PlaceFavorite: true,
        PhotoCount:    2,
        CreatedAt:     Timestamp(),
        UpdatedAt:     Timestamp(),
    },
    "mediumLongLocName": {
        ID:            s2.TokenPrefix + "1ef744d1e284",
        PlaceLabel:    "labelMediumLongLocName",
        PlaceCity:     "New york",
        PlaceState:    "New york",
        PlaceCountry:  "us",
        PlaceKeywords: "",
        PlaceFavorite: true,
        PhotoCount:    2,
        CreatedAt:     Timestamp(),
        UpdatedAt:     Timestamp(),
    },
}
var QualityBlacklist = map[string]bool{
    "screenshot":  true,
    "screenshots": true,
    "info":        true,
}
var UnknownCamera = Camera{
    CameraSlug:  "zz",
    CameraName:  "Unknown",
    CameraMake:  "",
    CameraModel: "Unknown",
}
var UnknownCountry = Country{
    ID:          "zz",
    CountryName: maps.CountryNames["zz"],
    CountrySlug: "zz",
}

UnknownCountry is defined here to use it as a default

var UnknownLens = Lens{
    LensSlug:  "zz",
    LensName:  "Unknown",
    LensMake:  "",
    LensModel: "Unknown",
}
var UnknownLocation = Cell{
    ID:           "zz",
    Place:        &UnknownPlace,
    PlaceID:      "zz",
    CellName:     "",
    CellCategory: "",
}

UnknownLocation is PhotoPrism's default location.

var UnknownPerson = Person{
    ID:            -1,
    PersonUID:     "u000000000000001",
    UserName:      "",
    DisplayName:   "Anonymous",
    RoleAdmin:     false,
    RoleGuest:     false,
    UserActive:    false,
    UserConfirmed: false,
}

Anonymous, public user without own account.

var UnknownPlace = Place{
    ID:            "zz",
    PlaceLabel:    "Unknown",
    PlaceCity:     "Unknown",
    PlaceState:    "Unknown",
    PlaceCountry:  "zz",
    PlaceKeywords: "",
    PlaceFavorite: false,
    PhotoCount:    -1,
}

UnknownPlace is PhotoPrism's default place.

func AddDuplicate Uses

func AddDuplicate(fileName, fileRoot, fileHash string, fileSize, modTime int64) error

func AddPhotoToAlbums Uses

func AddPhotoToAlbums(photo string, albums []string) (err error)

AddPhotoToAlbums adds a photo UID to multiple albums and automatically creates them if needed.

func CreateAccountFixtures Uses

func CreateAccountFixtures()

CreateLabelFixtures inserts known entities into the database for testing.

func CreateAlbumFixtures Uses

func CreateAlbumFixtures()

CreateAlbumFixtures inserts known entities into the database for testing.

func CreateCameraFixtures Uses

func CreateCameraFixtures()

CreateCameraFixtures inserts known entities into the database for testing.

func CreateCategoryFixtures Uses

func CreateCategoryFixtures()

CreateCategoryFixtures inserts known entities into the database for testing.

func CreateCellFixtures Uses

func CreateCellFixtures()

CreateCellFixtures inserts known entities into the database for testing.

func CreateCountryFixtures Uses

func CreateCountryFixtures()

CreateCountryFixtures inserts known entities into the database for testing.

func CreateDefaultFixtures Uses

func CreateDefaultFixtures()

Creates default database entries for test and production.

func CreateDefaultUsers Uses

func CreateDefaultUsers()

CreateDefaultUsers initializes the database with default user accounts.

func CreateFileFixtures Uses

func CreateFileFixtures()

CreateFileFixtures inserts known entities into the database for testing.

func CreateFileShareFixtures Uses

func CreateFileShareFixtures()

CreateFileShareFixtures inserts known entities into the database for testing.

func CreateFileSyncFixtures Uses

func CreateFileSyncFixtures()

CreateFileSyncFixtures inserts known entities into the database for testing.

func CreateFolderFixtures Uses

func CreateFolderFixtures()

CreateFolderFixtures inserts known entities into the database for testing.

func CreateKeywordFixtures Uses

func CreateKeywordFixtures()

CreateKeywordFixtures inserts known entities into the database for testing.

func CreateLabelFixtures Uses

func CreateLabelFixtures()

CreateLabelFixtures inserts known entities into the database for testing.

func CreateLensFixtures Uses

func CreateLensFixtures()

CreateLensFixtures inserts known entities into the database for testing.

func CreateLinkFixtures Uses

func CreateLinkFixtures()

CreateLinkFixtures inserts known entities into the database for testing.

func CreatePhotoAlbumFixtures Uses

func CreatePhotoAlbumFixtures()

CreatePhotoAlbumFixtures inserts known entities into the database for testing.

func CreatePhotoFixtures Uses

func CreatePhotoFixtures()

CreatePhotoFixtures inserts known entities into the database for testing.

func CreatePhotoKeywordFixtures Uses

func CreatePhotoKeywordFixtures()

CreatePhotoKeywordFixtures inserts known entities into the database for testing.

func CreatePlaceFixtures Uses

func CreatePlaceFixtures()

CreatePlaceFixtures inserts known entities into the database for testing.

func CreateTestFixtures Uses

func CreateTestFixtures()

CreateTestFixtures inserts all known entities into the database for testing.

func CreateUnknownCamera Uses

func CreateUnknownCamera()

CreateUnknownCamera initializes the database with an unknown camera if not exists

func CreateUnknownCountry Uses

func CreateUnknownCountry()

CreateUnknownCountry is used to initialize the database with the default country

func CreateUnknownLens Uses

func CreateUnknownLens()

CreateUnknownLens initializes the database with an unknown lens if not exists

func CreateUnknownLocation Uses

func CreateUnknownLocation()

CreateUnknownLocation creates the default location if not exists.

func CreateUnknownPlace Uses

func CreateUnknownPlace()

CreateUnknownPlace creates the default place if not exists.

func Db Uses

func Db() *gorm.DB

Db returns a database connection.

func DbDialect Uses

func DbDialect() string

DbDialect returns the sql dialect name.

func HasDbProvider Uses

func HasDbProvider() bool

HasDbProvider returns true if a db provider exists.

func IsDialect Uses

func IsDialect(name string) bool

IsDialect returns true if the given sql dialect is used.

func MigrateDb Uses

func MigrateDb()

MigrateDb creates all tables and inserts default entities as needed.

func ResetTestFixtures Uses

func ResetTestFixtures()

ResetTestFixtures drops database tables for all known entities and re-creates them with fixtures.

func SaveErrorMessages Uses

func SaveErrorMessages()

SaveErrorMessages subscribes to error logs and stored them in the errors table.

func SavePhotoForm Uses

func SavePhotoForm(model Photo, form form.Photo, geoApi string) error

SavePhotoForm saves a model in the database using form data.

func Seconds Uses

func Seconds(s int) time.Duration

Seconds converts an int to a duration in seconds.

func SetDbProvider Uses

func SetDbProvider(provider DbProvider)

SetDbProvider sets the provider to get a gorm db connection.

func Timestamp Uses

func Timestamp() time.Time

Timestamp returns the current time in UTC rounded to seconds.

func UnscopedDb Uses

func UnscopedDb() *gorm.DB

UnscopedDb returns an unscoped database connection.

func UpdatePhotoCounts Uses

func UpdatePhotoCounts() error

UpdatePhotoCounts updates photos count in related tables as needed.

type Account Uses

type Account struct {
    ID            uint   `gorm:"primary_key"`
    AccName       string `gorm:"type:varchar(255);"`
    AccOwner      string `gorm:"type:varchar(255);"`
    AccURL        string `gorm:"type:varbinary(512);"`
    AccType       string `gorm:"type:varbinary(255);"`
    AccKey        string `gorm:"type:varbinary(255);"`
    AccUser       string `gorm:"type:varbinary(255);"`
    AccPass       string `gorm:"type:varbinary(255);"`
    AccError      string `gorm:"type:varbinary(512);"`
    AccErrors     int
    AccShare      bool
    AccSync       bool
    RetryLimit    int
    SharePath     string `gorm:"type:varbinary(255);"`
    ShareSize     string `gorm:"type:varbinary(16);"`
    ShareExpires  int
    SyncPath      string `gorm:"type:varbinary(255);"`
    SyncStatus    string `gorm:"type:varbinary(16);"`
    SyncInterval  int
    SyncDate      sql.NullTime `deepcopier:"skip"`
    SyncUpload    bool
    SyncDownload  bool
    SyncFilenames bool
    SyncRaw       bool
    CreatedAt     time.Time  `deepcopier:"skip"`
    UpdatedAt     time.Time  `deepcopier:"skip"`
    DeletedAt     *time.Time `deepcopier:"skip" sql:"index"`
}

Account represents a remote service account for uploading, downloading or syncing media files.

func CreateAccount Uses

func CreateAccount(form form.Account) (model *Account, err error)

CreateAccount creates a new account entity in the database.

func (*Account) Create Uses

func (m *Account) Create() error

Create inserts a new row to the database.

func (*Account) Delete Uses

func (m *Account) Delete() error

Delete deletes the entity from the database.

func (*Account) Directories Uses

func (m *Account) Directories() (result fs.FileInfos, err error)

Directories returns a list of directories or albums in an account.

func (*Account) Save Uses

func (m *Account) Save() error

Save updates the existing or inserts a new row.

func (*Account) SaveForm Uses

func (m *Account) SaveForm(form form.Account) error

Saves the entity using form data and stores it in the database.

func (*Account) Update Uses

func (m *Account) Update(attr string, value interface{}) error

Updates a column in the database.

func (*Account) Updates Uses

func (m *Account) Updates(values interface{}) error

Updates multiple columns in the database.

type AccountMap Uses

type AccountMap map[string]Account

type Accounts Uses

type Accounts []Account

type Album Uses

type Album struct {
    ID               uint       `gorm:"primary_key" json:"ID" yaml:"-"`
    AlbumUID         string     `gorm:"type:varbinary(42);unique_index;" json:"UID" yaml:"UID"`
    CoverUID         string     `gorm:"type:varbinary(42);" json:"CoverUID" yaml:"CoverUID,omitempty"`
    FolderUID        string     `gorm:"type:varbinary(42);index;" json:"FolderUID" yaml:"FolderUID,omitempty"`
    AlbumSlug        string     `gorm:"type:varbinary(255);index;" json:"Slug" yaml:"Slug"`
    AlbumType        string     `gorm:"type:varbinary(8);default:'album';" json:"Type" yaml:"Type,omitempty"`
    AlbumTitle       string     `gorm:"type:varchar(255);" json:"Title" yaml:"Title"`
    AlbumLocation    string     `gorm:"type:varchar(255);" json:"Location" yaml:"Location,omitempty"`
    AlbumCategory    string     `gorm:"type:varchar(255);index;" json:"Category" yaml:"Category,omitempty"`
    AlbumCaption     string     `gorm:"type:text;" json:"Caption" yaml:"Caption,omitempty"`
    AlbumDescription string     `gorm:"type:text;" json:"Description" yaml:"Description,omitempty"`
    AlbumNotes       string     `gorm:"type:text;" json:"Notes" yaml:"Notes,omitempty"`
    AlbumFilter      string     `gorm:"type:varbinary(1024);" json:"Filter" yaml:"Filter,omitempty"`
    AlbumOrder       string     `gorm:"type:varbinary(32);" json:"Order" yaml:"Order,omitempty"`
    AlbumTemplate    string     `gorm:"type:varbinary(255);" json:"Template" yaml:"Template,omitempty"`
    AlbumCountry     string     `gorm:"type:varbinary(2);index:idx_albums_country_year_month;default:'zz'" json:"Country" yaml:"Country,omitempty"`
    AlbumYear        int        `gorm:"index:idx_albums_country_year_month;" json:"Year" yaml:"Year,omitempty"`
    AlbumMonth       int        `gorm:"index:idx_albums_country_year_month;" json:"Month" yaml:"Month,omitempty"`
    AlbumDay         int        `json:"Day" yaml:"Day,omitempty"`
    AlbumFavorite    bool       `json:"Favorite" yaml:"Favorite,omitempty"`
    AlbumPrivate     bool       `json:"Private" yaml:"Private,omitempty"`
    CreatedAt        time.Time  `json:"CreatedAt" yaml:"-"`
    UpdatedAt        time.Time  `json:"UpdatedAt" yaml:"-"`
    DeletedAt        *time.Time `sql:"index" json:"-" yaml:"-"`
}

Album represents a photo album

func FindAlbumBySlug Uses

func FindAlbumBySlug(slug, albumType string) *Album

FindAlbumBySlug finds a matching album or returns nil.

func NewAlbum Uses

func NewAlbum(albumTitle, albumType string) *Album

NewAlbum creates a new album; default name is current month and year

func NewFolderAlbum Uses

func NewFolderAlbum(albumTitle, albumSlug, albumFilter string) *Album

NewFolderAlbum creates a new folder album.

func NewMomentsAlbum Uses

func NewMomentsAlbum(albumTitle, albumSlug, albumFilter string) *Album

NewMomentsAlbum creates a new moment.

func NewMonthAlbum Uses

func NewMonthAlbum(albumTitle, albumSlug string, year, month int) *Album

NewMonthAlbum creates a new month album.

func NewStateAlbum Uses

func NewStateAlbum(albumTitle, albumSlug, albumFilter string) *Album

NewStateAlbum creates a new moment.

func (*Album) AddPhotos Uses

func (m *Album) AddPhotos(UIDs []string) (added []PhotoAlbum)

AddPhotos adds photos to an existing album.

func (*Album) BeforeCreate Uses

func (m *Album) BeforeCreate(scope *gorm.Scope) error

BeforeCreate creates a random UID if needed before inserting a new row to the database.

func (*Album) Create Uses

func (m *Album) Create() error

Create inserts a new row to the database.

func (*Album) Find Uses

func (m *Album) Find() error

Find returns an entity from the database.

func (*Album) IsMoment Uses

func (m *Album) IsMoment() bool

Checks if the album is of type moment.

func (m *Album) Links() Links

Links returns all share links for this entity.

func (*Album) RemovePhotos Uses

func (m *Album) RemovePhotos(UIDs []string) (removed []PhotoAlbum)

RemovePhotos removes photos from an album.

func (*Album) Save Uses

func (m *Album) Save() error

Save updates the existing or inserts a new row.

func (*Album) SaveForm Uses

func (m *Album) SaveForm(f form.Album) error

Saves the entity using form data and stores it in the database.

func (*Album) SetTitle Uses

func (m *Album) SetTitle(title string)

SetTitle changes the album name.

func (*Album) String Uses

func (m *Album) String() string

String returns the id or name as string.

func (*Album) Title Uses

func (m *Album) Title() string

Returns the album title.

func (*Album) Update Uses

func (m *Album) Update(attr string, value interface{}) error

Updates a column in the database.

type AlbumMap Uses

type AlbumMap map[string]Album

func (AlbumMap) Get Uses

func (m AlbumMap) Get(name string) Album

func (AlbumMap) Pointer Uses

func (m AlbumMap) Pointer(name string) *Album

type Albums Uses

type Albums []Album

type Camera Uses

type Camera struct {
    ID                uint       `gorm:"primary_key" json:"ID" yaml:"ID"`
    CameraSlug        string     `gorm:"type:varbinary(255);unique_index;" json:"Slug" yaml:"-"`
    CameraName        string     `gorm:"type:varchar(255);" json:"Name" yaml:"Name"`
    CameraMake        string     `gorm:"type:varchar(255);" json:"Make" yaml:"Make,omitempty"`
    CameraModel       string     `gorm:"type:varchar(255);" json:"Model" yaml:"Model,omitempty"`
    CameraType        string     `gorm:"type:varchar(255);" json:"Type,omitempty" yaml:"Type,omitempty"`
    CameraDescription string     `gorm:"type:text;" json:"Description,omitempty" yaml:"Description,omitempty"`
    CameraNotes       string     `gorm:"type:text;" json:"Notes,omitempty" yaml:"Notes,omitempty"`
    CreatedAt         time.Time  `json:"-" yaml:"-"`
    UpdatedAt         time.Time  `json:"-" yaml:"-"`
    DeletedAt         *time.Time `sql:"index" json:"-" yaml:"-"`
}

Camera model and make (as extracted from UpdateExif metadata)

func FirstOrCreateCamera Uses

func FirstOrCreateCamera(m *Camera) *Camera

FirstOrCreateCamera returns the existing row, inserts a new row or nil in case of errors.

func NewCamera Uses

func NewCamera(modelName string, makeName string) *Camera

NewCamera creates a camera entity from a model name and a make name.

func (*Camera) Create Uses

func (m *Camera) Create() error

Create inserts a new row to the database.

func (*Camera) String Uses

func (m *Camera) String() string

String returns an identifier that can be used in logs.

func (*Camera) Unknown Uses

func (m *Camera) Unknown() bool

Unknown returns true if the camera is not a known make or model.

type CameraMap Uses

type CameraMap map[string]Camera

func (CameraMap) Get Uses

func (m CameraMap) Get(name string) Camera

func (CameraMap) Pointer Uses

func (m CameraMap) Pointer(name string) *Camera

type Category Uses

type Category struct {
    LabelID    uint `gorm:"primary_key;auto_increment:false"`
    CategoryID uint `gorm:"primary_key;auto_increment:false"`
    Label      *Label
    Category   *Label
}

Category of labels regroups labels with the same or a similar meaning using a main/root label

func (Category) TableName Uses

func (Category) TableName() string

TableName returns Category table identifier "categories"

type Cell Uses

type Cell struct {
    ID           string    `gorm:"type:varbinary(42);primary_key;auto_increment:false;" json:"ID" yaml:"ID"`
    CellName     string    `gorm:"type:varchar(255);" json:"Name" yaml:"Name,omitempty"`
    CellCategory string    `gorm:"type:varchar(64);" json:"Category" yaml:"Category,omitempty"`
    PlaceID      string    `gorm:"type:varbinary(42);default:'zz'" json:"-" yaml:"PlaceID"`
    Place        *Place    `gorm:"PRELOAD:true" json:"Place" yaml:"-"`
    CreatedAt    time.Time `json:"CreatedAt" yaml:"-"`
    UpdatedAt    time.Time `json:"UpdatedAt" yaml:"-"`
}

Cell represents a S2 cell with location data.

func FirstOrCreateCell Uses

func FirstOrCreateCell(m *Cell) *Cell

FirstOrCreateCell fetches an existing row, inserts a new row or nil in case of errors.

func NewCell Uses

func NewCell(lat, lng float32) *Cell

NewCell creates a location using a token extracted from coordinate

func (*Cell) Category Uses

func (m *Cell) Category() string

Category returns the location category

func (*Cell) City Uses

func (m *Cell) City() string

City returns the location place city

func (*Cell) CityContains Uses

func (m *Cell) CityContains(text string) bool

CityContains checks if the location city contains the text string

func (*Cell) CountryCode Uses

func (m *Cell) CountryCode() string

CountryCode returns the location place country code

func (*Cell) CountryName Uses

func (m *Cell) CountryName() string

CountryName returns the location place country name

func (*Cell) Create Uses

func (m *Cell) Create() error

Create inserts a new row to the database.

func (*Cell) Find Uses

func (m *Cell) Find(api string) error

Find retrieves location data from the database or an external api if not known already.

func (*Cell) Keywords Uses

func (m *Cell) Keywords() (result []string)

Keywords returns search keywords for a location.

func (*Cell) Label Uses

func (m *Cell) Label() string

Label returns the location place label

func (*Cell) LongCity Uses

func (m *Cell) LongCity() bool

LongCity checks if the city name is more than 16 char

func (*Cell) Name Uses

func (m *Cell) Name() string

Name returns name of location

func (*Cell) NoCategory Uses

func (m *Cell) NoCategory() bool

NoCategory checks id the location has no category

func (*Cell) NoCity Uses

func (m *Cell) NoCity() bool

NoCity checks if the location has no city

func (*Cell) NoName Uses

func (m *Cell) NoName() bool

NoName checks if the location has no name

func (*Cell) NoState Uses

func (m *Cell) NoState() bool

NoState checks if the location place has no state

func (*Cell) State Uses

func (m *Cell) State() string

State returns the location place state

func (*Cell) Unknown Uses

func (m *Cell) Unknown() bool

Unknown checks if the location has no id

type CellMap Uses

type CellMap map[string]Cell

func (CellMap) Get Uses

func (m CellMap) Get(name string) Cell

func (CellMap) Pointer Uses

func (m CellMap) Pointer(name string) *Cell

type Country Uses

type Country struct {
    ID                 string `gorm:"type:varbinary(2);primary_key" json:"ID" yaml:"ID"`
    CountrySlug        string `gorm:"type:varbinary(255);unique_index;" json:"Slug" yaml:"-"`
    CountryName        string `json:"Name" yaml:"Name,omitempty"`
    CountryDescription string `gorm:"type:text;" json:"Description,omitempty" yaml:"Description,omitempty"`
    CountryNotes       string `gorm:"type:text;" json:"Notes,omitempty" yaml:"Notes,omitempty"`
    CountryPhoto       *Photo `json:"-" yaml:"-"`
    CountryPhotoID     uint   `json:"-" yaml:"-"`
    New                bool   `gorm:"-" json:"-" yaml:"-"`
}

Country represents a country location, used for labeling photos.

func FirstOrCreateCountry Uses

func FirstOrCreateCountry(m *Country) *Country

FirstOrCreateCountry returns the existing row, inserts a new row or nil in case of errors.

func NewCountry Uses

func NewCountry(countryCode string, countryName string) *Country

NewCountry creates a new country, with default country code if not provided

func (*Country) AfterCreate Uses

func (m *Country) AfterCreate(scope *gorm.Scope) error

AfterCreate sets the New column used for database callback

func (*Country) Code Uses

func (m *Country) Code() string

Code returns country code

func (*Country) Create Uses

func (m *Country) Create() error

Create inserts a new row to the database.

func (*Country) Name Uses

func (m *Country) Name() string

Name returns country name

func (*Country) Unknown Uses

func (m *Country) Unknown() bool

Unknown returns true if the country is not a known country.

type CountryMap Uses

type CountryMap map[string]Country

type DbProvider Uses

type DbProvider interface {
    Db() *gorm.DB
}

type Details Uses

type Details struct {
    PhotoID   uint      `gorm:"primary_key;auto_increment:false" yaml:"-"`
    Keywords  string    `gorm:"type:text;" json:"Keywords" yaml:"Keywords"`
    Notes     string    `gorm:"type:text;" json:"Notes" yaml:"Notes,omitempty"`
    Subject   string    `gorm:"type:varchar(255);" json:"Subject" yaml:"Subject,omitempty"`
    Artist    string    `gorm:"type:varchar(255);" json:"Artist" yaml:"Artist,omitempty"`
    Copyright string    `gorm:"type:varchar(255);" json:"Copyright" yaml:"Copyright,omitempty"`
    License   string    `gorm:"type:varchar(255);" json:"License" yaml:"License,omitempty"`
    CreatedAt time.Time `yaml:"-"`
    UpdatedAt time.Time `yaml:"-"`
}

Details stores additional metadata fields for each photo to improve search performance.

func FirstOrCreateDetails Uses

func FirstOrCreateDetails(m *Details) *Details

FirstOrCreateDetails returns the existing row, inserts a new row or nil in case of errors.

func NewDetails Uses

func NewDetails(photo Photo) Details

NewDetails creates new photo details.

func (*Details) Create Uses

func (m *Details) Create() error

Create inserts a new row to the database.

func (*Details) NoArtist Uses

func (m *Details) NoArtist() bool

NoArtist checks if the photo has no Artist

func (*Details) NoCopyright Uses

func (m *Details) NoCopyright() bool

NoCopyright checks if the photo has no Copyright

func (*Details) NoKeywords Uses

func (m *Details) NoKeywords() bool

NoKeywords checks if the photo has no Keywords

func (*Details) NoNotes Uses

func (m *Details) NoNotes() bool

NoNotes checks if the photo has no Notes

func (*Details) NoSubject Uses

func (m *Details) NoSubject() bool

NoSubject checks if the photo has no Subject

func (*Details) Save Uses

func (m *Details) Save() error

Save updates existing photo details or inserts a new row.

type DetailsMap Uses

type DetailsMap map[string]Details

func (DetailsMap) Get Uses

func (m DetailsMap) Get(name string, photoId uint) Details

func (DetailsMap) Pointer Uses

func (m DetailsMap) Pointer(name string, photoId uint) *Details

type Duplicate Uses

type Duplicate struct {
    FileName string `gorm:"type:varbinary(768);primary_key;" json:"Name" yaml:"Name"`
    FileRoot string `gorm:"type:varbinary(16);primary_key;default:'/';" json:"Root" yaml:"Root,omitempty"`
    FileHash string `gorm:"type:varbinary(128);default:'';index" json:"Hash" yaml:"Hash,omitempty"`
    FileSize int64  `json:"Size" yaml:"Size,omitempty"`
    ModTime  int64  `json:"ModTime" yaml:"-"`
}

Duplicate represents an exact file duplicate.

func (*Duplicate) Create Uses

func (m *Duplicate) Create() error

Create inserts a new row to the database.

func (*Duplicate) Find Uses

func (m *Duplicate) Find() error

Find returns a photo from the database.

func (*Duplicate) Save Uses

func (m *Duplicate) Save() error

Saves the duplicates in the database.

type Duplicates Uses

type Duplicates []Duplicate

type DuplicatesMap Uses

type DuplicatesMap map[string]Duplicate

type Error Uses

type Error struct {
    ID           uint      `gorm:"primary_key" json:"ID" yaml:"ID"`
    ErrorTime    time.Time `sql:"index" json:"Time" yaml:"Time"`
    ErrorLevel   string    `gorm:"type:varbinary(32)" json:"Level" yaml:"Level"`
    ErrorMessage string    `gorm:"type:varbinary(2048)" json:"Message" yaml:"Message"`
}

Error represents an error message log.

type Errors Uses

type Errors []Error

type File Uses

type File struct {
    ID              uint          `gorm:"primary_key" json:"-" yaml:"-"`
    UUID            string        `gorm:"type:varbinary(42);index;" json:"InstanceID,omitempty" yaml:"InstanceID,omitempty"`
    Photo           *Photo        `json:"-" yaml:"-"`
    PhotoID         uint          `gorm:"index;" json:"-" yaml:"-"`
    PhotoUID        string        `gorm:"type:varbinary(42);index;" json:"PhotoUID" yaml:"PhotoUID"`
    FileUID         string        `gorm:"type:varbinary(42);unique_index;" json:"UID" yaml:"UID"`
    FileName        string        `gorm:"type:varbinary(768);unique_index:idx_files_name_root;" json:"Name" yaml:"Name"`
    FileRoot        string        `gorm:"type:varbinary(16);default:'/';unique_index:idx_files_name_root;" json:"Root" yaml:"Root,omitempty"`
    OriginalName    string        `gorm:"type:varbinary(768);" json:"OriginalName" yaml:"OriginalName,omitempty"`
    FileHash        string        `gorm:"type:varbinary(128);index" json:"Hash" yaml:"Hash,omitempty"`
    FileSize        int64         `json:"Size" yaml:"Size,omitempty"`
    FileCodec       string        `gorm:"type:varbinary(32)" json:"Codec" yaml:"Codec,omitempty"`
    FileType        string        `gorm:"type:varbinary(32)" json:"Type" yaml:"Type,omitempty"`
    FileMime        string        `gorm:"type:varbinary(64)" json:"Mime" yaml:"Mime,omitempty"`
    FilePrimary     bool          `json:"Primary" yaml:"Primary,omitempty"`
    FileSidecar     bool          `json:"Sidecar" yaml:"Sidecar,omitempty"`
    FileMissing     bool          `json:"Missing" yaml:"Missing,omitempty"`
    FilePortrait    bool          `json:"Portrait" yaml:"Portrait,omitempty"`
    FileVideo       bool          `json:"Video" yaml:"Video,omitempty"`
    FileDuration    time.Duration `json:"Duration" yaml:"Duration,omitempty"`
    FileWidth       int           `json:"Width" yaml:"Width,omitempty"`
    FileHeight      int           `json:"Height" yaml:"Height,omitempty"`
    FileOrientation int           `json:"Orientation" yaml:"Orientation,omitempty"`
    FileProjection  string        `gorm:"type:varbinary(16);" json:"Projection,omitempty" yaml:"Projection,omitempty"`
    FileAspectRatio float32       `gorm:"type:FLOAT;" json:"AspectRatio" yaml:"AspectRatio,omitempty"`
    FileMainColor   string        `gorm:"type:varbinary(16);index;" json:"MainColor" yaml:"MainColor,omitempty"`
    FileColors      string        `gorm:"type:varbinary(9);" json:"Colors" yaml:"Colors,omitempty"`
    FileLuminance   string        `gorm:"type:varbinary(9);" json:"Luminance" yaml:"Luminance,omitempty"`
    FileDiff        uint32        `json:"Diff" yaml:"Diff,omitempty"`
    FileChroma      uint8         `json:"Chroma" yaml:"Chroma,omitempty"`
    FileError       string        `gorm:"type:varbinary(512)" json:"Error" yaml:"Error,omitempty"`
    ModTime         int64         `json:"ModTime" yaml:"-"`
    CreatedAt       time.Time     `json:"CreatedAt" yaml:"-"`
    CreatedIn       int64         `json:"CreatedIn" yaml:"-"`
    UpdatedAt       time.Time     `json:"UpdatedAt" yaml:"-"`
    UpdatedIn       int64         `json:"UpdatedIn" yaml:"-"`
    DeletedAt       *time.Time    `sql:"index" json:"DeletedAt,omitempty" yaml:"-"`
    Share           []FileShare   `json:"-" yaml:"-"`
    Sync            []FileSync    `json:"-" yaml:"-"`
}

File represents an image or sidecar file that belongs to a photo.

func FirstFileByHash Uses

func FirstFileByHash(fileHash string) (File, error)

FirstFileByHash gets a file in db from its hash

func PrimaryFile Uses

func PrimaryFile(photoUID string) (File, error)

PrimaryFile returns the primary file for a photo uid.

func (*File) AllFilesMissing Uses

func (m *File) AllFilesMissing() bool

AllFilesMissing returns true, if all files for the photo of this file are missing.

func (*File) BeforeCreate Uses

func (m *File) BeforeCreate(scope *gorm.Scope) error

BeforeCreate creates a random UID if needed before inserting a new row to the database.

func (File) Changed Uses

func (m File) Changed(fileSize int64, modTime time.Time) bool

Changed returns true if new and old file size or modified time are different.

func (*File) Create Uses

func (m *File) Create() error

Create inserts a new row to the database.

func (m *File) Links() Links

Links returns all share links for this entity.

func (*File) NoJPEG Uses

func (m *File) NoJPEG() bool

NoJPEG returns true if the file is not a JPEG image file.

func (*File) Panorama Uses

func (m *File) Panorama() bool

Panorama tests if the file seems to be a panorama image.

func (*File) Purge Uses

func (m *File) Purge() error

Purge removes a file from the index by marking it as missing.

func (*File) RelatedPhoto Uses

func (m *File) RelatedPhoto() *Photo

RelatedPhoto returns the related photo entity.

func (*File) Save Uses

func (m *File) Save() error

Saves the file in the database.

func (*File) ShareFileName Uses

func (m *File) ShareFileName() string

ShareFileName returns a meaningful file name useful for sharing.

func (*File) Update Uses

func (m *File) Update(attr string, value interface{}) error

Updates a column in the database.

func (*File) UpdateVideoInfos Uses

func (m *File) UpdateVideoInfos() error

UpdateVideoInfos updates related video infos based on this file.

type FileInfos Uses

type FileInfos struct {
    FileWidth       int
    FileHeight      int
    FileOrientation int
    FileAspectRatio float32
    FileMainColor   string
    FileColors      string
    FileLuminance   string
    FileDiff        uint32
    FileChroma      uint8
}

type FileShare Uses

type FileShare struct {
    FileID     uint   `gorm:"primary_key;auto_increment:false"`
    AccountID  uint   `gorm:"primary_key;auto_increment:false"`
    RemoteName string `gorm:"primary_key;auto_increment:false;type:varbinary(255)"`
    Status     string `gorm:"type:varbinary(16);"`
    Error      string `gorm:"type:varbinary(512);"`
    Errors     int
    File       *File
    Account    *Account
    CreatedAt  time.Time
    UpdatedAt  time.Time
}

FileShare represents a one-to-many relation between File and Account for pushing files to remote services.

func FirstOrCreateFileShare Uses

func FirstOrCreateFileShare(m *FileShare) *FileShare

FirstOrCreateFileShare returns the existing row, inserts a new row or nil in case of errors.

func NewFileShare Uses

func NewFileShare(fileID, accountID uint, remoteName string) *FileShare

NewFileShare creates a new entity.

func (*FileShare) Create Uses

func (m *FileShare) Create() error

Create inserts a new row to the database.

func (*FileShare) Save Uses

func (m *FileShare) Save() error

Save updates the existing or inserts a new row.

func (FileShare) TableName Uses

func (FileShare) TableName() string

TableName returns the entity database table name.

func (*FileShare) Update Uses

func (m *FileShare) Update(attr string, value interface{}) error

Updates a column in the database.

func (*FileShare) Updates Uses

func (m *FileShare) Updates(values interface{}) error

Updates multiple columns in the database.

type FileShareMap Uses

type FileShareMap map[string]FileShare

func (FileShareMap) Get Uses

func (m FileShareMap) Get(name string, fileID, accountID uint, remoteName string) FileShare

func (FileShareMap) Pointer Uses

func (m FileShareMap) Pointer(name string, fileID, accountID uint, remoteName string) *FileShare

type FileSync Uses

type FileSync struct {
    RemoteName string `gorm:"primary_key;auto_increment:false;type:varbinary(255)"`
    AccountID  uint   `gorm:"primary_key;auto_increment:false"`
    FileID     uint   `gorm:"index;"`
    RemoteDate time.Time
    RemoteSize int64
    Status     string `gorm:"type:varbinary(16);"`
    Error      string `gorm:"type:varbinary(512);"`
    Errors     int
    File       *File
    Account    *Account
    CreatedAt  time.Time
    UpdatedAt  time.Time
}

FileSync represents a one-to-many relation between File and Account for syncing with remote services.

func FirstOrCreateFileSync Uses

func FirstOrCreateFileSync(m *FileSync) *FileSync

FirstOrCreateFileSync returns the existing row, inserts a new row or nil in case of errors.

func NewFileSync Uses

func NewFileSync(accountID uint, remoteName string) *FileSync

NewFileSync creates a new entity.

func (*FileSync) Create Uses

func (m *FileSync) Create() error

Create inserts a new row to the database.

func (*FileSync) Save Uses

func (m *FileSync) Save() error

Save updates the existing or inserts a new row.

func (FileSync) TableName Uses

func (FileSync) TableName() string

TableName returns the entity database table name.

func (*FileSync) Update Uses

func (m *FileSync) Update(attr string, value interface{}) error

Updates a column in the database.

func (*FileSync) Updates Uses

func (m *FileSync) Updates(values interface{}) error

Updates multiple columns in the database.

type FileSyncMap Uses

type FileSyncMap map[string]FileSync

func (FileSyncMap) Get Uses

func (m FileSyncMap) Get(name string, accountID uint, remoteName string) FileSync

func (FileSyncMap) Pointer Uses

func (m FileSyncMap) Pointer(name string, accountID uint, remoteName string) *FileSync

type Files Uses

type Files []File

type Folder Uses

type Folder struct {
    Path              string     `gorm:"type:varbinary(255);unique_index:idx_folders_path_root;" json:"Path" yaml:"Path"`
    Root              string     `gorm:"type:varbinary(16);default:'';unique_index:idx_folders_path_root;" json:"Root" yaml:"Root,omitempty"`
    FolderUID         string     `gorm:"type:varbinary(42);primary_key;" json:"UID,omitempty" yaml:"UID,omitempty"`
    FolderType        string     `gorm:"type:varbinary(16);" json:"Type" yaml:"Type,omitempty"`
    FolderTitle       string     `gorm:"type:varchar(255);" json:"Title" yaml:"Title,omitempty"`
    FolderCategory    string     `gorm:"type:varchar(255);index;" json:"Category" yaml:"Category,omitempty"`
    FolderDescription string     `gorm:"type:text;" json:"Description,omitempty" yaml:"Description,omitempty"`
    FolderOrder       string     `gorm:"type:varbinary(32);" json:"Order" yaml:"Order,omitempty"`
    FolderCountry     string     `gorm:"type:varbinary(2);index:idx_folders_country_year_month;default:'zz'" json:"Country" yaml:"Country,omitempty"`
    FolderYear        int        `gorm:"index:idx_folders_country_year_month;" json:"Year" yaml:"Year,omitempty"`
    FolderMonth       int        `gorm:"index:idx_folders_country_year_month;" json:"Month" yaml:"Month,omitempty"`
    FolderDay         int        `json:"Day" yaml:"Day,omitempty"`
    FolderFavorite    bool       `json:"Favorite" yaml:"Favorite,omitempty"`
    FolderPrivate     bool       `json:"Private" yaml:"Private,omitempty"`
    FolderIgnore      bool       `json:"Ignore" yaml:"Ignore,omitempty"`
    FolderWatch       bool       `json:"Watch" yaml:"Watch,omitempty"`
    FileCount         int        `gorm:"-" json:"FileCount" yaml:"-"`
    CreatedAt         time.Time  `json:"-" yaml:"-"`
    UpdatedAt         time.Time  `json:"-" yaml:"-"`
    ModifiedAt        *time.Time `json:"ModifiedAt,omitempty" yaml:"-"`
    DeletedAt         *time.Time `sql:"index" json:"-"`
}

Folder represents a file system directory.

func FindFolder Uses

func FindFolder(root, pathName string) *Folder

FindFolder returns an existing row if exists.

func FirstOrCreateFolder Uses

func FirstOrCreateFolder(m *Folder) *Folder

FirstOrCreateFolder returns the existing row, inserts a new row or nil in case of errors.

func NewFolder Uses

func NewFolder(root, pathName string, modTime *time.Time) Folder

NewFolder creates a new file system directory entity.

func (*Folder) BeforeCreate Uses

func (m *Folder) BeforeCreate(scope *gorm.Scope) error

BeforeCreate creates a random UID if needed before inserting a new row to the database.

func (*Folder) Create Uses

func (m *Folder) Create() error

Saves the complete entity in the database.

func (*Folder) SetForm Uses

func (m *Folder) SetForm(f form.Folder) error

SetForm updates the entity properties based on form values.

func (*Folder) SetValuesFromPath Uses

func (m *Folder) SetValuesFromPath()

SetValuesFromPath updates the title and other values based on the path name.

func (*Folder) Slug Uses

func (m *Folder) Slug() string

Slug returns a slug based on the folder title.

func (*Folder) Title Uses

func (m *Folder) Title() string

Title returns a human readable folder title.

func (*Folder) Updates Uses

func (m *Folder) Updates(values interface{}) error

Updates selected properties in the database.

type Folders Uses

type Folders []Folder

type Gorm Uses

type Gorm struct {
    Driver string
    Dsn    string
    // contains filtered or unexported fields
}

func InitTestDb Uses

func InitTestDb(driver, dsn string) *Gorm

InitTestDb connects to and completely initializes the test database incl fixtures.

func (*Gorm) Close Uses

func (g *Gorm) Close()

Close closes the gorm db connection.

func (*Gorm) Connect Uses

func (g *Gorm) Connect()

Connect creates a new gorm db connection.

func (*Gorm) Db Uses

func (g *Gorm) Db() *gorm.DB

Db returns the gorm db connection.

type Keyword Uses

type Keyword struct {
    ID      uint   `gorm:"primary_key"`
    Keyword string `gorm:"type:varchar(64);index;"`
    Skip    bool
}

Keyword used for full text search

func FirstOrCreateKeyword Uses

func FirstOrCreateKeyword(m *Keyword) *Keyword

FirstOrCreateKeyword returns the existing row, inserts a new row or nil in case of errors.

func NewKeyword Uses

func NewKeyword(keyword string) *Keyword

NewKeyword registers a new keyword in database

func (*Keyword) Create Uses

func (m *Keyword) Create() error

Create inserts a new row to the database.

func (*Keyword) Save Uses

func (m *Keyword) Save() error

Save updates the existing or inserts a new row.

func (*Keyword) Update Uses

func (m *Keyword) Update(attr string, value interface{}) error

Updates a column in the database.

func (*Keyword) Updates Uses

func (m *Keyword) Updates(values interface{}) error

Updates multiple columns in the database.

type KeywordMap Uses

type KeywordMap map[string]Keyword

func (KeywordMap) Get Uses

func (m KeywordMap) Get(name string) Keyword

func (KeywordMap) Pointer Uses

func (m KeywordMap) Pointer(name string) *Keyword

type Label Uses

type Label struct {
    ID               uint       `gorm:"primary_key" json:"ID" yaml:"-"`
    LabelUID         string     `gorm:"type:varbinary(42);unique_index;" json:"UID" yaml:"UID"`
    LabelSlug        string     `gorm:"type:varbinary(255);unique_index;" json:"Slug" yaml:"-"`
    CustomSlug       string     `gorm:"type:varbinary(255);index;" json:"CustomSlug" yaml:"-"`
    LabelName        string     `gorm:"type:varchar(255);" json:"Name" yaml:"Name"`
    LabelPriority    int        `gorm:"type:varchar(255);" json:"Priority" yaml:"Priority,omitempty"`
    LabelFavorite    bool       `gorm:"type:varchar(255);" json:"Favorite" yaml:"Favorite,omitempty"`
    LabelDescription string     `gorm:"type:text;" json:"Description" yaml:"Description,omitempty"`
    LabelNotes       string     `gorm:"type:text;" json:"Notes" yaml:"Notes,omitempty"`
    LabelCategories  []*Label   `gorm:"many2many:categories;association_jointable_foreignkey:category_id" json:"-" yaml:"-"`
    PhotoCount       int        `gorm:"default:1" json:"PhotoCount" yaml:"-"`
    CreatedAt        time.Time  `json:"CreatedAt" yaml:"-"`
    UpdatedAt        time.Time  `json:"UpdatedAt" yaml:"-"`
    DeletedAt        *time.Time `sql:"index" json:"DeletedAt,omitempty" yaml:"-"`
    New              bool       `gorm:"-" json:"-" yaml:"-"`
}

Label is used for photo, album and location categorization

func FindLabel Uses

func FindLabel(s string) *Label

FindLabel returns an existing row if exists.

func FirstOrCreateLabel Uses

func FirstOrCreateLabel(m *Label) *Label

FirstOrCreateLabel returns the existing label, inserts a new label or nil in case of errors.

func NewLabel Uses

func NewLabel(name string, priority int) *Label

NewLabel returns a new label.

func (*Label) AfterCreate Uses

func (m *Label) AfterCreate(scope *gorm.Scope) error

AfterCreate sets the New column used for database callback

func (*Label) BeforeCreate Uses

func (m *Label) BeforeCreate(scope *gorm.Scope) error

BeforeCreate creates a random UID if needed before inserting a new row to the database.

func (*Label) Create Uses

func (m *Label) Create() error

Create inserts the label to the database.

func (*Label) Delete Uses

func (m *Label) Delete() error

Delete removes the label from the database.

func (*Label) Deleted Uses

func (m *Label) Deleted() bool

Deleted returns true if the label is deleted.

func (m *Label) Links() Links

Links returns all share links for this entity.

func (*Label) Restore Uses

func (m *Label) Restore() error

Delete removes the label from the database.

func (*Label) Save Uses

func (m *Label) Save() error

Save updates the existing or inserts a new label.

func (*Label) SetName Uses

func (m *Label) SetName(name string)

SetName changes the label name.

func (*Label) Update Uses

func (m *Label) Update(attr string, value interface{}) error

Updates a label property in the database.

func (*Label) UpdateClassify Uses

func (m *Label) UpdateClassify(label classify.Label) error

Updates a label if necessary

type LabelMap Uses

type LabelMap map[string]Label

func (LabelMap) Get Uses

func (m LabelMap) Get(name string) Label

func (LabelMap) PhotoLabel Uses

func (m LabelMap) PhotoLabel(photoId uint, labelName string, uncertainty int, source string) PhotoLabel

func (LabelMap) Pointer Uses

func (m LabelMap) Pointer(name string) *Label

type LabelPhotoCount Uses

type LabelPhotoCount struct {
    LabelID    int
    PhotoCount int
}

type LabelPhotoCounts Uses

type LabelPhotoCounts []LabelPhotoCount

func LabelCounts Uses

func LabelCounts() LabelPhotoCounts

type Labels Uses

type Labels []Label

type Lens Uses

type Lens struct {
    ID              uint       `gorm:"primary_key" json:"ID" yaml:"ID"`
    LensSlug        string     `gorm:"type:varbinary(255);unique_index;" json:"Slug" yaml:"Slug,omitempty"`
    LensName        string     `gorm:"type:varchar(255);" json:"Name" yaml:"Name"`
    LensMake        string     `json:"Make" yaml:"Make,omitempty"`
    LensModel       string     `json:"Model" yaml:"Model,omitempty"`
    LensType        string     `json:"Type" yaml:"Type,omitempty"`
    LensDescription string     `gorm:"type:text;" json:"Description,omitempty" yaml:"Description,omitempty"`
    LensNotes       string     `gorm:"type:text;" json:"Notes,omitempty" yaml:"Notes,omitempty"`
    CreatedAt       time.Time  `json:"-" yaml:"-"`
    UpdatedAt       time.Time  `json:"-" yaml:"-"`
    DeletedAt       *time.Time `sql:"index" json:"-" yaml:"-"`
}

Lens represents camera lens (as extracted from UpdateExif metadata)

func FirstOrCreateLens Uses

func FirstOrCreateLens(m *Lens) *Lens

FirstOrCreateLens returns the existing row, inserts a new row or nil in case of errors.

func NewLens Uses

func NewLens(modelName string, makeName string) *Lens

NewLens creates a new lens in database

func (*Lens) Create Uses

func (m *Lens) Create() error

Create inserts a new row to the database.

func (*Lens) String Uses

func (m *Lens) String() string

String returns an identifier that can be used in logs.

func (Lens) TableName Uses

func (Lens) TableName() string

TableName returns Lens table identifier "lens"

func (*Lens) Unknown Uses

func (m *Lens) Unknown() bool

Unknown returns true if the lens is not a known make or model.

type LensMap Uses

type LensMap map[string]Lens

func (LensMap) Get Uses

func (m LensMap) Get(name string) Lens

func (LensMap) Pointer Uses

func (m LensMap) Pointer(name string) *Lens
type Link struct {
    LinkUID     string    `gorm:"type:varbinary(42);primary_key;" json:"UID,omitempty" yaml:"UID,omitempty"`
    ShareUID    string    `gorm:"type:varbinary(42);unique_index:idx_links_uid_token;" json:"Share" yaml:"Share"`
    ShareSlug   string    `gorm:"type:varbinary(255);index;" json:"Slug" yaml:"Slug,omitempty"`
    LinkToken   string    `gorm:"type:varbinary(255);unique_index:idx_links_uid_token;" json:"Token" yaml:"Token,omitempty"`
    LinkExpires int       `json:"Expires" yaml:"Expires,omitempty"`
    LinkViews   uint      `json:"Views" yaml:"-"`
    MaxViews    uint      `json:"MaxViews" yaml:"-"`
    HasPassword bool      `json:"HasPassword" yaml:"HasPassword,omitempty"`
    CanComment  bool      `json:"CanComment" yaml:"CanComment,omitempty"`
    CanEdit     bool      `json:"CanEdit" yaml:"CanEdit,omitempty"`
    CreatedAt   time.Time `deepcopier:"skip" json:"CreatedAt" yaml:"CreatedAt"`
    ModifiedAt  time.Time `deepcopier:"skip" yaml:"ModifiedAt"`
}

Link represents a sharing link.

func FindLink(linkUID string) *Link

FindLink returns an entity pointer if exists.

func NewLink(shareUID string, canComment, canEdit bool) Link

NewLink creates a sharing link.

func (*Link) BeforeCreate Uses

func (m *Link) BeforeCreate(scope *gorm.Scope) error

BeforeCreate creates a random UID if needed before inserting a new row to the database.

func (*Link) Delete Uses

func (m *Link) Delete() error

Deletes the link.

func (*Link) Expired Uses

func (m *Link) Expired() bool

func (*Link) InvalidPassword Uses

func (m *Link) InvalidPassword(password string) bool

func (*Link) Redeem Uses

func (m *Link) Redeem()

func (*Link) Save Uses

func (m *Link) Save() error

Save inserts a new row to the database or updates a row if the primary key already exists.

func (*Link) SetPassword Uses

func (m *Link) SetPassword(password string) error

func (*Link) SetSlug Uses

func (m *Link) SetSlug(s string)

func (*Link) String Uses

func (m *Link) String() string

String returns an human readable identifier for logging.

type LinkMap Uses

type LinkMap map[string]Link
type Links []Link
func FindLinks(token, share string) (result Links)

FindLinks returns a slice of links for a token and share UID (at least one must be provided).

func FindValidLinks(token, share string) (result Links)

FindValidLinks returns a slice of non-expired links for a token and share UID (at least one must be provided).

type Password Uses

type Password struct {
    UID       string    `gorm:"type:varbinary(255);primary_key;" json:"UID"`
    Hash      string    `deepcopier:"skip" gorm:"type:varbinary(255);" json:"Hash"`
    CreatedAt time.Time `deepcopier:"skip" json:"CreatedAt"`
    UpdatedAt time.Time `deepcopier:"skip" json:"UpdatedAt"`
}

Password represents a password hash.

func FindPassword Uses

func FindPassword(uid string) *Password

FindPassword returns an entity pointer if exists.

func NewPassword Uses

func NewPassword(uid, password string) Password

NewPassword creates a new password instance.

func (*Password) Create Uses

func (m *Password) Create() error

Create inserts a new row to the database.

func (*Password) InvalidPassword Uses

func (m *Password) InvalidPassword(password string) bool

InvalidPassword returns true if the given password does not match the hash.

func (*Password) Save Uses

func (m *Password) Save() error

Save inserts a new row to the database or updates a row if the primary key already exists.

func (*Password) SetPassword Uses

func (m *Password) SetPassword(password string) error

SetPassword sets a new password stored as hash.

func (*Password) String Uses

func (m *Password) String() string

String returns the password hash.

func (*Password) Unknown Uses

func (m *Password) Unknown() bool

Unknown returns true if the password is an empty string.

type People Uses

type People []Person

type Person Uses

type Person struct {
    ID            int        `gorm:"primary_key" json:"ID" yaml:"-"`
    PersonUID     string     `gorm:"type:varbinary(42);unique_index;" json:"UID" yaml:"UID"`
    UserName      string     `gorm:"type:varchar(32);" json:"UserName" yaml:"UserName,omitempty"`
    FirstName     string     `gorm:"type:varchar(32);" json:"FirstName" yaml:"FirstName,omitempty"`
    LastName      string     `gorm:"type:varchar(32);" json:"LastName" yaml:"LastName,omitempty"`
    DisplayName   string     `gorm:"type:varchar(64);" json:"DisplayName" yaml:"DisplayName,omitempty"`
    UserEmail     string     `gorm:"type:varchar(255);" json:"Email" yaml:"Email,omitempty"`
    UserInfo      string     `gorm:"type:text;" json:"Info" yaml:"Info,omitempty"`
    UserPath      string     `json:"UserPath" yaml:"UserPath,omitempty"`
    UserActive    bool       `json:"Active" yaml:"Active,omitempty"`
    UserConfirmed bool       `json:"Confirmed" yaml:"Confirmed,omitempty"`
    RoleAdmin     bool       `json:"Admin" yaml:"Admin,omitempty"`
    RoleGuest     bool       `json:"Guest" yaml:"Guest,omitempty"`
    RoleChild     bool       `json:"Child" yaml:"Child,omitempty"`
    RoleFamily    bool       `json:"Family" yaml:"Family,omitempty"`
    RoleFriend    bool       `json:"Friend" yaml:"Friend,omitempty"`
    IsArtist      bool       `json:"Artist" yaml:"Artist,omitempty"`
    IsSubject     bool       `json:"Subject" yaml:"Subject,omitempty"`
    CanEdit       bool       `json:"CanEdit" yaml:"CanEdit,omitempty"`
    CanComment    bool       `json:"CanComment" yaml:"CanComment,omitempty"`
    CanUpload     bool       `json:"CanUpload" yaml:"CanUpload,omitempty"`
    CanDownload   bool       `json:"CanDownload" yaml:"CanDownload,omitempty"`
    WebDAV        bool       `gorm:"column:webdav" json:"WebDAV" yaml:"WebDAV,omitempty"`
    ApiToken      string     `json:"ApiToken" yaml:"ApiToken,omitempty"`
    BirthYear     int        `json:"BirthYear" yaml:"BirthYear,omitempty"`
    BirthMonth    int        `json:"BirthMonth" yaml:"BirthMonth,omitempty"`
    BirthDay      int        `json:"BirthDay" yaml:"BirthDay,omitempty"`
    LoginAttempts int        `json:"-" yaml:"-,omitempty"`
    LoginAt       *time.Time `json:"-" yaml:"-"`
    CreatedAt     time.Time  `json:"CreatedAt" yaml:"-"`
    UpdatedAt     time.Time  `json:"UpdatedAt" yaml:"-"`
    DeletedAt     *time.Time `sql:"index" json:"DeletedAt,omitempty" yaml:"-"`
}

Person represents a real person that can also be a user if a password is set.

func FindPersonByUID Uses

func FindPersonByUID(uid string) *Person

FindPersonByUID returns an existing user or nil if not found.

func FindPersonByUserName Uses

func FindPersonByUserName(userName string) *Person

FindPersonByUserName returns an existing user or nil if not found.

func FirstOrCreatePerson Uses

func FirstOrCreatePerson(m *Person) *Person

FirstOrCreatePerson returns an existing row, inserts a new row or nil in case of errors.

func (*Person) Admin Uses

func (m *Person) Admin() bool

Admin returns true if the person is an admin with user name.

func (*Person) Anonymous Uses

func (m *Person) Anonymous() bool

Anonymous returns true if the person is unknown.

func (*Person) BeforeCreate Uses

func (m *Person) BeforeCreate(scope *gorm.Scope) error

BeforeCreate creates a random UID if needed before inserting a new row to the database.

func (*Person) Create Uses

func (m *Person) Create() error

Create inserts a new row to the database.

func (*Person) Guest Uses

func (m *Person) Guest() bool

Guest returns true if the person is a guest.

func (*Person) InitPassword Uses

func (m *Person) InitPassword(password string)

InitPassword sets the initial user password stored as hash.

func (*Person) InvalidPassword Uses

func (m *Person) InvalidPassword(password string) bool

InvalidPassword returns true if the given password does not match the hash.

func (*Person) Registered Uses

func (m *Person) Registered() bool

User returns true if the person has a user name.

func (*Person) Role Uses

func (m *Person) Role() acl.Role

Role returns the user role for ACL permission checks.

func (*Person) Save Uses

func (m *Person) Save() error

Saves the new row to the database.

func (*Person) SetPassword Uses

func (m *Person) SetPassword(password string) error

SetPassword sets a new password stored as hash.

func (*Person) String Uses

func (m *Person) String() string

String returns an identifier that can be used in logs.

type Photo Uses

type Photo struct {
    ID               uint         `gorm:"primary_key" yaml:"-"`
    UUID             string       `gorm:"type:varbinary(42);index;" json:"DocumentID,omitempty" yaml:"DocumentID,omitempty"`
    TakenAt          time.Time    `gorm:"type:datetime;index:idx_photos_taken_uid;" json:"TakenAt" yaml:"TakenAt"`
    TakenAtLocal     time.Time    `gorm:"type:datetime;" yaml:"-"`
    TakenSrc         string       `gorm:"type:varbinary(8);" json:"TakenSrc" yaml:"TakenSrc,omitempty"`
    PhotoUID         string       `gorm:"type:varbinary(42);unique_index;index:idx_photos_taken_uid;" json:"UID" yaml:"UID"`
    PhotoType        string       `gorm:"type:varbinary(8);default:'image';" json:"Type" yaml:"Type"`
    TypeSrc          string       `gorm:"type:varbinary(8);" json:"TypeSrc" yaml:"TypeSrc,omitempty"`
    PhotoTitle       string       `gorm:"type:varchar(255);" json:"Title" yaml:"Title"`
    TitleSrc         string       `gorm:"type:varbinary(8);" json:"TitleSrc" yaml:"TitleSrc,omitempty"`
    PhotoDescription string       `gorm:"type:text;" json:"Description" yaml:"Description,omitempty"`
    DescriptionSrc   string       `gorm:"type:varbinary(8);" json:"DescriptionSrc" yaml:"DescriptionSrc,omitempty"`
    PhotoPath        string       `gorm:"type:varbinary(768);index;" json:"Path" yaml:"-"`
    PhotoName        string       `gorm:"type:varbinary(255);" json:"Name" yaml:"-"`
    OriginalName     string       `gorm:"type:varbinary(768);" json:"OriginalName" yaml:"OriginalName,omitempty"`
    PhotoFavorite    bool         `json:"Favorite" yaml:"Favorite,omitempty"`
    PhotoPrivate     bool         `json:"Private" yaml:"Private,omitempty"`
    PhotoScan        bool         `json:"Scan" yaml:"Scan,omitempty"`
    PhotoPanorama    bool         `json:"Panorama" yaml:"Panorama,omitempty"`
    TimeZone         string       `gorm:"type:varbinary(64);" json:"TimeZone" yaml:"-"`
    PlaceID          string       `gorm:"type:varbinary(42);index;default:'zz'" json:"PlaceID" yaml:"-"`
    PlaceSrc         string       `gorm:"type:varbinary(8);" json:"PlaceSrc" yaml:"PlaceSrc,omitempty"`
    CellID           string       `gorm:"type:varbinary(42);index;default:'zz'" json:"CellID" yaml:"-"`
    CellAccuracy     int          `json:"CellAccuracy" yaml:"CellAccuracy,omitempty"`
    PhotoAltitude    int          `json:"Altitude" yaml:"Altitude,omitempty"`
    PhotoLat         float32      `gorm:"type:FLOAT;index;" json:"Lat" yaml:"Lat,omitempty"`
    PhotoLng         float32      `gorm:"type:FLOAT;index;" json:"Lng" yaml:"Lng,omitempty"`
    PhotoCountry     string       `gorm:"type:varbinary(2);index:idx_photos_country_year_month;default:'zz'" json:"Country" yaml:"-"`
    PhotoYear        int          `gorm:"index:idx_photos_country_year_month;" json:"Year" yaml:"Year"`
    PhotoMonth       int          `gorm:"index:idx_photos_country_year_month;" json:"Month" yaml:"Month"`
    PhotoDay         int          `json:"Day" yaml:"Day"`
    PhotoIso         int          `json:"Iso" yaml:"ISO,omitempty"`
    PhotoExposure    string       `gorm:"type:varbinary(64);" json:"Exposure" yaml:"Exposure,omitempty"`
    PhotoFNumber     float32      `gorm:"type:FLOAT;" json:"FNumber" yaml:"FNumber,omitempty"`
    PhotoFocalLength int          `json:"FocalLength" yaml:"FocalLength,omitempty"`
    PhotoQuality     int          `gorm:"type:SMALLINT" json:"Quality" yaml:"-"`
    PhotoResolution  int          `gorm:"type:SMALLINT" json:"Resolution" yaml:"-"`
    CameraID         uint         `gorm:"index:idx_photos_camera_lens;default:1" json:"CameraID" yaml:"-"`
    CameraSerial     string       `gorm:"type:varbinary(255);" json:"CameraSerial" yaml:"CameraSerial,omitempty"`
    CameraSrc        string       `gorm:"type:varbinary(8);" json:"CameraSrc" yaml:"-"`
    LensID           uint         `gorm:"index:idx_photos_camera_lens;default:1" json:"LensID" yaml:"-"`
    Details          *Details     `gorm:"association_autoupdate:false;association_autocreate:false;association_save_reference:false" json:"Details" yaml:"Details"`
    Camera           *Camera      `gorm:"association_autoupdate:false;association_autocreate:false;association_save_reference:false" json:"Camera" yaml:"-"`
    Lens             *Lens        `gorm:"association_autoupdate:false;association_autocreate:false;association_save_reference:false" json:"Lens" yaml:"-"`
    Cell             *Cell        `gorm:"association_autoupdate:false;association_autocreate:false;association_save_reference:false" json:"Cell" yaml:"-"`
    Place            *Place       `gorm:"association_autoupdate:false;association_autocreate:false;association_save_reference:false" json:"Place" yaml:"-"`
    Keywords         []Keyword    `json:"-" yaml:"-"`
    Albums           []Album      `json:"-" yaml:"-"`
    Files            []File       `yaml:"-"`
    Labels           []PhotoLabel `yaml:"-"`
    CreatedAt        time.Time    `yaml:"CreatedAt,omitempty"`
    UpdatedAt        time.Time    `yaml:"UpdatedAt,omitempty"`
    EditedAt         *time.Time   `yaml:"EditedAt,omitempty"`
    CheckedAt        *time.Time   `sql:"index" yaml:"-"`
    DeletedAt        *time.Time   `sql:"index" yaml:"DeletedAt,omitempty"`
}

Photo represents a photo, all its properties, and link to all its images and sidecar files.

func NewPhoto Uses

func NewPhoto() Photo

NewPhoto creates a photo entity.

func (*Photo) AddLabels Uses

func (m *Photo) AddLabels(labels classify.Labels)

AddLabels updates the entity with additional or updated label information.

func (*Photo) AllFilesMissing Uses

func (m *Photo) AllFilesMissing() bool

AllFilesMissing returns true, if all files for this photo are missing.

func (*Photo) Approve Uses

func (m *Photo) Approve() error

Approve approves a photo in review.

func (*Photo) BeforeCreate Uses

func (m *Photo) BeforeCreate(scope *gorm.Scope) error

BeforeCreate creates a random UID if needed before inserting a new row to the database.

func (*Photo) BeforeSave Uses

func (m *Photo) BeforeSave(scope *gorm.Scope) error

BeforeSave ensures the existence of TakenAt properties before indexing or updating a photo

func (*Photo) ClassifyLabels Uses

func (m *Photo) ClassifyLabels() classify.Labels

ClassifyLabels returns all associated labels as classify.Labels

func (*Photo) CountryCode Uses

func (m *Photo) CountryCode() string

CountryCode returns the photo country code.

func (*Photo) CountryName Uses

func (m *Photo) CountryName() string

CountryName returns the photo country name.

func (*Photo) Create Uses

func (m *Photo) Create() error

Create inserts a new photo to the database.

func (*Photo) Delete Uses

func (m *Photo) Delete(permanently bool) error

Delete deletes the entity from the database.

func (*Photo) DeletePermanently Uses

func (m *Photo) DeletePermanently() error

Delete permanently deletes the entity from the database.

func (*Photo) EstimateCountry Uses

func (m *Photo) EstimateCountry()

EstimateCountry updates the photo with an estimated country if possible.

func (*Photo) EstimatePlace Uses

func (m *Photo) EstimatePlace()

EstimatePlace updates the photo with an estimated place and country if possible.

func (*Photo) FileTitle Uses

func (m *Photo) FileTitle() string

FileTitle returns a photo title based on the file name and/or path.

func (*Photo) Find Uses

func (m *Photo) Find() error

Find returns a photo from the database.

func (*Photo) FirstOrCreate Uses

func (m *Photo) FirstOrCreate() error

FirstOrCreate fetches an existing row from the database or inserts a new one.

func (*Photo) GetDetails Uses

func (m *Photo) GetDetails() *Details

GetDetails returns the photo description details.

func (*Photo) GetTakenAt Uses

func (m *Photo) GetTakenAt() time.Time

GetTakenAt returns UTC time for TakenAtLocal.

func (*Photo) GetTimeZone Uses

func (m *Photo) GetTimeZone() string

GetTimeZone uses PhotoLat and PhotoLng to guess the time zone of the photo.

func (*Photo) HasCountry Uses

func (m *Photo) HasCountry() bool

HasCountry checks if the photo has a known country.

func (*Photo) HasDescription Uses

func (m *Photo) HasDescription() bool

HasDescription checks if the photo has a description.

func (*Photo) HasID Uses

func (m *Photo) HasID() bool

HasID checks if the photo has a database id and uid.

func (*Photo) HasLatLng Uses

func (m *Photo) HasLatLng() bool

HasLatLng checks if the photo has a latitude and longitude.

func (*Photo) HasLocation Uses

func (m *Photo) HasLocation() bool

HasLocation checks if the photo has a known location.

func (*Photo) HasPlace Uses

func (m *Photo) HasPlace() bool

HasPlace checks if the photo has a known place.

func (*Photo) HasTitle Uses

func (m *Photo) HasTitle() bool

HasTitle checks if the photo has a title.

func (*Photo) IndexKeywords Uses

func (m *Photo) IndexKeywords() error

IndexKeywords adds given keywords to the photo entry

func (m *Photo) Links() Links

Links returns all share links for this entity.

func (*Photo) LoadFromYaml Uses

func (m *Photo) LoadFromYaml(fileName string) error

LoadFromYaml photo data from a YAML file.

func (*Photo) LoadLocation Uses

func (m *Photo) LoadLocation() error

LoadLocation loads the photo location from the database if not done already.

func (*Photo) LoadPlace Uses

func (m *Photo) LoadPlace() error

LoadPlace loads the photo place from the database if not done already.

func (*Photo) LocationLoaded Uses

func (m *Photo) LocationLoaded() bool

LocationLoaded checks if the photo has a known location that is currently loaded.

func (*Photo) NoCameraSerial Uses

func (m *Photo) NoCameraSerial() bool

NoCameraSerial checks if the photo has no CameraSerial

func (*Photo) NoDescription Uses

func (m *Photo) NoDescription() bool

NoDescription returns true if the photo has no description.

func (*Photo) NoLatLng Uses

func (m *Photo) NoLatLng() bool

NoLatLng checks if latitude and longitude are missing.

func (*Photo) NoTitle Uses

func (m *Photo) NoTitle() bool

NoTitle checks if the photo has no Title

func (*Photo) Optimize Uses

func (m *Photo) Optimize() (updated bool, err error)

Optimize photo data, improve if possible.

func (*Photo) PlaceLoaded Uses

func (m *Photo) PlaceLoaded() bool

PlaceLoaded checks if the photo has a known place that is currently loaded.

func (*Photo) PreloadAlbums Uses

func (m *Photo) PreloadAlbums()

PreloadAlbums prepares gorm scope to retrieve photo albums

func (*Photo) PreloadFiles Uses

func (m *Photo) PreloadFiles()

PreloadFiles prepares gorm scope to retrieve photo file

func (*Photo) PreloadKeywords Uses

func (m *Photo) PreloadKeywords()

PreloadKeywords prepares gorm scope to retrieve photo keywords

func (*Photo) PreloadMany Uses

func (m *Photo) PreloadMany()

PreloadMany prepares gorm scope to retrieve photo file, albums and keywords

func (*Photo) PrimaryFile Uses

func (m *Photo) PrimaryFile() (File, error)

PrimaryFile returns the primary file for this photo.

func (*Photo) QualityScore Uses

func (m *Photo) QualityScore() (score int)

QualityScore returns a score based on photo properties like size and metadata.

func (*Photo) RemoveKeyword Uses

func (m *Photo) RemoveKeyword(w string) error

RemoveKeyword removes a word from photo keywords.

func (*Photo) Save Uses

func (m *Photo) Save() error

Save updates an existing photo or inserts a new one.

func (*Photo) SaveAsYaml Uses

func (m *Photo) SaveAsYaml(fileName string) error

SaveAsYaml saves photo data as YAML file.

func (*Photo) SaveDetails Uses

func (m *Photo) SaveDetails() error

SaveDetails writes photo details to the database.

func (*Photo) SaveLabels Uses

func (m *Photo) SaveLabels() error

Save the photo to the database.

func (*Photo) SetCoordinates Uses

func (m *Photo) SetCoordinates(lat, lng float32, altitude int, source string)

SetCoordinates changes the photo lat, lng and altitude if not empty and from the same source.

func (*Photo) SetDescription Uses

func (m *Photo) SetDescription(desc, source string)

SetDescription changes the photo description if not empty and from the same source.

func (*Photo) SetFavorite Uses

func (m *Photo) SetFavorite(favorite bool) error

SetFavorite updates the favorite status of a photo.

func (*Photo) SetTakenAt Uses

func (m *Photo) SetTakenAt(taken, local time.Time, zone, source string)

SetTakenAt changes the photo date if not empty and from the same source.

func (*Photo) SetTitle Uses

func (m *Photo) SetTitle(title, source string)

SetTitle changes the photo title and clips it to 300 characters.

func (*Photo) String Uses

func (m *Photo) String() string

String returns the id or name as string.

func (*Photo) SyncKeywordLabels Uses

func (m *Photo) SyncKeywordLabels() error

SyncKeywordLabels maintains the label / photo relationship for existing labels and keywords.

func (*Photo) UnknownCountry Uses

func (m *Photo) UnknownCountry() bool

UnknownCountry checks if the photo has an unknown country.

func (*Photo) UnknownLocation Uses

func (m *Photo) UnknownLocation() bool

UnknownLocation checks if the photo has an unknown location.

func (*Photo) UnknownPlace Uses

func (m *Photo) UnknownPlace() bool

UnknownPlace checks if the photo has an unknown place.

func (*Photo) Update Uses

func (m *Photo) Update(attr string, value interface{}) error

Updates a column in the database.

func (*Photo) UpdateDateFields Uses

func (m *Photo) UpdateDateFields()

UpdateDateFields updates internal date fields.

func (*Photo) UpdateLocation Uses

func (m *Photo) UpdateLocation(geoApi string) (keywords []string, labels classify.Labels)

UpdateLocation updates location and labels based on latitude and longitude.

func (*Photo) UpdateTitle Uses

func (m *Photo) UpdateTitle(labels classify.Labels) error

UpdateTitle updated the photo title based on location and labels.

func (*Photo) Updates Uses

func (m *Photo) Updates(values interface{}) error

Updates multiple columns in the database.

func (*Photo) Yaml Uses

func (m *Photo) Yaml() ([]byte, error)

Yaml returns photo data as YAML string.

func (*Photo) YamlFileName Uses

func (m *Photo) YamlFileName(originalsPath, sidecarPath string) string

YamlFileName returns the YAML backup file name.

type PhotoAlbum Uses

type PhotoAlbum struct {
    PhotoUID  string `gorm:"type:varbinary(42);primary_key;auto_increment:false"`
    AlbumUID  string `gorm:"type:varbinary(42);primary_key;auto_increment:false;index"`
    Order     int
    Hidden    bool
    CreatedAt time.Time
    UpdatedAt time.Time
    Photo     *Photo `gorm:"PRELOAD:false"`
    Album     *Album `gorm:"PRELOAD:true"`
}

PhotoAlbum represents the many_to_many relation between Photo and Album

func FirstOrCreatePhotoAlbum Uses

func FirstOrCreatePhotoAlbum(m *PhotoAlbum) *PhotoAlbum

FirstOrCreatePhotoAlbum returns the existing row, inserts a new row or nil in case of errors.

func NewPhotoAlbum Uses

func NewPhotoAlbum(photoUID, albumUID string) *PhotoAlbum

NewPhotoAlbum registers an photo and album association using UID

func (*PhotoAlbum) Create Uses

func (m *PhotoAlbum) Create() error

Create inserts a new row to the database.

func (*PhotoAlbum) Save Uses

func (m *PhotoAlbum) Save() error

Save updates or inserts a row.

func (PhotoAlbum) TableName Uses

func (PhotoAlbum) TableName() string

TableName returns PhotoAlbum table identifier "photos_albums"

type PhotoAlbumMap Uses

type PhotoAlbumMap map[string]PhotoAlbum

func (PhotoAlbumMap) Get Uses

func (m PhotoAlbumMap) Get(name, photoUID, albumUID string) PhotoAlbum

func (PhotoAlbumMap) Pointer Uses

func (m PhotoAlbumMap) Pointer(name, photoUID, albumUID string) *PhotoAlbum

type PhotoKeyword Uses

type PhotoKeyword struct {
    PhotoID   uint `gorm:"primary_key;auto_increment:false"`
    KeywordID uint `gorm:"primary_key;auto_increment:false;index"`
}

PhotoKeyword represents the many-to-many relation between Photo and Keyword

func FirstOrCreatePhotoKeyword Uses

func FirstOrCreatePhotoKeyword(m *PhotoKeyword) *PhotoKeyword

FirstOrCreatePhotoKeyword returns the existing row, inserts a new row or nil in case of errors.

func NewPhotoKeyword Uses

func NewPhotoKeyword(photoID, keywordID uint) *PhotoKeyword

NewPhotoKeyword registers a new PhotoKeyword relation

func (*PhotoKeyword) Create Uses

func (m *PhotoKeyword) Create() error

Create inserts a new row to the database.

func (PhotoKeyword) TableName Uses

func (PhotoKeyword) TableName() string

TableName returns PhotoKeyword table identifier "photos_keywords"

type PhotoKeywordMap Uses

type PhotoKeywordMap map[string]PhotoKeyword

type PhotoLabel Uses

type PhotoLabel struct {
    PhotoID     uint   `gorm:"primary_key;auto_increment:false"`
    LabelID     uint   `gorm:"primary_key;auto_increment:false;index"`
    LabelSrc    string `gorm:"type:varbinary(8);"`
    Uncertainty int    `gorm:"type:SMALLINT"`
    Photo       *Photo `gorm:"PRELOAD:false"`
    Label       *Label `gorm:"PRELOAD:true"`
}

PhotoLabel represents the many-to-many relation between Photo and label. Labels are weighted by uncertainty (100 - confidence)

func FirstOrCreatePhotoLabel Uses

func FirstOrCreatePhotoLabel(m *PhotoLabel) *PhotoLabel

FirstOrCreatePhotoLabel returns the existing row, inserts a new row or nil in case of errors.

func NewPhotoLabel Uses

func NewPhotoLabel(photoID, labelID uint, uncertainty int, source string) *PhotoLabel

NewPhotoLabel registers a new PhotoLabel relation with an uncertainty and a source of label

func (*PhotoLabel) ClassifyLabel Uses

func (m *PhotoLabel) ClassifyLabel() classify.Label

ClassifyLabel returns the label as classify.Label

func (*PhotoLabel) Create Uses

func (m *PhotoLabel) Create() error

Create inserts a new row to the database.

func (*PhotoLabel) Save Uses

func (m *PhotoLabel) Save() error

Save saves the entity in the database.

func (PhotoLabel) TableName Uses

func (PhotoLabel) TableName() string

TableName returns PhotoLabel table identifier "photos_labels"

func (*PhotoLabel) Update Uses

func (m *PhotoLabel) Update(attr string, value interface{}) error

Updates a column in the database.

func (*PhotoLabel) Updates Uses

func (m *PhotoLabel) Updates(values interface{}) error

Updates multiple columns in the database.

type PhotoMap Uses

type PhotoMap map[string]Photo

func (PhotoMap) Get Uses

func (m PhotoMap) Get(name string) Photo

func (PhotoMap) Pointer Uses

func (m PhotoMap) Pointer(name string) *Photo

type Photos Uses

type Photos []Photo

func (Photos) UIDs Uses

func (m Photos) UIDs() []string

UIDs returns a slice of photo UIDs.

type Place Uses

type Place struct {
    ID            string    `gorm:"type:varbinary(42);primary_key;auto_increment:false;" json:"PlaceID" yaml:"PlaceID"`
    PlaceLabel    string    `gorm:"type:varbinary(768);unique_index;" json:"Label" yaml:"Label"`
    PlaceCity     string    `gorm:"type:varchar(255);" json:"City" yaml:"City,omitempty"`
    PlaceState    string    `gorm:"type:varchar(255);" json:"State" yaml:"State,omitempty"`
    PlaceCountry  string    `gorm:"type:varbinary(2);" json:"Country" yaml:"Country,omitempty"`
    PlaceKeywords string    `gorm:"type:varchar(255);" json:"Keywords" yaml:"Keywords,omitempty"`
    PlaceFavorite bool      `json:"Favorite" yaml:"Favorite,omitempty"`
    PhotoCount    int       `gorm:"default:1" json:"PhotoCount" yaml:"-"`
    CreatedAt     time.Time `json:"CreatedAt" yaml:"-"`
    UpdatedAt     time.Time `json:"UpdatedAt" yaml:"-"`
}

Place used to associate photos to places

func FindPlace Uses

func FindPlace(id string, label string) *Place

FindPlace finds a matching place or returns nil.

func FirstOrCreatePlace Uses

func FirstOrCreatePlace(m *Place) *Place

FirstOrCreatePlace fetches an existing row, inserts a new row or nil in case of errors.

func (Place) City Uses

func (m Place) City() string

City returns place City

func (Place) CityContains Uses

func (m Place) CityContains(text string) bool

CityContains checks if the location city contains the text string

func (Place) CountryCode Uses

func (m Place) CountryCode() string

CountryCode returns place CountryCode

func (Place) CountryName Uses

func (m Place) CountryName() string

CountryName returns place CountryName

func (*Place) Create Uses

func (m *Place) Create() error

Create inserts a new row to the database.

func (*Place) Find Uses

func (m *Place) Find() error

Find fetches entity values from the database the primary key.

func (Place) Label Uses

func (m Place) Label() string

Label returns place label

func (Place) LongCity Uses

func (m Place) LongCity() bool

LongCity checks if the city name is more than 16 char.

func (Place) NoCity Uses

func (m Place) NoCity() bool

NoCity checks if the location has no city

func (Place) State Uses

func (m Place) State() string

State returns place State

func (Place) Unknown Uses

func (m Place) Unknown() bool

Unknown returns true if this is an unknown place

type PlacesMap Uses

type PlacesMap map[string]Place

func (PlacesMap) Get Uses

func (m PlacesMap) Get(name string) Place

func (PlacesMap) Pointer Uses

func (m PlacesMap) Pointer(name string) *Place

type RowCount Uses

type RowCount struct {
    Count int
}

type Types Uses

type Types map[string]interface{}

func (Types) Drop Uses

func (list Types) Drop()

Drop drops all database tables of registered entities.

func (Types) Migrate Uses

func (list Types) Migrate()

Drop migrates all database tables of registered entities.

func (Types) Truncate Uses

func (list Types) Truncate()

Truncate removes all data from tables without dropping them.

func (Types) WaitForMigration Uses

func (list Types) WaitForMigration()

WaitForMigration waits for the database migration to be successful.

Package entity imports 32 packages (graph) and is imported by 8 packages. Updated 2020-07-30. Refresh now. Tools for package owners.