mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-19 13:36:09 +05:00
DLNA: don't err for root obj meta
and swap icons order
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/anacrolix/dms/dlna/dms"
|
||||
"github.com/anacrolix/dms/upnpav"
|
||||
|
||||
"server/log"
|
||||
"server/web/pages/template"
|
||||
@@ -41,20 +42,6 @@ func Start() {
|
||||
NoProbe: true,
|
||||
StallEventSubscribe: true,
|
||||
Icons: []dms.Icon{
|
||||
dms.Icon{
|
||||
Width: 48,
|
||||
Height: 48,
|
||||
Depth: 24,
|
||||
Mimetype: "image/png",
|
||||
ReadSeeker: bytes.NewReader(template.Dlnaicon48png),
|
||||
},
|
||||
dms.Icon{
|
||||
Width: 120,
|
||||
Height: 120,
|
||||
Depth: 24,
|
||||
Mimetype: "image/png",
|
||||
ReadSeeker: bytes.NewReader(template.Dlnaicon120png),
|
||||
},
|
||||
dms.Icon{
|
||||
Width: 48,
|
||||
Height: 48,
|
||||
@@ -69,6 +56,20 @@ func Start() {
|
||||
Mimetype: "image/jpeg",
|
||||
ReadSeeker: bytes.NewReader(template.Dlnaicon120jpg),
|
||||
},
|
||||
dms.Icon{
|
||||
Width: 48,
|
||||
Height: 48,
|
||||
Depth: 24,
|
||||
Mimetype: "image/png",
|
||||
ReadSeeker: bytes.NewReader(template.Dlnaicon48png),
|
||||
},
|
||||
dms.Icon{
|
||||
Width: 120,
|
||||
Height: 120,
|
||||
Depth: 24,
|
||||
Mimetype: "image/png",
|
||||
ReadSeeker: bytes.NewReader(template.Dlnaicon120png),
|
||||
},
|
||||
},
|
||||
NotifyInterval: 30 * time.Second,
|
||||
AllowedIpNets: func() []*net.IPNet {
|
||||
@@ -119,6 +120,20 @@ func onBrowse(path, rootObjectPath, host, userAgent string) (ret []interface{},
|
||||
}
|
||||
|
||||
func onBrowseMeta(path string, rootObjectPath string, host, userAgent string) (ret interface{}, err error) {
|
||||
if path == "/" {
|
||||
// Root Object Meta
|
||||
rootObj := upnpav.Object{
|
||||
ID: "0",
|
||||
ParentID: "-1",
|
||||
Restricted: 1,
|
||||
Searchable: 1,
|
||||
Title: "TorrServer",
|
||||
Class: "object.container.storageFolder",
|
||||
}
|
||||
// add Root Object
|
||||
ret = upnpav.Container{Object: rootObj, ChildCount: 1}
|
||||
return
|
||||
}
|
||||
err = fmt.Errorf("not implemented")
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user