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
1 changed files with 5 additions and 5 deletions

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