Scan Bugfixes (#177)

* Added way  more logging for debugging issue #163.

Fixed #175

* Removed some comment that isn't needed

* Fixed a enumeration issue due to removing while enumerating
This commit is contained in:
Joseph Milazzo 2021-04-16 12:21:16 -05:00 committed by GitHub
parent 09a953be8c
commit 2b99c8abfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 47 additions and 38 deletions

View file

@ -17,7 +17,7 @@ namespace API.Data
/// <summary>
/// This will remove any entries that have chapterIds that no longer exists. This will execute the save as well.
/// </summary>
public async Task<bool> CleanupAbandonedChapters()
public async Task<int> CleanupAbandonedChapters()
{
var chapterIds = _context.Chapter.Select(c => c.Id);
@ -26,7 +26,7 @@ namespace API.Data
.ToListAsync();
_context.RemoveRange(rowsToRemove);
return (await _context.SaveChangesAsync()) > 0;
return await _context.SaveChangesAsync() > 0 ? rowsToRemove.Count : 0;
}
}
}