Small fixes (#2224)
* Replaced normal dropdowns with select2 (which will eventually replace our custom typeaheads). Still needs styling. * More css * Styling. Fixed preloading typeahead with multiple options on load. * Styling to align with typeahead tag badges. * Done with filtering story. * Fixed a bug with switching between filters. * Fixed some extra } from localization * [skip ci] Translated using Weblate (Spanish) Currently translated at 71.3% (1058 of 1483 strings) Translation: Kavita/ui Translate-URL: https://hosted.weblate.org/projects/kavita/ui/es/ * [skip ci] Translated using Weblate (Dutch) Currently translated at 59.2% (879 of 1483 strings) Translation: Kavita/ui Translate-URL: https://hosted.weblate.org/projects/kavita/ui/nl/ * Translated using Weblate (Thai) Currently translated at 100.0% (160 of 160 strings) Translation: Kavita/backend Translate-URL: https://hosted.weblate.org/projects/kavita/backend/th/ * [skip ci] Translated using Weblate (Chinese (Simplified)) Currently translated at 99.9% (1482 of 1483 strings) Translation: Kavita/ui Translate-URL: https://hosted.weblate.org/projects/kavita/ui/zh_Hans/ * [skip ci] Translated using Weblate (Chinese (Simplified)) Currently translated at 99.9% (1482 of 1483 strings) Translation: Kavita/ui Translate-URL: https://hosted.weblate.org/projects/kavita/ui/zh_Hans/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 96.8% (155 of 160 strings) Translation: Kavita/backend Translate-URL: https://hosted.weblate.org/projects/kavita/backend/zh_Hans/ * Translated using Weblate (Chinese (Simplified)) Currently translated at 96.8% (155 of 160 strings) Translation: Kavita/backend Translate-URL: https://hosted.weblate.org/projects/kavita/backend/zh_Hans/ * [skip ci] Translated using Weblate (Thai) Currently translated at 27.2% (404 of 1483 strings) Translation: Kavita/ui Translate-URL: https://hosted.weblate.org/projects/kavita/ui/th/ * Translated using Weblate (Portuguese) Currently translated at 100.0% (160 of 160 strings) Translation: Kavita/backend Translate-URL: https://hosted.weblate.org/projects/kavita/backend/pt/ * [skip ci] Translated using Weblate (Portuguese) Currently translated at 55.3% (821 of 1483 strings) Translation: Kavita/ui Translate-URL: https://hosted.weblate.org/projects/kavita/ui/pt/ * [skip ci] Translated using Weblate (Japanese) Currently translated at 2.0% (30 of 1483 strings) Translation: Kavita/ui Translate-URL: https://hosted.weblate.org/projects/kavita/ui/ja/ * [skip ci] Translated using Weblate (Portuguese (Brazil)) Currently translated at 82.1% (1218 of 1483 strings) Translation: Kavita/ui Translate-URL: https://hosted.weblate.org/projects/kavita/ui/pt_BR/ * [skip ci] Translated using Weblate (Chinese (Simplified)) Currently translated at 99.9% (1482 of 1483 strings) Translation: Kavita/ui Translate-URL: https://hosted.weblate.org/projects/kavita/ui/zh_Hans/ * [skip ci] Translated using Weblate (Turkish) Currently translated at 7.6% (113 of 1483 strings) Translation: Kavita/ui Translate-URL: https://hosted.weblate.org/projects/kavita/ui/tr/ * [skip ci] Translated using Weblate (Portuguese) Currently translated at 62.7% (930 of 1483 strings) Translation: Kavita/ui Translate-URL: https://hosted.weblate.org/projects/kavita/ui/pt/ * [skip ci] Translated using Weblate (Italian) Currently translated at 26.0% (387 of 1483 strings) Translation: Kavita/ui Translate-URL: https://hosted.weblate.org/projects/kavita/ui/it/ * [skip ci] Translated using Weblate (Portuguese) Currently translated at 68.3% (1013 of 1483 strings) Translation: Kavita/ui Translate-URL: https://hosted.weblate.org/projects/kavita/ui/pt/ * Added translation using Weblate (Czech) * [skip ci] Added translation using Weblate (Czech) * Some files got left off last release * Fixed on deck prefilter * Fixed a sizing issue on list item and brought the columns in on series detail as well. --------- Co-authored-by: gallegonovato <fran-carro@hotmail.es> Co-authored-by: Hans Kalisvaart <hans.kalisvaart@gmail.com> Co-authored-by: AlienHack <the4got10@windowslive.com> Co-authored-by: 书签 <shuqian.emu@gmail.com> Co-authored-by: 周書丞 <tmrsm_chan@hotmail.com> Co-authored-by: Duarte Silva <smallflake@protonmail.com> Co-authored-by: Andre Smith <andrepsmithjr@gmail.com> Co-authored-by: Havokdan <havokdan@yahoo.com.br> Co-authored-by: xe1st <dnzkckali@gmail.com> Co-authored-by: Tomas Battistini <tomas.battistini@gmail.com> Co-authored-by: Jiří Heger <jiri.heger@gmail.com>
This commit is contained in:
parent
e1e6d676bb
commit
fc13fcff29
5 changed files with 77 additions and 8 deletions
|
@ -14,6 +14,7 @@ using API.DTOs.SeriesDetail;
|
|||
using API.Entities;
|
||||
using API.Extensions;
|
||||
using API.Extensions.QueryExtensions;
|
||||
using API.Extensions.QueryExtensions.Filtering;
|
||||
using AutoMapper;
|
||||
using AutoMapper.QueryableExtensions;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
|
@ -389,10 +390,11 @@ public class UserRepository : IUserRepository
|
|||
.ToListAsync();
|
||||
|
||||
var queryString = filterStatement.Value.ToNormalized();
|
||||
var filterSeriesQuery = query.Join(_context.Series, b => b.SeriesId, s => s.Id, (bookmark, series) => new
|
||||
var filterSeriesQuery = query.Join(_context.Series, b => b.SeriesId, s => s.Id,
|
||||
(bookmark, series) => new BookmarkSeriesPair()
|
||||
{
|
||||
bookmark,
|
||||
series
|
||||
bookmark = bookmark,
|
||||
series = series
|
||||
});
|
||||
|
||||
switch (filterStatement.Comparison)
|
||||
|
@ -441,14 +443,21 @@ public class UserRepository : IUserRepository
|
|||
break;
|
||||
}
|
||||
|
||||
query = filterSeriesQuery.Select(o => o.bookmark);
|
||||
|
||||
|
||||
return await query
|
||||
return await ApplyLimit(filterSeriesQuery
|
||||
.Sort(filter.SortOptions)
|
||||
.AsSplitQuery(), filter.LimitTo)
|
||||
.Select(o => o.bookmark)
|
||||
.ProjectTo<BookmarkDto>(_mapper.ConfigurationProvider)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
private static IQueryable<BookmarkSeriesPair> ApplyLimit(IQueryable<BookmarkSeriesPair> query, int limit)
|
||||
{
|
||||
return limit <= 0 ? query : query.Take(limit);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fetches the UserId by API Key. This does not include any extra information
|
||||
/// </summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue