From 7586a345ff3c87d29a08b44909f9be5579172938 Mon Sep 17 00:00:00 2001 From: Dan Walters Date: Mon, 17 Feb 2020 19:49:35 -0500 Subject: [PATCH] dlna: cds: use modification time as date in dlna metadata We havn't been outputting anything for this until now, which leads to my Samsung showing an epoch/1970 date for all files. --- cmd/serve/dlna/cds.go | 1 + cmd/serve/dlna/dlna_test.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/cmd/serve/dlna/cds.go b/cmd/serve/dlna/cds.go index 1fa1cfe9f..1b600f203 100644 --- a/cmd/serve/dlna/cds.go +++ b/cmd/serve/dlna/cds.go @@ -104,6 +104,7 @@ func (cds *contentDirectoryService) cdsObjectToUpnpavObject(cdsObject object, fi obj.Class = "object.item." + mediaType[1] + "Item" obj.Title = fileInfo.Name() + obj.Date = upnpav.Timestamp{Time: fileInfo.ModTime()} item := upnpav.Item{ Object: obj, diff --git a/cmd/serve/dlna/dlna_test.go b/cmd/serve/dlna/dlna_test.go index eaeab4091..540a59b44 100644 --- a/cmd/serve/dlna/dlna_test.go +++ b/cmd/serve/dlna/dlna_test.go @@ -124,6 +124,8 @@ func TestContentDirectoryBrowseMetadata(t *testing.T) { require.NotContains(t, string(body), html.EscapeString("")) } // Check that the X_MS_MediaReceiverRegistrar is faked out properly.