Provide list of all AKAs mapped to show ids

qdex wrote 4 years ago: 1

I maintain a local cache of shows that is regularly synced with /shows. However I face issues querying this list for alternate show names. For e.g., the show Перевал Дятлова is often found in its anglicized or translated AKA forms: Pereval Dyatlova, or Dead Mountain: The Dyatlov Pass Incident, and so is missing from the show index. While it is always possible to resolve each such anomaly against the online TvMaze API, it would be more convenient to have this list available locally.

tnt wrote 4 years ago: 1

Not sure, what exactly are you suggesting?
AKAs for the show are available through API https://api.tvmaze.com/shows/36964/akas
Keeping the list available locally is totally up to you, you can store it in the database for example.

qdex wrote 4 years ago: 1

@tnt wrote:
AKAs for the show are available through API https://api.tvmaze.com/shows/36964/akas

Only if you know the original name of the show and can translate it into an id by searching the local show cache.

If all you know is one of the AKAs, you won't be able to find the show in the cache and will have to run a search query against the server. I am trying to avoid that for something as basic as the show name.

The alternative is to build the two-way mapping locally by querying /shows/:id/akas once for every show. But that would take half-a-day for 50,000 shows based on rate-limits.

tnt wrote 4 years ago: 1

@qdex wrote:
Only if you know the original name of the show and can translate it into an id by searching the local show cache.

If all you know is one of the AKAs, you won't be able to find the show in the cache and will have to run a search query against the server. I am trying to avoid that for something as basic as the show name.

Well, if you don't want to query the server, you need to have a local copy of everything the server has. Including aka's for each show. 

The alternative is to build the two-way mapping locally by querying /shows/:id/akas once for every show. But that would take half-a-day for 50,000 shows based on rate-limits.

Probably. But you only need to do this once, and then just periodically check for the updates.

I'm not sure it's productive to make an endpoint with 100'000+ entries to list all AKAs for all shows at once.

qdex wrote 4 years ago: 1

@tnt wrote:
Well, if you don't want to query the server, you need to have a local copy of everything the server has. Including aka's for each show. 

It is not that I don't want to. Running 10s or 100s of queries merely to identify shows is very different from running a couple of them to display episode lists or cast and crew information once the show is identified.

The second issue is the search essentially ties you to the current implementation of the server's search algorithm. To give a simple example, 

* "mythic quest: ravens banquet" produces results.

* "mythic quest ravens banquet" does not.

This can be handled with local search using case-specific canonicalization and weightage rules.

@tnt wrote:
Probably. But you only need to do this once, and then just periodically check for the updates.

It is definitely feasible. But I didn't want to hit the server 50,000 times to crawl the entire AKA namespace without asking about alternatives first.

qdex wrote 4 years ago: 1

@david wrote:
No, we don't have any bulk endpoints except for https://www.tvmaze.com/api#show-index. Feel free to crawl /shows/:id/akas for all shows though (it's a lightweight easily cacheable endpoint) :)

Will supplement the local cache that way, then. Thanks.

Try 30 days of free premium.