Author Topic: Browse specific movie genre  (Read 6156 times)

0 Members and 1 Guest are viewing this topic.

sirs2k

  • Jr. Member
  • **
  • Posts: 24
  • Karma: 0
    • View Profile
Browse specific movie genre
« on: June 03, 2014, 12:36:29 PM »
Hey guys,

I would like to be able to browse a specific movie genre on command. For example I feel like watching a horror movie "show horror movies"

Same thing would go for music hopefully "play some rock"

Thanks in advance
« Last Edit: June 03, 2014, 01:49:40 PM by sirs2k »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Browse specific movie genre
« Reply #1 on: June 03, 2014, 02:02:27 PM »
Same thing would go for music hopefully "play some rock"

Assuming your music is reasonably tagged, you can create this command quite easily by cloning a similar command and changing the parameter to genreid rather than, say artistid, and then pointing to the genres payload xml file.

To figure this out for you, I started with the "Play album" command in the standard XBMC configuration, and went from there:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 1.9.3.3-->
<command id="486" name="Play Genre {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Playlist.Clear</param>
      <param>"playlistid": 0</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Playlist.Add</param>
      <param>"playlistid": 0,  "item": {"genreid": {1}}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Player.Open</param>
      <param>"item": {"playlistid": 0}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>GUI.ActivateWindow</param>
      <param>"window": "musicplaylist"</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Play</phrase>
  <phrase>genre, me some</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\xbmcGenres.xml</payloadFromXML>
</command>

... The only media I have is music, so I can't help with the movie genres, but perhaps you can try a similar problem-solving approach based on the existing commands and the XBMC documentation (http://wiki.xbmc.org/index.php?title=JSON-RPC_API/v6).

If you generate your XBMC payload xml using the Xsql plugin, you likely already have a xbmcVideoGenres.xml file in your XbmcPayloads folder.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

sirs2k

  • Jr. Member
  • **
  • Posts: 24
  • Karma: 0
    • View Profile
Re: Browse specific movie genre
« Reply #2 on: June 03, 2014, 02:46:29 PM »
Believe me if I'm not completely stuck I wouldn't post a thread.

You're right, I do have xbmcVideoGenres.xml in the XbmcPayloads folder, but it's empty for some reason.
I'm sure there are genres in my XBMC

Appreciate the help as always.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Browse specific movie genre
« Reply #3 on: June 03, 2014, 03:10:57 PM »
Sorry, I just realized that's a shell payload file or something. You'd have to go into the xSql plugin and add a line (see attached image) to generate the genre payload file.

I'm not an XBMC user really, so maybe someone else can help with the command syntax if you run out of luck on your own.
« Last Edit: June 03, 2014, 03:13:28 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Browse specific movie genre
« Reply #4 on: June 03, 2014, 04:47:35 PM »
I would like to be able to browse a specific movie genre on command. For example I feel like watching a horror movie "show horror movies"

Try:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 1.9.3.3-->
<command id="809" name="Find/Browse Genre {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>GUI.ActivateWindow</param>
      <param>"window": "video", "parameters": [ "videodb://1/1/{1}/" ]</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Show</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\xbmcVideoGenres.xml</payloadFromXML>
  <phrase>movies, films, videos, titles</phrase>
</command>

For future reference for anyone trying to figure out their own commands:

To figure this out, I followed James's advice regarding the XBMC favourites.xml file: http://voxcommando.com/forum/index.php?topic=1435.msg12440#msg12440.

I then compared the info in the favourites.xml file to my VC XBMC command tree, and the syntax looked the same as the "Find/Browse TV Show {1}" command, so I cloned that and changed it slightly to point to the video library subsection that was listed in my favourites file. Seems to work.

TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

sirs2k

  • Jr. Member
  • **
  • Posts: 24
  • Karma: 0
    • View Profile
Re: Browse specific movie genre
« Reply #5 on: June 04, 2014, 01:02:35 AM »
It works great nime5ter!

Sorry I hadn't seen that comment by James, it definitely simplifies things.

Thank you so much for your help

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Browse specific movie genre
« Reply #6 on: June 04, 2014, 09:08:34 AM »
Glad to hear it. I learned a few things about XBMC in the process, so we both got something out of it.  :biglaugh

The forum has lots of great info, but it can be hard to find it.

That's why I usually explain my methods rather than just posting xml. Not to be pointlessly didactic, but in the hopes that re-broadcasting useful solutions will help more users.

(Needs of the many vs. needs of the one, and all that.)
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

Casmo

  • $upporter
  • Contributor
  • *****
  • Posts: 85
  • Karma: 0
    • View Profile
Re: Browse specific movie genre
« Reply #7 on: June 04, 2014, 04:10:04 PM »
Hi

 Nime5sters 'play some rock' code above; Been trying to figure out how i might tweak it so that it's plays a playlist of songs instead of albums. I'm sure Im Missing something very obvious, someone put me out of my misery?

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Browse specific movie genre
« Reply #8 on: June 04, 2014, 05:07:50 PM »
You could set the playlist to shuffle. I've done it below using SetShuffle. Weirdly, there's supposed to be a Boolean shuffle option for the Player.Open method, but I can't get that to work. This seems to work though.

Figured out the syntax for the Player.Open shuffle option. Code below is revised from earlier post.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 1.9.3.3-->
<command id="548" name="Play Genre {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Playlist.Clear</param>
      <param>"playlistid": 0</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Playlist.Add</param>
      <param>"playlistid": 0,  "item": {"genreid": {1}}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Player.Open</param>
      <param>"item": {"playlistid": 0}, "options": {"shuffled":true}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>GUI.ActivateWindow</param>
      <param>"window": "musicplaylist"</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Play</phrase>
  <phrase>genre, me some</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\xbmcGenres.xml</payloadFromXML>
</command>
« Last Edit: June 04, 2014, 08:40:02 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Browse specific movie genre
« Reply #9 on: June 05, 2014, 09:23:02 AM »
Been trying to figure out how i might tweak it so that it's plays a playlist of songs instead of albums.

btw, I'm just guessing here that by "playlist of songs instead of albums" you meant that you want to hear a mix of songs from alternating artists. The original command should still have generated a playlist of songs for you -- it's just that it may have loaded the songs album by album because that's how they're ordered in the database or whatnot, which is why turning on shuffle should work.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)