Lots of bug fixes around publishing and handling weird cases on a real manga library. Implemented ability to have Volumes number 0 aka just latest chapters. Refactored DirectoryService code for scanning into it's own service. Lots of debug code, will be cleaned up later.
This commit is contained in:
parent
be6d4f2d09
commit
a057e3ce1d
24 changed files with 589 additions and 472 deletions
|
@ -53,15 +53,6 @@ namespace API.Data
|
|||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<Library> GetLibraryForNameAsync(string libraryName)
|
||||
{
|
||||
return await _context.Library
|
||||
.Where(x => x.Name == libraryName)
|
||||
.Include(f => f.Folders)
|
||||
.Include(s => s.Series)
|
||||
.SingleAsync();
|
||||
}
|
||||
|
||||
public async Task<bool> DeleteLibrary(int libraryId)
|
||||
{
|
||||
var library = await GetLibraryForIdAsync(libraryId);
|
||||
|
|
|
@ -31,13 +31,14 @@ namespace API.Data
|
|||
|
||||
public static async Task SeedSettings(DataContext context)
|
||||
{
|
||||
IList<ServerSetting> defaultSettings = new List<ServerSetting>()
|
||||
{
|
||||
new ServerSetting() {Key = "CacheDirectory", Value = CacheService.CacheDirectory}
|
||||
};
|
||||
|
||||
await context.ServerSetting.AddRangeAsync(defaultSettings);
|
||||
await context.SaveChangesAsync();
|
||||
// NOTE: This needs to check if settings already exists before inserting.
|
||||
// IList<ServerSetting> defaultSettings = new List<ServerSetting>()
|
||||
// {
|
||||
// new ServerSetting() {Key = "CacheDirectory", Value = CacheService.CacheDirectory}
|
||||
// };
|
||||
//
|
||||
// await context.ServerSetting.AddRangeAsync(defaultSettings);
|
||||
// await context.SaveChangesAsync();
|
||||
// await context.ServerSetting.AddAsync(new ServerSetting
|
||||
// {
|
||||
// CacheDirectory = CacheService.CacheDirectory
|
||||
|
|
|
@ -160,7 +160,15 @@ namespace API.Data
|
|||
{
|
||||
return await _context.Volume.SingleOrDefaultAsync(x => x.Id == volumeId);
|
||||
}
|
||||
|
||||
|
||||
public async Task<Series> GetSeriesByIdAsync(int seriesId)
|
||||
{
|
||||
return await _context.Series
|
||||
.Include(s => s.Volumes)
|
||||
.Where(s => s.Id == seriesId)
|
||||
.SingleOrDefaultAsync();
|
||||
}
|
||||
|
||||
private async Task AddSeriesModifiers(int userId, List<SeriesDto> series)
|
||||
{
|
||||
var userProgress = await _context.AppUserProgresses
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue