mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
SearchAPI: Fixing tests of the episode search api
This commit is contained in:
parent
c904f0bf28
commit
6a899e2543
@ -120,13 +120,16 @@ namespace Kyoo.Core.Controllers
|
||||
/// <inheritdoc />
|
||||
public override async Task<ICollection<Episode>> Search(string query)
|
||||
{
|
||||
return await _database.Episodes
|
||||
List<Episode> ret = await _database.Episodes
|
||||
.Include(x => x.Show)
|
||||
.Where(x => x.EpisodeNumber != null || x.AbsoluteNumber != null)
|
||||
.Where(_database.Like<Episode>(x => x.Title, $"%{query}%"))
|
||||
.OrderBy(DefaultSort)
|
||||
.Take(20)
|
||||
.ToListAsync();
|
||||
foreach (Episode ep in ret)
|
||||
ep.Show.Episodes = null;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -338,6 +338,7 @@ namespace Kyoo.Tests.Database
|
||||
};
|
||||
await _repository.Create(value);
|
||||
ICollection<Episode> ret = await _repository.Search(query);
|
||||
value.Show = TestSample.Get<Show>();
|
||||
KAssert.DeepEqual(value, ret.First());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user