Add option to sort Recently Added by file's mtime instead of time of import.

This commit is contained in:
Deluan
2021-03-12 17:49:47 -05:00
committed by Deluan Quintão
parent 1ec105a245
commit 720e2357b7
6 changed files with 53 additions and 30 deletions
+2 -2
View File
@@ -6,6 +6,7 @@ import (
"os"
"path/filepath"
"strings"
"time"
"github.com/kennygrant/sanitize"
"github.com/microcosm-cc/bluemonday"
@@ -64,8 +65,7 @@ func (s *mediaFileMapper) toMediaFile(md metadata.Metadata) model.MediaFile {
mf.Comment = s.policy.Sanitize(md.Comment())
mf.Lyrics = s.policy.Sanitize(md.Lyrics())
// TODO Get Creation time. https://github.com/djherbis/times ?
mf.CreatedAt = md.ModificationTime()
mf.CreatedAt = time.Now()
mf.UpdatedAt = md.ModificationTime()
return *mf