Koopzington / anitools-backend

Backend for the awc-tools
0 stars 0 forks source link

Overhaul search filtering #2

Open Koopzington opened 4 months ago

Koopzington commented 4 months ago

The filtering right now allows only one filter per type. This isn't a problem until someone wants to be able to filter media by tags with varying minimum tag percentages, e.g. "Male Protagonist" > 60% and "Iyashikei" > 90%. One might want to refactor the filter param to accept a numbered array instead.

params.filter = [
    {
        type: tag,
        tagPercentageMin: 10,
        and: [
            'Male Protagonist'
        ],
        not: [
            'Female Protagonist'
        ]
    },
    {
        type: format,
        and: [
            'TV'
        ]
    }
]