1
mirror of https://github.com/rclone/rclone synced 2024-12-25 17:03:45 +01:00

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.
This commit is contained in:
Dan Walters 2020-02-17 19:49:35 -05:00 committed by Nick Craig-Wood
parent 393b94bb70
commit 7586a345ff
2 changed files with 3 additions and 0 deletions

View File

@ -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,

View File

@ -124,6 +124,8 @@ func TestContentDirectoryBrowseMetadata(t *testing.T) {
require.NotContains(t, string(body), html.EscapeString("<item "))
// if there is a childCount, it better not be zero
require.NotContains(t, string(body), html.EscapeString(" childCount=\"0\""))
// should have a dc:date element
require.Contains(t, string(body), html.EscapeString("<dc:date>"))
}
// Check that the X_MS_MediaReceiverRegistrar is faked out properly.