ScanLibrary now respects the library a series belongs to, doesn't reset series every run but updates/removes/inserts as needed.
This commit is contained in:
parent
44ebca36ec
commit
e180032a8e
5 changed files with 54 additions and 29 deletions
|
@ -23,6 +23,11 @@ namespace API.Data
|
|||
_mapper = mapper;
|
||||
}
|
||||
|
||||
public void Add(Series series)
|
||||
{
|
||||
_context.Series.Add(series);
|
||||
}
|
||||
|
||||
public void Update(Series series)
|
||||
{
|
||||
_context.Entry(series).State = EntityState.Modified;
|
||||
|
@ -48,7 +53,15 @@ namespace API.Data
|
|||
return _context.Series.SingleOrDefault(x => x.Name == name);
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<SeriesDto>> GetSeriesDtoForLibraryIdAsync(int libraryId, int userId = 0)
|
||||
public async Task<IEnumerable<Series>> GetSeriesForLibraryIdAsync(int libraryId)
|
||||
{
|
||||
return await _context.Series
|
||||
.Where(s => s.LibraryId == libraryId)
|
||||
.OrderBy(s => s.SortName)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<SeriesDto>> GetSeriesDtoForLibraryIdAsync(int libraryId, int userId)
|
||||
{
|
||||
// if (userId > 0)
|
||||
// {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue