fix bug/webinfo-add custom template

This commit is contained in:
Aynakeya
2022-07-19 18:09:44 -07:00
parent f6b58a3e9d
commit 05c44079e2
9 changed files with 100 additions and 27 deletions

View File

@@ -90,14 +90,17 @@ func newImageFromPlayerPicture(picture player.Picture) (*canvas.Image, error) {
return img, nil
} else {
uri, err := storage.ParseURI(picture.Url)
if err != nil || uri == nil {
if err != nil {
return nil, err
}
if uri == nil {
return nil, errors.New("fail to fail url")
}
img := canvas.NewImageFromURI(uri)
if img == nil {
// bug fix, return a new error to indicate fail to read an image
return nil, errors.New("fail to read image")
}
return img, err
return img, nil
}
}

View File

@@ -202,21 +202,6 @@ func registerPlayControllerHandler() {
PlayController.Cover.Resource = picture.Resource
PlayController.Cover.Refresh()
}()
//uri, err := storage.ParseURI(media.Cover)
//if err != nil || uri == nil {
// l().Warn("fail to load parse cover url", media.Cover)
//}
//// async update
//go func() {
// img := canvas.NewImageFromURI(uri)
// if img == nil {
// l().Warn("fail to load parse cover url", media.Cover)
// PlayController.SetDefaultCover()
// return
// }
// PlayController.Cover.Resource = img.Resource
// PlayController.Cover.Refresh()
//}()
}
})
return