Author Topic: Featured Movie / Recommended Movie  (Read 7271 times)

0 Members and 1 Guest are viewing this topic.

bp_pbs

  • Contributor
  • ***
  • Posts: 94
  • Karma: 1
    • View Profile
Featured Movie / Recommended Movie
« on: March 03, 2012, 05:51:32 AM »
So I wanted a command that picks a random movie and TTS the Title and Plot. I was able to put one together but it has a hard time with movies that contain ' symbols. Ex. Ferris Bueller's Day Off.
Do you have any suggestions on how I can get this to work better?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Featured Movie / Recommended Movie
« Reply #1 on: March 03, 2012, 08:34:06 AM »
So I wanted a command that picks a random movie and TTS the Title and Plot. I was able to put one together but it has a hard time with movies that contain ' symbols. Ex. Ferris Bueller's Day Off.
Do you have any suggestions on how I can get this to work better?

Clever.  Can you please export a group containing only this command and then attach it to a post here, so I can experiment with it without having to copy every line by hand?

Also, you say "it has a hard time", but maybe you can be more specific about what is happening, or what is not working.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Featured Movie / Recommended Movie
« Reply #2 on: March 03, 2012, 09:05:49 AM »
do you want it to start playing the movie right away, or just show it?

bp_pbs

  • Contributor
  • ***
  • Posts: 94
  • Karma: 1
    • View Profile
Re: Featured Movie / Recommended Movie
« Reply #3 on: March 03, 2012, 11:54:13 AM »
I wanted it just to show it like a recommendation. I have so many movies that some get lost in the bunch.
I see what the query is doing but not sure how to work around it. So with movies like "Man on Fire" it looks like this
queryvideodatabase(select c01 from movie where c00 = 'Man on Fire')

