Scrobbling Stability (#3863)

Co-authored-by: Amelia <77553571+Fesaa@users.noreply.github.com>
This commit is contained in:
Joe Milazzo 2025-06-20 14:09:29 -05:00 committed by GitHub
parent 45e24aa311
commit 14a8f5c1e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 1622 additions and 806 deletions

View file

@ -254,7 +254,7 @@ public class ScrobblingController : BaseApiController
}
/// <summary>
/// Adds a hold against the Series for user's scrobbling
/// Remove a hold against the Series for user's scrobbling
/// </summary>
/// <param name="seriesId"></param>
/// <returns></returns>
@ -281,4 +281,18 @@ public class ScrobblingController : BaseApiController
var user = await _unitOfWork.UserRepository.GetUserByIdAsync(User.GetUserId());
return Ok(user is {HasRunScrobbleEventGeneration: true});
}
/// <summary>
/// Delete the given scrobble events if they belong to that user
/// </summary>
/// <param name="eventIds"></param>
/// <returns></returns>
[HttpPost("bulk-remove-events")]
public async Task<ActionResult> BulkRemoveScrobbleEvents(IList<long> eventIds)
{
var events = await _unitOfWork.ScrobbleRepository.GetUserEvents(User.GetUserId(), eventIds);
_unitOfWork.ScrobbleRepository.Remove(events);
await _unitOfWork.CommitAsync();
return Ok();
}
}