implement thubnail loading from tmdb

fix lots of errors if ' char occurs in path strings
correct reverse proxy for websocket
This commit is contained in:
2021-04-23 21:23:51 +02:00
parent f72a3e5fb4
commit d952538f0a
9 changed files with 142 additions and 21 deletions

View File

@ -72,4 +72,21 @@ WHERE tvshow_episodes.id=%d`, le.ID)
return jsonify(ret)
})
var rtn struct {
Id int
}
AddHandler("readThumbnail", TVShowNode, &rtn, func() []byte {
var pic []byte
query := fmt.Sprintf("SELECT thumbnail FROM tvshow WHERE id=%d", rtn.Id)
err := database.QueryRow(query).Scan(&pic)
if err != nil {
fmt.Printf("the thumbnail of movie id %d couldn't be found", rtn.Id)
return nil
}
return pic
})
}

View File

@ -44,7 +44,7 @@ func getVideoHandlers() {
AddHandler("readThumbnail", VideoNode, &rtn, func() []byte {
var pic []byte
query := fmt.Sprintf("SELECT thumbnail FROM videos WHERE movie_id='%d'", rtn.Movieid)
query := fmt.Sprintf("SELECT thumbnail FROM videos WHERE movie_id=%d", rtn.Movieid)
err := database.QueryRow(query).Scan(&pic)
if err != nil {