Sunday, 5 May 2013

Clean your XBMC library using one of the coloured buttons on your MCE remote

I frequently purge my video library on my Synology NAS and needed a quick and easy way to clean the video library. I tried the automatic method but this comes with a caveat. If your library isn't quite ready when the clean-up starts, your entire library gets deleted. Got burnt twice so have instigated the button push method below under Openelec 3.0.2.

  1. SSH into Openelec using something like WinSCP
  2. Navigate to /usr/share/xbmc/system/keymaps/ and copy the remote.xml file to your local machine
  3. Using Wordpad (or any XML editor) search (F3) for 'Red' and edit the global section so you have whatever coloured button you want to clean the library and if you want, another to update the video library e.g:

    <green>XBMC.CleanLibrary(video)</green>
    <blue>XBMC.UpdateLibrary(video)</blue>

    Section will look like this:

    <keymap>
      <global>
        <remote>
          <play>Play</play>
          <pause>Pause</pause>
          <stop>Stop</stop>
          <forward>FastForward</forward>
          <reverse>Rewind</reverse>
          <left>Left</left>
          <right>Right</right>
          <up>Up</up>
          <down>Down</down>
          <select>Select</select>
          <enter>FullScreen</enter>
          <pageplus>PageUp</pageplus>
          <pageminus>PageDown</pageminus>
          <back>Back</back>
          <menu>PreviousMenu</menu>
          <title>ContextMenu</title>
          <info>Info</info>
          <skipplus>SkipNext</skipplus>
          <skipminus>SkipPrevious</skipminus>
          <display>FullScreen</display>
          <start>PreviousMenu</start>
          <record>Screenshot</record>
          <volumeplus>VolumeUp</volumeplus>
          <volumeminus>VolumeDown</volumeminus>
          <mute>Mute</mute>
          <power>XBMC.ShutDown()</power>
          <myvideo>XBMC.ActivateWindow(MyVideos)</myvideo>
          <mymusic>XBMC.ActivateWindow(MyMusic)</mymusic>
          <mypictures>XBMC.ActivateWindow(MyPictures)</mypictures>
          <mytv>XBMC.ActivateWindow(MyPVR)</mytv>
          <guide>XBMC.ActivateWindowAndFocus(MyPVR, 31,0, 10,0)</guide>
          <livetv>XBMC.ActivateWindowAndFocus(MyPVR, 32,0, 11,0)</livetv>
          <liveradio>XBMC.ActivateWindowAndFocus(MyPVR, 33,0, 12,0)</liveradio>
          <recordedtv>XBMC.ActivateWindowAndFocus(MyPVR, 34,0, 13,0)</recordedtv>
          <epgsearch>XBMC.ActivateWindowAndFocus(MyPVR, 35,0, 14,0)</epgsearch>
          <red>XBMC.ActivateWindow(MyPVR)</red>
          <green>XBMC.CleanLibrary(video)</green>
          <yellow>XBMC.ActivateWindow(MyMusic)</yellow>
          <blue>XBMC.UpdateLibrary(video)</blue>

          <zero>Number0</zero>
          <one>Number1</one>
          <two>JumpSMS2</two>
          <three>JumpSMS3</three>
          <four>JumpSMS4</four>
          <five>JumpSMS5</five>
          <six>JumpSMS6</six>
          <seven>JumpSMS7</seven>
          <eight>JumpSMS8</eight>
          <nine>JumpSMS9</nine>
        </remote>
  4. Using SMB, you can now navigate to \\OPENELEC\Userdata\keymaps\ and pop the newly edited 'remote.xml' file in there.
  5. Reboot.
You can now use those coloured buttons on your MCE remote to manage your video library.

N.B My remote is one of the OrigenAE RC197 remotes that has the coloured buttons at the bottom. The OrigenAE one (if you can find it), also has a TV button you can program along with volume buttons that can learn your stereo commands. I highly recommend it. You can get clones on eBay. Just make sure you order the one with the coloured buttons at the bottom as some don't have these. Works flawlessly with XBMC on Openelec.