serve dlna: handle empty ObjectID from Samsung TVs

Samsung TVs sometimes send Browse requests with empty ObjectID
parameters (<ObjectID></ObjectID>) which causes DLNA servers to
return errors. Default empty ObjectID to "0" (root container) to
maintain compatibility.

This fix is based on ReadyMedia/MiniDLNA Bug 311 which documented
the same issue and solution for Samsung TVs.

See #9346
This commit is contained in:
Nick Craig-Wood
2026-04-18 10:36:38 +01:00
parent 9cb329809d
commit 3e9e29ba8f

View File

@@ -305,6 +305,10 @@ func (cds *contentDirectoryService) Handle(action string, argsXML []byte, r *htt
if err := xml.Unmarshal(argsXML, &browse); err != nil {
return nil, err
}
// Samsung TVs sometimes send empty ObjectID, default to root container
if browse.ObjectID == "" {
browse.ObjectID = "0"
}
obj, err := cds.objectFromID(browse.ObjectID)
if err != nil {
return nil, upnp.Errorf(upnpav.NoSuchObjectErrorCode, "%s", err.Error())