LezWatch / lwtv-plugin

LezWatch TV Custom Plugin
https://lezwatchtv.com
GNU General Public License v3.0
2 stars 1 forks source link

API: Improve Character Data output #512

Open Ipstenu opened 4 months ago

Ipstenu commented 4 months ago

More and more people want to use the API (yay) but not all the data grew well with the api. This sort of data is not easy to collect:

It's pretty easy to add in all except the last three as we save the TV show identifier by its post ID. But in theory it should be doable to have https://lezwatchtv.com/wp-json/lwtv/v1/stats/characters/ and output something like this:

Aisha Green":{
    "id":87560,
    "died":[""],
    "actors":1,
    "shows":{
        "SHOWNAME1": { 'years_appears', 'role', 'genres', 'airdates' },
        "SHOWNAME1": { 'years_appears', 'role', 'genres', 'airdates' },
    }
    "gender":"Cisgender",
    "sexuality":"Fluid",
    "url":"https:\/\/lezwatchtv.com\/character\/aisha-green\/"
}

The sticking point will be 'genres', 'airdates' since that would need a call back to the show. If that can be cached then yes :)