SiriProxy-XBMC
SiriProxy-XBMC copied to clipboard
Support of Thumbnail, Fanart in Movie or Episode
Hello brainwave9,
In my Fork i've added support for Thumbnail and Fanart to display when you want to play a Movie or Episode. You're welcome to add this piece of code to youre own.
https://github.com/DJXFMA/SiriProxy-XBMC
Kind regards, DJXFMA
You have to add thumbnail to the fields, properties in library for the movie or episode. require 'cgi' on top of siriproxy_xbmc.rb and also make variables host and port available everywhere:
require 'cgi' require 'cora' require 'siri_objects' require 'xbmc_library' require 'chronic'
class SiriProxy::Plugin::XBMC < SiriProxy::Plugin
def initialize(config)
appname = "SiriProxy-XBMC"
@host = config["xbmc_host"]
@port = config["xbmc_port"]
username = config["xbmc_username"]
password = config["xbmc_password"]
And use this for displaying the image within the play functionality for movie or episode.
say "Now playing \"#{movie["title"]}\"", spoken: "Now playing \"#{movie["title"]}\""
#Now playing Movie with Thumbnail
encImgUrl = CGI.escape(movie["thumbnail"])
imgUrl = "http://#{@host}:#{@port}/image/" + encImgUrl
object = SiriAddViews.new
object.make_root(last_ref_id)
answer = SiriAnswer.new("\"#{movie["title"]} (#{movie["year"]})\"", [
SiriAnswerLine.new('logo', imgUrl)
])
object.views << SiriAnswerSnippet.new([answer])
send_object object
@xbmc.play(movie["file"])
Nice addition!
Thanks! And it looks great, and it works great. Also I want to display the fanart + genres and rating. But that will come.
Should also use code to detect if the value of thumbnail is filled or not. But I think that XBMC should have all thumbnails available. I'm also trying to find out how to get the current played item to display also with thumbnail. But I can't get it to work as for now.
First I get the current active player Id then I use Player.GetItem with player Id. But not sure why the data stays nill.
I've added a lot of new code in to the Fork I am working on. Feel free to use any of my code. I've added a better handling for recent movies, recent episodes with thumbnails offcourse! Also a new function now playing which will show the current played item (episode, movie).
I can also add fanart, but it doesn't look that great in horizontal view.