diff --git a/.dockerignore b/.dockerignore index 133b706..38a093d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,5 @@ **/obj/ **/bin/ **/*.json +**/*.user +**/*.DotSettings diff --git a/src/Numerous.Bot/Osu/MapFeedService.cs b/src/Numerous.Bot/Osu/MapFeedService.cs index 40f261d..f39dd0a 100644 --- a/src/Numerous.Bot/Osu/MapFeedService.cs +++ b/src/Numerous.Bot/Osu/MapFeedService.cs @@ -69,13 +69,14 @@ private async Task CheckForNewBeatmapsetsAsync(CancellationToken ct) var fullSet = await api.GetBeatmapsetAsync(set.Id); var gdMapperIds = fullSet.Beatmaps - .Select(u => u.UserId) - .Where(id => id != fullSet.UserId) - .ToArray(); + .SelectMany(b => b.Owners) + .Where(o => o.Id != fullSet.UserId) + .Select(o => o.Id) + .ToHashSet(); var allMapperOsuIds = gdMapperIds - .Prepend(fullSet.UserId) - .ToArray(); + .Append(fullSet.UserId) + .ToHashSet(); if (allMapperOsuIds.All(id => !osuUserDiscordIdDic.ContainsKey(id))) { @@ -86,7 +87,7 @@ private async Task CheckForNewBeatmapsetsAsync(CancellationToken ct) var allMapperDiscordIds = allMapperOsuIds .Where(osuUserDiscordIdDic.ContainsKey) .Select(osuId => osuUserDiscordIdDic[osuId]) - .ToArray(); + .ToHashSet(); var mapper = osuUserDiscordIdDic.TryGetValue(fullSet.UserId, out var userId) ? $"{MentionUtils.MentionUser(userId)} ({Link.OsuUser(fullSet.UserId, fullSet.Creator)})" diff --git a/src/Numerous.Bot/Web/Osu/Models/ApiBeatmap.cs b/src/Numerous.Bot/Web/Osu/Models/ApiBeatmap.cs index 107fb74..40b5470 100644 --- a/src/Numerous.Bot/Web/Osu/Models/ApiBeatmap.cs +++ b/src/Numerous.Bot/Web/Osu/Models/ApiBeatmap.cs @@ -26,6 +26,19 @@ public record ApiBeatmap [JsonProperty("difficulty_rating")] public required float DifficultyRating { get; init; } + + [JsonProperty("owners")] + public required IReadOnlyCollection Owners { get; init; } + + [JsonObject(MemberSerialization.OptIn)] + public record Owner + { + [JsonProperty("id")] + public required uint Id { get; init; } + + [JsonProperty("username")] + public required string Username { get; init; } + } } public sealed record ApiBeatmapExtended : ApiBeatmap