batch add

Jared list-tellico at legroom.net
Fri Jan 24 05:35:24 GMT 2020


On 1/23/20 8:11 PM, Robby Stephenson wrote:
> Sorry I didn't get a chance to get back to you sooner.
>
> On Thu, Jan 23, 2020 at 9:01 PM Jared <list-tellico at legroom.net
> <mailto:list-tellico at legroom.net>> wrote:
>
>     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.
>
>     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?
>
>
> 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.

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.  :-)

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.

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.

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:

https://api.mobygames.com/v1/games?api_key=$APIKEY&title=Basketball&platform=28

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.

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:

https://api.mobygames.com/v1/games/14905/platforms/28?api_key=$APIKEY

Followed up with a query for available covers:

https://api.mobygames.com/v1/games/14905/platforms/28/covers?api_key=$APIKEY

>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.

All told, that's down to 4 queries to search, select, query, and pull
cover art for the game.  Pretty efficient.  :-)


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.

What do you think?  Anything of use here?

-- 
Jared
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/tellico-users/attachments/20200123/399792c8/attachment-0001.html>


More information about the tellico-users mailing list