Replace database, mostly media and video

This commit is contained in:
viktorstrate
2020-11-26 20:48:04 +01:00
parent 177ae91500
commit 2b966aa672
7 changed files with 73 additions and 137 deletions

View File

@@ -20,10 +20,10 @@ func ScanEXIF(tx *gorm.DB, media *models.Media) (returnExif *models.MediaEXIF, r
{
// Check if EXIF data already exists
if media.ExifId != nil {
if media.ExifID != nil {
var exif models.MediaEXIF
if err := tx.First(&exif, media.ExifId).Error; err != nil {
if err := tx.First(&exif, media.ExifID).Error; err != nil {
return nil, errors.Wrap(err, "get EXIF for media from database")
}

View File

@@ -98,7 +98,7 @@ func ScanMedia(tx *gorm.DB, mediaPath string, albumId uint, cache *AlbumScannerC
Path: mediaPath,
SideCarPath: sideCarPath,
SideCarHash: sideCarHash,
AlbumId: albumId,
AlbumID: albumId,
Type: mediaTypeText,
DateShot: stat.ModTime(),
}