Polish 4 (#3577)
Co-authored-by: Zeoic <zeorgaming@gmail.com> Co-authored-by: Fesaa <77553571+Fesaa@users.noreply.github.com>
This commit is contained in:
parent
b38400c092
commit
0ffe0228e5
30 changed files with 339 additions and 115 deletions
|
|
@ -19,11 +19,13 @@ public interface IScrobbleRepository
|
|||
void Attach(ScrobbleError error);
|
||||
void Remove(ScrobbleEvent evt);
|
||||
void Remove(IEnumerable<ScrobbleEvent> events);
|
||||
void Remove(IEnumerable<ScrobbleError> errors);
|
||||
void Update(ScrobbleEvent evt);
|
||||
Task<IList<ScrobbleEvent>> GetByEvent(ScrobbleEventType type, bool isProcessed = false);
|
||||
Task<IList<ScrobbleEvent>> GetProcessedEvents(int daysAgo);
|
||||
Task<bool> Exists(int userId, int seriesId, ScrobbleEventType eventType);
|
||||
Task<IEnumerable<ScrobbleErrorDto>> GetScrobbleErrors();
|
||||
Task<IList<ScrobbleError>> GetAllScrobbleErrorsForSeries(int seriesId);
|
||||
Task ClearScrobbleErrors();
|
||||
Task<bool> HasErrorForSeries(int seriesId);
|
||||
Task<ScrobbleEvent?> GetEvent(int userId, int seriesId, ScrobbleEventType eventType);
|
||||
|
|
@ -66,6 +68,11 @@ public class ScrobbleRepository : IScrobbleRepository
|
|||
_context.ScrobbleEvent.RemoveRange(events);
|
||||
}
|
||||
|
||||
public void Remove(IEnumerable<ScrobbleError> errors)
|
||||
{
|
||||
_context.ScrobbleError.RemoveRange(errors);
|
||||
}
|
||||
|
||||
public void Update(ScrobbleEvent evt)
|
||||
{
|
||||
_context.Entry(evt).State = EntityState.Modified;
|
||||
|
|
@ -113,6 +120,13 @@ public class ScrobbleRepository : IScrobbleRepository
|
|||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<IList<ScrobbleError>> GetAllScrobbleErrorsForSeries(int seriesId)
|
||||
{
|
||||
return await _context.ScrobbleError
|
||||
.Where(e => e.SeriesId == seriesId)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task ClearScrobbleErrors()
|
||||
{
|
||||
_context.ScrobbleError.RemoveRange(_context.ScrobbleError);
|
||||
|
|
@ -161,4 +175,5 @@ public class ScrobbleRepository : IScrobbleRepository
|
|||
return await _context.ScrobbleEvent.Where(e => e.SeriesId == seriesId)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue