<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    On 1/23/20 8:11 PM, Robby Stephenson wrote:<br>
    <blockquote type="cite"
cite="mid:CACFDV66+ofE_qpiBo6oFb4FjsTPKAs_eS5c97LGOjkoZmBrzug@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">
        <div>Sorry I didn't get a chance to get back to you sooner.</div>
        <br>
        <div class="gmail_quote">
          <div dir="ltr" class="gmail_attr">On Thu, Jan 23, 2020 at 9:01
            PM Jared <<a href="mailto:list-tellico@legroom.net"
              moz-do-not-send="true">list-tellico@legroom.net</a>>
            wrote:<br>
          </div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
            0.8ex;border-left:1px solid
            rgb(204,204,204);padding-left:1ex">
            <div>I've successfully updated 8 games this run, with three
              no matches, and then I ran into the above.  Somehow
              updating not even a dozen games caused 360 requests.<br>
              <br>
              Is Tellico maybe doing a search for a match, then also
              searching for all details of all possible matches before
              it shows you the list of choices?  That would somewhat
              explain the long delays and excessive queries.  Is that
              intended behavior?<br>
            </div>
          </blockquote>
          <div><br>
          </div>
          <div>Yes, that's essentially what's going on. The MobyGames is
            still one of the more rudimentary searches and does title
            searching only at the moment. So an update request uses the
            title of the game being updated, then receives whatever
            results get sent back in the initial request and then grabs
            all the other data to go along with each of those. Then, and
            only then, is when it compares the existing game data
            against every result and decided which one is the best match
            and if the match exceeds the threshold to be valid.</div>
        </div>
      </div>
    </blockquote>
    <br>
    Thanks, Robby.  I do appreciate you looking into this and providing
    some additional details.  Yeah, Moby Games definitely doesn't have
    the most flexible or comprehensive API, but unlike almost every
    other site I've tried to use for this effort (both with and without
    Tellico) it's by far the most consistent in terms of stability and
    availability.  They do win pretty big points for that.  :-)<br>
    <br>
    I was playing around with the API a little more to see if I could
    find any ways to make the workflow of adding new games more
    efficient.  For my initial use case of bulk-loading Tellico, I'm
    creating CSV files with all game and platform names (verifying in
    advance that the platform name I use in the CSV file matches the
    Tellico's hardcoded names), and from there running an Update against
    MobyGames for the newly added games.<br>
    <br>
    Note:  I'm certain you already know most of the details here and
    this is nothing really new, but I figured taking you through my
    thought process here might provide some ideas how to potentially
    make things a little more efficient.<br>
    <br>
    MobyGames does let you include the platform ID with searches, but
    it's not very intuitive.  Best I can tell, you need to provide the
    platform ID rather than name:<br>
    <br>
<a class="moz-txt-link-freetext" href="https://api.mobygames.com/v1/games?api_key=$APIKEY&title=Basketball&platform=28">https://api.mobygames.com/v1/games?api_key=$APIKEY&title=Basketball&platform=28</a><br>
    <br>
    That'll return Basketball titles released for Atari 2600.  You'd
    need some internal mapping of mobygames platform IDs to include that
    with your first search, but it instantly narrows the list of results
    down to the target platform.<br>
    <br>
    In this example two results are returned along with generic release
    details for each, so a pick list can be created from that.  I can
    tell pretty easily that 14905 is the version I want, so a fallow up
    query for that particular version on 2600 returns all of the
    platform-specific release details:<br>
    <br>
<a class="moz-txt-link-freetext" href="https://api.mobygames.com/v1/games/14905/platforms/28?api_key=$APIKEY">https://api.mobygames.com/v1/games/14905/platforms/28?api_key=$APIKEY</a><br>
    <br>
    Followed up with a query for available covers:<br>
    <br>
<a class="moz-txt-link-freetext" href="https://api.mobygames.com/v1/games/14905/platforms/28/covers?api_key=$APIKEY">https://api.mobygames.com/v1/games/14905/platforms/28/covers?api_key=$APIKEY</a><br>
    <br>
    From there I'm sure you have some algorithm to determine which
    covert to pull in order of which preference.  This is getting much
    more advanced now, but it'd be great if I could set it to prefer
    something like "United States , Front Cover, Full Size" so it grabs
    my preferred cover image by default, then falls back to something
    more generic if that's not available.<br>
    <br>
    All told, that's down to 4 queries to search, select, query, and
    pull cover art for the game.  Pretty efficient.  :-)<br>
    <br>
    <br>
    I'm certain I'm being overly simplistic or missing some important
    considerations, but like I said, I though my through what I
    discovered and the thought process behind it may be helpful.<br>
    <br>
    What do you think?  Anything of use here?<br>
    <br>
    -- <br>
    Jared<br>
  </body>
</html>