Searching the API for shows with a period "." in the name

pdavidd wrote 10 years ago: 1

Hello,

First of all, great work on this site and the API. I used to use the TVRage API and, by comparison, this one is MUCH faster.

I have, however, run into a situation with searching for a series by name which I can't find an ideal way to get around.

I've created an app that uses the TVMaze API to download the title of episodes and rename video files accordingly. The app extracts the series name, season number, and episode number from the file name then queries the API for the series data.

The typical format of the video files is to have no spaces in the name, instead they have periods.
Examples: "Adventure.Time.S06E04.720p.HDTV.x264-W4F[rarbg].mkv" or "Marvels.Agents.of.S.H.I.E.L.D.S02E18.720p.HDTV.x264-KILLERS.mkv".

When extracting the series name, my app replaces the periods with spaces. This produces "Adventure Time" and "Marvels Agents of S H I E L D".

The problem is, when searching the TVMaze API for "Marvels Agents of S H I E L D" it produces 0 results. Unfortunately searching for "Marvels.Agents.of.S.H.I.E.L.D" also produces no results.

The searches that DO produce results are "Marvels Agents of S.H.I.E.L.D" and "Marvels Agents of SHIELD". Unfortunately I don't see any way for my app to automatically decide which periods to replace with spaces, which to remove, or which keep as periods.

The possible solutions that I can think of would be
A) To download ALL the series form the API and look through the entire list and compare against a modified version of the series title. This is not ideal of course because it would force me to load the initial data for all the series when I only need a single series. This wastes bandwidth for me and your API.
B) To create a filter in the app to override specific search queries with ones that do return results, i.e.: find "S H I E L D" and replace with "SHIELD". This is not ideal because the filters would have to be manually entered for each type of series that is affected by this situation. This also means that the filters would have to be updated as new series are added which are affected by this situation.

As neither of these solutions are ideal, I am wondering if it would be possible to adjust the search algorithm for the search and single search endpoints to accommodate this type of situation?

Any assistance would be appreciated.

Thanks!

pdavidd wrote 10 years ago: 1

Awesome!

Thanks David.

Try 30 days of free premium.