Must Contains Filter (#2249)
* Removed docker-compose.yml as it's not used and may confuse users. * Added ability to delete single collections from card actions. Updated transloco library which fixes older iOS browsers not being able to load Kavita. * Added a Must Contains comparison which will make so all values must exist. * Fixed up multiselect dropdowns not reseting value when changing filter field
This commit is contained in:
parent
b5540e58e0
commit
072fadf1de
20 changed files with 210 additions and 87 deletions
|
|
@ -17,6 +17,7 @@ namespace API.Services;
|
|||
public interface ICollectionTagService
|
||||
{
|
||||
Task<bool> TagExistsByName(string name);
|
||||
Task<bool> DeleteTag(CollectionTag tag);
|
||||
Task<bool> UpdateTag(CollectionTagDto dto);
|
||||
Task<bool> AddTagToSeries(CollectionTag? tag, IEnumerable<int> seriesIds);
|
||||
Task<bool> RemoveTagFromSeries(CollectionTag? tag, IEnumerable<int> seriesIds);
|
||||
|
|
@ -49,6 +50,12 @@ public class CollectionTagService : ICollectionTagService
|
|||
return await _unitOfWork.CollectionTagRepository.TagExists(name);
|
||||
}
|
||||
|
||||
public async Task<bool> DeleteTag(CollectionTag tag)
|
||||
{
|
||||
_unitOfWork.CollectionTagRepository.Remove(tag);
|
||||
return await _unitOfWork.CommitAsync();
|
||||
}
|
||||
|
||||
public async Task<bool> UpdateTag(CollectionTagDto dto)
|
||||
{
|
||||
var existingTag = await _unitOfWork.CollectionTagRepository.GetTagAsync(dto.Id);
|
||||
|
|
@ -130,6 +137,7 @@ public class CollectionTagService : ICollectionTagService
|
|||
public async Task<bool> RemoveTagFromSeries(CollectionTag? tag, IEnumerable<int> seriesIds)
|
||||
{
|
||||
if (tag == null) return false;
|
||||
tag.SeriesMetadatas ??= new List<SeriesMetadata>();
|
||||
foreach (var seriesIdToRemove in seriesIds)
|
||||
{
|
||||
tag.SeriesMetadatas.Remove(tag.SeriesMetadatas.Single(sm => sm.SeriesId == seriesIdToRemove));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue