Bulk Add to Collection (#674)
* Fixed the typeahead not having the same size input box as other inputs
* Implemented the ability to add multiple series to a collection through bulk operations flow. Updated book parser to handle "@import url('...');" syntax as well as @import '...';
* Implemented the ability to create a new Collection tag via bulk operations flow.
This commit is contained in:
parent
908c872f5c
commit
52f8fbe3db
31 changed files with 309 additions and 16 deletions
|
|
@ -2,6 +2,7 @@
|
|||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using API.DTOs;
|
||||
using API.DTOs.CollectionTags;
|
||||
using API.Entities;
|
||||
using API.Interfaces.Repositories;
|
||||
using AutoMapper;
|
||||
|
|
@ -21,6 +22,11 @@ namespace API.Data.Repositories
|
|||
_mapper = mapper;
|
||||
}
|
||||
|
||||
public void Add(CollectionTag tag)
|
||||
{
|
||||
_context.CollectionTag.Add(tag);
|
||||
}
|
||||
|
||||
public void Remove(CollectionTag tag)
|
||||
{
|
||||
_context.CollectionTag.Remove(tag);
|
||||
|
|
|
|||
20
API/Data/Repositories/SeriesMetadataRepository.cs
Normal file
20
API/Data/Repositories/SeriesMetadataRepository.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
using API.Entities;
|
||||
using API.Interfaces.Repositories;
|
||||
|
||||
namespace API.Data.Repositories
|
||||
{
|
||||
public class SeriesMetadataRepository : ISeriesMetadataRepository
|
||||
{
|
||||
private readonly DataContext _context;
|
||||
|
||||
public SeriesMetadataRepository(DataContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public void Update(SeriesMetadata seriesMetadata)
|
||||
{
|
||||
_context.SeriesMetadata.Update(seriesMetadata);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ using System.Linq;
|
|||
using System.Threading.Tasks;
|
||||
using API.Data.Scanner;
|
||||
using API.DTOs;
|
||||
using API.DTOs.CollectionTags;
|
||||
using API.DTOs.Filtering;
|
||||
using API.Entities;
|
||||
using API.Extensions;
|
||||
|
|
@ -485,5 +486,13 @@ namespace API.Data.Repositories
|
|||
TotalChunks = totalChunks
|
||||
};
|
||||
}
|
||||
|
||||
public async Task<IList<SeriesMetadata>> GetSeriesMetadataForIdsAsync(IEnumerable<int> seriesIds)
|
||||
{
|
||||
return await _context.SeriesMetadata
|
||||
.Where(sm => seriesIds.Contains(sm.SeriesId))
|
||||
.Include(sm => sm.CollectionTags)
|
||||
.ToListAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ namespace API.Data
|
|||
public IFileRepository FileRepository => new FileRepository(_context);
|
||||
public IChapterRepository ChapterRepository => new ChapterRepository(_context, _mapper);
|
||||
public IReadingListRepository ReadingListRepository => new ReadingListRepository(_context, _mapper);
|
||||
public ISeriesMetadataRepository SeriesMetadataRepository => new SeriesMetadataRepository(_context);
|
||||
|
||||
/// <summary>
|
||||
/// Commits changes to the DB. Completes the open transaction.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue