mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Merge pull request #103 from WithoutPants/metadata_from_file
Set title, details and date from scene file metadata
This commit is contained in:
@@ -3,15 +3,16 @@ package manager
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/stashapp/stash/pkg/database"
|
||||
"github.com/stashapp/stash/pkg/ffmpeg"
|
||||
"github.com/stashapp/stash/pkg/logger"
|
||||
"github.com/stashapp/stash/pkg/models"
|
||||
"github.com/stashapp/stash/pkg/utils"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
type ScanTask struct {
|
||||
@@ -115,6 +116,9 @@ func (t *ScanTask) scanScene() {
|
||||
newScene := models.Scene{
|
||||
Checksum: checksum,
|
||||
Path: t.FilePath,
|
||||
Title: sql.NullString{String: videoFile.Title, Valid: true},
|
||||
Details: sql.NullString{String: videoFile.Comment, Valid: true},
|
||||
Date: models.SQLiteDate{String: videoFile.CreationTime.Format("2006-01-02")},
|
||||
Duration: sql.NullFloat64{Float64: videoFile.Duration, Valid: true},
|
||||
VideoCodec: sql.NullString{String: videoFile.VideoCodec, Valid: true},
|
||||
AudioCodec: sql.NullString{String: videoFile.AudioCodec, Valid: true},
|
||||
|
||||
Reference in New Issue
Block a user