use toml.DateTime; fix metadata.toml writing bug
This commit is contained in:
parent
dd54e8cc49
commit
a3b9ec2cb6
2 changed files with 10 additions and 15 deletions
|
|
@ -47,11 +47,6 @@ type (
|
|||
)
|
||||
|
||||
func BuildVideo(metadata *scanner.Metadata) (*Video, error) {
|
||||
videoDate, err := time.Parse("2006-01-02", metadata.Date)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to parse date from metadata: %v", err)
|
||||
}
|
||||
|
||||
var category *Category = nil
|
||||
if metadata.Category != nil {
|
||||
category = &Category{
|
||||
|
|
@ -68,13 +63,13 @@ func BuildVideo(metadata *scanner.Metadata) (*Video, error) {
|
|||
Title: metadata.Title,
|
||||
Category: category,
|
||||
Part: metadata.Part,
|
||||
Date: videoDate,
|
||||
Date: metadata.Date.AsTime(time.UTC),
|
||||
Tags: metadata.Tags,
|
||||
Filename: path.Join(
|
||||
metadata.FootageDir,
|
||||
fmt.Sprintf(
|
||||
"%s-fullvod.mkv",
|
||||
videoDate.Format("2006-01-02"),
|
||||
metadata.Date.String(),
|
||||
)),
|
||||
}, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue