add matching with year & type

This commit is contained in:
Sofie 2023-07-11 18:49:06 +07:00 committed by GitHub
parent 9237817bd3
commit e278e82ed5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -199,6 +199,8 @@ object APIHolder {
val matchingTypes = types?.any { it.name.equals(media.type, true) } == true
matchingTitles && matchingTypes && matchingYears
} ?: search.results?.find { media ->
(year == null || media.releaseDate == year) && types?.any { it.name.equals(media.type, true) } == true
} ?: return null
Tracker(res.malId, res.aniId, res.image, res.cover)