title: Understanding two-button ratings implementation
body: <p>I'm in the midst of implementing two-button ratings on our platform and I'm tearing my hair out on some of the finer details.</p>
  
  <p>Firstly, I've really tried here to explain the trouble I'm having succinctly!</p>
  
  <p>We have three states handled and returned via the <code>rateItem</code> and <code>getExtendedMetadata</code> endpoints and users can move between the three states:</p>
  
  <blockquote>
    <p>0 - Unrated<br>
    1 - Up voted<br>
    2 - Down voted</p>
  </blockquote>
  
  <p>So <code>rateItem</code> accepts one of those three options.</p>
  
  <p>Looking at the <a href="http://musicpartners.sonos.com/node/368" rel="nofollow">documentation</a>, my presentation map should be along these lines.</p>
  
  <pre><code> &lt;Match propname="vote" value="0"&gt;
    &lt;!-- the track is unrated --&gt;
    &lt;Ratings&gt;
     &lt;Rating AutoSkip="NEVER" Id="1" StringId="VoteUp" OnSuccessStringId="VoteUpSuccess"&gt;
      ...
     &lt;/Rating&gt;
     &lt;Rating AutoSkip="ALWAYS" Id="0" StringId="VoteDown" OnSuccessStringId="VoteDownSuccess"&gt;
      ...
     &lt;/Rating&gt;
    &lt;/Ratings&gt;
   &lt;/Match&gt;
   &lt;Match propname="vote" value="1"&gt;
    &lt;!-- the track is rated thumbs up --&gt;
    &lt;Ratings&gt;
     &lt;Rating AutoSkip="NEVER" Id="3" StringId="VoteUp" OnSuccessStringId="VoteUpSuccess"&gt;
      ...
     &lt;/Rating&gt;
     &lt;Rating AutoSkip="ALWAYS" Id="2" StringId="VoteDown" OnSuccessStringId="VoteDownSuccess"&gt;
      ...
     &lt;/Rating&gt;
    &lt;/Ratings&gt;
   &lt;/Match&gt;
   &lt;Match propname="vote" value="2"&gt;
    &lt;!-- the track is rated thumbs down --&gt;
    &lt;Ratings&gt;
     &lt;Rating AutoSkip="NEVER" Id="5" StringId="VoteUp" OnSuccessStringId="VoteUpSuccess"&gt;
      ...
     &lt;/Rating&gt;
     &lt;Rating AutoSkip="ALWAYS" Id="6" StringId="VoteDown" OnSuccessStringId="VoteDownSuccess"&gt;
      ...
     &lt;/Rating&gt;
    &lt;/Ratings&gt;
   &lt;/Match&gt;
  </code></pre>
  
  <p>This is where I start to get into trouble. The <code>&lt;Match ... value="X"&gt;</code> elements appear to be fine and match what my data shows. <strong>But when the buttons are clicked, the <code>rateItem</code> endpoint appears to receive IDs 0 through 6.</strong> (ID 4 is missing in the example?)</p>
  
  <p>The documentation states:</p>
  
  <blockquote>
    <p>Id (int) This is the value that will be passed to the rateItem method.  The Id must be unique for the given property name.</p>
  </blockquote>
  
  <p>So, to combat this, I've modified my presentation map so that the IDs sent from the 0 Match property are 1 and 2 (up and down voted). There's then a 1 Match property that links to 0 and 2, and a 2 that links to 0 and 1. Here's where I'm at:</p>
  
  <pre><code> &lt;Match propname="vote" value="0"&gt;
    &lt;!-- the track is unrated --&gt;
    &lt;Ratings&gt;
     &lt;Rating AutoSkip="NEVER" Id="1" StringId="VoteUp" OnSuccessStringId="VoteUpSuccess"&gt;
      ...
     &lt;/Rating&gt;
     &lt;Rating AutoSkip="NEVER" Id="2" StringId="VoteDown" OnSuccessStringId="VoteDownSuccess"&gt;
      ...
     &lt;/Rating&gt;
    &lt;/Ratings&gt;
   &lt;/Match&gt;
   &lt;Match propname="vote" value="1"&gt;
    &lt;!-- the track is rated thumbs up --&gt;
    &lt;Ratings&gt;
     &lt;Rating AutoSkip="NEVER" Id="0" StringId="VoteUpCancel" OnSuccessStringId="VoteUpCancelSuccess"&gt;
      ...
     &lt;/Rating&gt;
     &lt;Rating AutoSkip="NEVER" Id="2" StringId="VoteDown" OnSuccessStringId="VoteDownSuccess"&gt;
      ...
     &lt;/Rating&gt;
    &lt;/Ratings&gt;
   &lt;/Match&gt;
   &lt;Match propname="vote" value="2"&gt;
    &lt;!-- the track is rated thumbs down --&gt;
    &lt;Ratings&gt;
     &lt;Rating AutoSkip="NEVER" Id="1" StringId="VoteUp" OnSuccessStringId="VoteUpSuccess"&gt;
      ...
     &lt;/Rating&gt;
     &lt;Rating AutoSkip="NEVER" Id="0" StringId="VoteDownCancel" OnSuccessStringId="VoteDownCancelSuccess"&gt;
      ...
     &lt;/Rating&gt;
    &lt;/Ratings&gt;
   &lt;/Match&gt;
  </code></pre>
  
  <p>Note the String IDs are updated too and I'm confident my strings file and images are fine.</p>
  
  <p>This makes sense to me, but is really throwing out my images and alerts and I have varying results on different platforms (tested so far on iOS and Mac controllers).</p>
  
  <p>At this point, can anyone offer any suggestions? I'm hoping I've made enough sense here! I'd very much appreciate any tips anyone can provide.</p>