mirror of
https://github.com/rclone/rclone.git
synced 2026-05-12 01:57:56 -04:00
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:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user