mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-06-06 06:45:18 -04:00
A boatload of Bugs (#3704)
Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com>
This commit is contained in:
@@ -15,10 +15,12 @@ public interface IMediaErrorRepository
|
||||
{
|
||||
void Attach(MediaError error);
|
||||
void Remove(MediaError error);
|
||||
void Remove(IList<MediaError> errors);
|
||||
Task<MediaError> Find(string filename);
|
||||
IEnumerable<MediaErrorDto> GetAllErrorDtosAsync();
|
||||
Task<bool> ExistsAsync(MediaError error);
|
||||
Task DeleteAll();
|
||||
Task<List<MediaError>> GetAllErrorsAsync(IList<string> comments);
|
||||
}
|
||||
|
||||
public class MediaErrorRepository : IMediaErrorRepository
|
||||
@@ -44,6 +46,11 @@ public class MediaErrorRepository : IMediaErrorRepository
|
||||
_context.MediaError.Remove(error);
|
||||
}
|
||||
|
||||
public void Remove(IList<MediaError> errors)
|
||||
{
|
||||
_context.MediaError.RemoveRange(errors);
|
||||
}
|
||||
|
||||
public Task<MediaError?> Find(string filename)
|
||||
{
|
||||
return _context.MediaError.Where(e => e.FilePath == filename).SingleOrDefaultAsync();
|
||||
@@ -71,4 +78,11 @@ public class MediaErrorRepository : IMediaErrorRepository
|
||||
_context.MediaError.RemoveRange(await _context.MediaError.ToListAsync());
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
public Task<List<MediaError>> GetAllErrorsAsync(IList<string> comments)
|
||||
{
|
||||
return _context.MediaError
|
||||
.Where(m => comments.Contains(m.Comment))
|
||||
.ToListAsync();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user