From 0b87a1137f330a36419030a4e82363ed36563a23 Mon Sep 17 00:00:00 2001 From: davy Date: Fri, 28 Jun 2019 22:50:59 -0500 Subject: added feeds --- pkg/media/video.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pkg/media/video.go') diff --git a/pkg/media/video.go b/pkg/media/video.go index f79ab44..7fddbee 100644 --- a/pkg/media/video.go +++ b/pkg/media/video.go @@ -3,6 +3,7 @@ package media import ( "os" "strings" + "time" "github.com/dhowden/tag" ) @@ -15,6 +16,7 @@ type Video struct { Thumb []byte ThumbType string Modified string + Timestamp time.Time } func ParseVideo(path string) (*Video, error) { @@ -26,7 +28,8 @@ func ParseVideo(path string) (*Video, error) { if err != nil { return nil, err } - modified := info.ModTime().Format("2006-01-02") + timestamp := info.ModTime() + modified := timestamp.Format("2006-01-02 03:04 PM") name := info.Name() // ID is name without extension idx := strings.LastIndex(name, ".") @@ -49,6 +52,7 @@ func ParseVideo(path string) (*Video, error) { Album: m.Album(), Description: m.Comment(), Modified: modified, + Timestamp: timestamp, } // Add thumbnail (if exists) p := m.Picture() -- cgit v1.2.3