diff --git a/Kyoo.TheMovieDb/ProviderTmdb.cs b/Kyoo.TheMovieDb/ProviderTmdb.cs index 5085b3b1..08bc36ea 100644 --- a/Kyoo.TheMovieDb/ProviderTmdb.cs +++ b/Kyoo.TheMovieDb/ProviderTmdb.cs @@ -95,7 +95,8 @@ namespace Kyoo.TheMovieDb { if (!show.TryGetID(Provider.Slug, out int id)) { - Show found = (await _SearchShows(show.Title ?? show.Slug)).FirstOrDefault(); + Show found = (await _SearchShows(show.Title ?? show.Slug, show.StartAir?.Year)) + .FirstOrDefault(x => x.IsMovie == show.IsMovie); if (found?.TryGetID(Provider.Slug, out id) != true) return found; } @@ -228,11 +229,12 @@ namespace Kyoo.TheMovieDb /// Search for a show using it's name as a query. /// /// The query to search for + /// The year in witch the show has aired. /// A list of shows containing metadata from TheMovieDb - private async Task> _SearchShows(string query) + private async Task> _SearchShows(string query, int? year = null) { TMDbClient client = new(_apiKey.Value.ApiKey); - return (await client.SearchMultiAsync(query)) + return (await client.SearchMultiAsync(query, year: year ?? 0)) .Results .Select(x => {