But with movies like "Ferris Bueller's Day Off" it looks like this
queryvideodatabase(select c01 from movie where c00 = 'Ferris Bueller's Day Off')
Its implementing the ' on Bueller's. So it's failing the last SQL statement

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Featured Movie / Recommended Movie
« Reply #4 on: March 03, 2012, 01:05:30 PM »
why are you using the payloadXML file:

 XbmcPayloads\xbmcMovies.xml

in your command?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Featured Movie / Recommended Movie
« Reply #5 on: March 03, 2012, 01:52:36 PM »
I think it makes more sense to request the movie title and the synopsis in a single request.

try the attached:
« Last Edit: March 03, 2012, 02:02:20 PM by jitterjames »

bp_pbs

  • Contributor
  • ***
  • Posts: 94
  • Karma: 1
    • View Profile
Re: Featured Movie / Recommended Movie
« Reply #6 on: March 03, 2012, 02:51:26 PM »
Whoa...That was way easier than I was trying to make it. I tried something similar to this but the Title and Plot kept running together.

Thanks.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Featured Movie / Recommended Movie
« Reply #7 on: March 03, 2012, 04:27:39 PM »
any time.

by the way the XBMC.Filter command doesn't always work that well because of the way XBMC handles SMS filter keys.  You can only filter on a single word.  You'll notice for example if you try to filter on one of the star wars movies it will probably filter to show all the Star Wars movies, instead of just the one you want.

One solution would be to use something like

VC.TellVox       Find movie {match.1}

this will work as long as you have the command "Find Movie X" in your tree, which you should if you installed the standard XBMC configuration and did not remove this command.

This "tellvox" action will emulate the text as a spoken command (as though you said "find movie blah blah blah").  And the find movie command will generate a smart playlist which will return the correct movie, and only the correct movie.

 :yay
« Last Edit: March 03, 2012, 04:29:48 PM by jitterjames »

rablack97

  • $upporter
  • Sr. Member
  • *****
  • Posts: 100
  • Karma: 0
    • View Profile
Re: Featured Movie / Recommended Movie
« Reply #8 on: March 04, 2012, 06:49:47 PM »
Hello I like this command, was playing around with it a little today.

I was wondering if there was a way to put vox in standby mode until the TTS is done with the plot and then back to on mode when complete.

Vox picks up on the speech during the plot and just start opening up all kinds of stuff.

rablack97

  • $upporter
  • Sr. Member
  • *****
  • Posts: 100
  • Karma: 0
    • View Profile
Re: Featured Movie / Recommended Movie
« Reply #9 on: March 04, 2012, 07:21:10 PM »
NVM, This works for me...

Dave

  • $upporter
  • Sr. Member
  • *****
  • Posts: 139
  • Karma: 31
    • View Profile
Re: Featured Movie / Recommended Movie
« Reply #10 on: March 04, 2012, 07:23:48 PM »
I'm not at home at the moment so i can't view the comand group or test anything.
But i guess you can just insert a VC.Standby command before your tts.speaksync and VC.On behind it...

bp_pbs

  • Contributor
  • ***
  • Posts: 94
  • Karma: 1
    • View Profile
Re: Featured Movie / Recommended Movie
« Reply #11 on: March 04, 2012, 07:38:07 PM »
@jitterjames
Yeah I was using the XBMC.Filter because I was having trouble with the smartlist with ATV2. But I am now using HTPC so I will give it a try again.

@rablack97
I know you got it to work but was just wondering couldn't put VC.Off or VC.Standby before TTS.Stop or TTS.Speak How about, {match.1}.
And then change the TTS.Speak {match.2} to TTS. SpeakSync {match.2} and put a VC.On at the end…Like Dave I'm not home to test this either but just throwing my 2 cents in.
I personally use prefix and unless this command choices “Devil in the Blue Dress”..(my prefix name is Daphne…Lol)….I should be fine.

rablack97

  • $upporter
  • Sr. Member
  • *****
  • Posts: 100
  • Karma: 0
    • View Profile
Re: Featured Movie / Recommended Movie
« Reply #12 on: March 04, 2012, 07:53:55 PM »
Ah ok....

Took both of your advice....This works really well too.

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Featured Movie / Recommended Movie
« Reply #13 on: May 28, 2012, 01:33:38 AM »
Have you guys noticed it doesn't allways select the movie but rather the dirback button ".."

Is there any way to make the system go straight to the movie info page...  the one you activate by pressing 'I" on the keyboard...

Cheers all..

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Featured Movie / Recommended Movie
« Reply #14 on: May 28, 2012, 07:16:47 AM »
Also one more thing, would it be at all possible to include Genre in this...  It would be great if Anika [my four year old] and I could just say....  "Hey Brian, could you recommend us a 'family' movie". 

Neat idea....  I was showing it off earlier to her and it popped up with "Saw 5" oh on that note, can you tell Brian to shut up or something while reading the synopsis LOL...

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Featured Movie / Recommended Movie
« Reply #15 on: May 28, 2012, 11:53:50 AM »
Have you guys noticed it doesn't allways select the movie but rather the dirback button ".."

Is there any way to make the system go straight to the movie info page...  the one you activate by pressing 'I" on the keyboard...

Cheers all..

no.

but I always disable "show parent items" in xbmc settings:

http://wiki.xbmc.org/index.php?title=Settings/Appearance#File_lists

I dont' know of a way to make it go "straight" to the info page, but you can send a keypress.  Timing may be an issue.  Depending which method you use to send the keypress, you may need to make sure that the page has fully loaded first.

bp_pbs

  • Contributor
  • ***
  • Posts: 94
  • Karma: 1
    • View Profile
Re: Featured Movie / Recommended Movie
« Reply #16 on: May 28, 2012, 01:01:29 PM »
Sorry I have not notice that either.

Also one more thing, would it be at all possible to include Genre in this...  It would be great if Anika [my four year old] and I could just say....  "Hey Brian, could you recommend us a 'family' movie". 

Neat idea....  I was showing it off earlier to her and it popped up with "Saw 5" oh on that note, can you tell Brian to shut up or something while reading the synopsis LOL...

Um...The Genre part I will have to work on. There should be a way.

For Brian to stop talking use "TTS.Stop" .

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Featured Movie / Recommended Movie
« Reply #17 on: May 28, 2012, 01:13:53 PM »
Also one more thing, would it be at all possible to include Genre in this...  It would be great if Anika [my four year old] and I could just say....  "Hey Brian, could you recommend us a 'family' movie". 

Neat idea....  I was showing it off earlier to her and it popped up with "Saw 5" oh on that note, can you tell Brian to shut up or something while reading the synopsis LOL...

you can add a genre clause to the sql.  something like  and genre = '{1}'.  You need to consult the xbmc database specs to make sure you use a valid column name.

You can use TTS.Stop to make Brian "shut up" but I'm not sure you want your daughter to hear you using that command.  This will not work if you are using TTS.SpeakSync

bp_pbs

  • Contributor
  • ***
  • Posts: 94
  • Karma: 1
    • View Profile
Re: Featured Movie / Recommended Movie
« Reply #18 on: May 28, 2012, 02:42:56 PM »
This should work for you...Pretty much the same as James said using the genre = '{1}.


Oh yeah and forgot to mention if you are going to use the the TTS.Stop. You should adjust the command to TTS.Speak {match.2}. Like James stated using TTS.SpeakSync wont work.


Hope this helps

bp_pbs

  • Contributor
  • ***
  • Posts: 94
  • Karma: 1
    • View Profile
Re: Featured Movie / Recommended Movie
« Reply #19 on: May 28, 2012, 03:35:36 PM »
I did find one problem, James hopefully you can help me out. Since c14 consist of all the genres for a particular movie if we use c14='{1}'...(let say genre Action). It only pulls movies that have only Action as their Genre. Movies that have multiple genres such as Action/Adventure etc are not being used.
I have at least 40 children movies but since all have multiple genres none are being pulled.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Featured Movie / Recommended Movie
« Reply #20 on: May 28, 2012, 08:47:58 PM »
I did find one problem, James hopefully you can help me out. Since c14 consist of all the genres for a particular movie if we use c14='{1}'...(let say genre Action). It only pulls movies that have only Action as their Genre. Movies that have multiple genres such as Action/Adventure etc are not being used.
I have at least 40 children movies but since all have multiple genres none are being pulled.
You should be able to use something like this then:

 c14 like '%{1}%'

which basically treats the % symbols as wildcards.  I think using Like also causes it to ignore case.

of course you might occasionally get extra stuff if one genre string is a subset of another genre string, but I don't think it is very likely.  There is probably another way to do it with a more complex sql statement but it would be tricky and probably not really necessary.

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Featured Movie / Recommended Movie
« Reply #21 on: May 28, 2012, 08:54:19 PM »
good work guys...  Very impressed with the fast response...  Am about to give it a try..  Thank you all.. And yes I am sing speaksync.    Wil revert back to speak...  Thanks again.. :D

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Featured Movie / Recommended Movie
« Reply #22 on: May 28, 2012, 10:56:31 PM »
Okay, gave it a try, but I'm just getting the whole... 

How about "Match .1" "Match .2"

Any idea's..???  Tried adding the "Like" option suggested by James but no difference???

Thanks...

bp_pbs

  • Contributor
  • ***
  • Posts: 94
  • Karma: 1
    • View Profile
Re: Featured Movie / Recommended Movie
« Reply #23 on: May 29, 2012, 06:13:14 AM »
Ok reconfigured it. Try this one for now ( will work on it more ). I had to use an IF ELSE statement since Action didn't like % before it. Still not working properly because I'm still having trouble with certain Genres like Family...maybe the way it's stored in the database.

Also I changed the Results.RegEx to Results.RegExSingle. Seems to work better for me so that I wouldn't keep getting that match.2 a lot.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Featured Movie / Recommended Movie
« Reply #24 on: May 29, 2012, 06:34:57 PM »
interesting.  I'm wondering why it doesn't work with Action and Family.  Can you be a bit more precise about how it's not working?

Maybe also send me your genre payload xml file?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Featured Movie / Recommended Movie
« Reply #25 on: May 29, 2012, 07:13:57 PM »
I have kind of figured out what is happening.  the way the url is being encoded varies and it seems that %F and %A are getting changed to some strange characters.

I have found a sort of solution, without having to resort to logic blocks, that seems to work with everything:

queryvideodatabase(select c00,c01 from movie where c14 LIKE '{1}%%' or c14 LIKE '%% {1}%%' order by random() Limit 1)

it is important to note that there is a space after %% in the second like, and this is what prevents %A or %F from being turned into weird characters...

bp_pbs

  • Contributor
  • ***
  • Posts: 94
  • Karma: 1
    • View Profile
Re: Featured Movie / Recommended Movie
« Reply #26 on: May 30, 2012, 01:49:43 AM »
I have kind of figured out what is happening.  the way the url is being encoded varies and it seems that %F and %A are getting changed to some strange characters.

I have found a sort of solution, without having to resort to logic blocks, that seems to work with everything:

queryvideodatabase(select c00,c01 from movie where c14 LIKE '{1}%%' or c14 LIKE '%% {1}%%' order by random() Limit 1)

it is important to note that there is a space after %% in the second like, and this is what prevents %A or %F from being turned into weird characters...

That's weird. I tested your solution and it worked for me as well...like i said before I knew you would find a way... :)

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Featured Movie / Recommended Movie
« Reply #27 on: May 31, 2012, 01:01:43 AM »
For me the system is not responding to 'Family' it seems..

Otherwise all is rather good.  I know I suck at this but seeing I have 600 films or so, would there be a way to also filter for only movies with a rating higher than a certain amount.  I'm just one demanding user I know...

I might make some dedicated playlists and use an alternate command to pick out of a playlist with a high rating threshold.  Though it would be cool to introduce both in to the one command. 

Good work all... 

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Featured Movie / Recommended Movie
« Reply #28 on: May 31, 2012, 05:01:39 AM »
For me the system is not responding to 'Family' it seems..

Otherwise all is rather good.  I know I suck at this but seeing I have 600 films or so, would there be a way to also filter for only movies with a rating higher than a certain amount.  I'm just one demanding user I know...

I might make some dedicated playlists and use an alternate command to pick out of a playlist with a high rating threshold.  Though it would be cool to introduce both in to the one command. 

Good work all... 
I'm not really firm in XBMC, but you can take a look here: http://wiki.xbmc.org/index.php?title=XBMC_databases#Building_SQL_Queries and here http://wiki.xbmc.org/index.php?title=XBMC_databases#movie
You can modify a exist XBMC command ( I think so)
***********  get excited and make things  **********

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Featured Movie / Recommended Movie
« Reply #29 on: May 31, 2012, 06:32:58 AM »
Thanks... That is exactly what I'm looking for...

bp_pbs

  • Contributor
  • ***
  • Posts: 94
  • Karma: 1
    • View Profile
Re: Featured Movie / Recommended Movie
« Reply #30 on: May 31, 2012, 06:40:19 AM »
you should be able to add to the existing query
"and c05 > 6"
c05 being Rating and 6 being the rating of the movie. The rating should go from 1-10

queryvideodatabase(select c00,c01 from movie where c14 LIKE '{1}%%' or c14 LIKE '%% {1}%%' and c05 > 6 order by random() Limit 1)

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Featured Movie / Recommended Movie
« Reply #31 on: June 01, 2012, 10:35:56 PM »
Brilliant.  Thanks for that..  Will give it a try...

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Featured Movie / Recommended Movie
« Reply #32 on: June 02, 2012, 05:37:29 AM »
This works great now, got it only recommending good films...  Returns back the correct page almost all the time...  Good stuff guys...  Will be sharing my natural language config in the coming week..