cache: reduce log level for plex api - for #2102

This commit is contained in:
remusb 2018-03-17 11:55:55 +02:00
parent d4cca8d9f9
commit 4924ac2f17

10
backend/cache/plex.go vendored
View file

@ -136,7 +136,7 @@ func (p *plexConnector) isPlaying(co *Object) bool {
if cr, yes := p.f.isWrappedByCrypt(); yes { if cr, yes := p.f.isWrappedByCrypt(); yes {
remote, err = cr.DecryptFileName(co.Remote()) remote, err = cr.DecryptFileName(co.Remote())
if err != nil { if err != nil {
fs.Errorf("plex", "can not decrypt wrapped file: %v", err) fs.Debugf("plex", "can not decrypt wrapped file: %v", err)
return false return false
} }
} }
@ -166,23 +166,23 @@ func (p *plexConnector) isPlaying(co *Object) bool {
} }
videosGen, ok := get(data, "MediaContainer", "Video") videosGen, ok := get(data, "MediaContainer", "Video")
if !ok { if !ok {
fs.Errorf("plex", "empty videos: %v", data) fs.Debugf("plex", "empty videos: %v", data)
return false return false
} }
videos, ok := videosGen.([]interface{}) videos, ok := videosGen.([]interface{})
if !ok || len(videos) < 1 { if !ok || len(videos) < 1 {
fs.Errorf("plex", "empty videos: %v", data) fs.Debugf("plex", "empty videos: %v", data)
return false return false
} }
for _, v := range videos { for _, v := range videos {
keyGen, ok := get(v, "key") keyGen, ok := get(v, "key")
if !ok { if !ok {
fs.Errorf("plex", "failed to find: key") fs.Debugf("plex", "failed to find: key")
continue continue
} }
key, ok := keyGen.(string) key, ok := keyGen.(string)
if !ok { if !ok {
fs.Errorf("plex", "failed to understand: key") fs.Debugf("plex", "failed to understand: key")
continue continue
} }
req, err := http.NewRequest("GET", fmt.Sprintf("%s%s", p.url.String(), key), nil) req, err := http.NewRequest("GET", fmt.Sprintf("%s%s", p.url.String(), key), nil)