Skip to content

Commit

Permalink
Merge pull request #31940 from bdach/notify-discussion-replies
Browse files Browse the repository at this point in the history
Send "notify on discussion replies" setting value in beatmap creation request
  • Loading branch information
peppy authored Feb 19, 2025
2 parents 7566da8 + aa9e1ac commit a971013
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
14 changes: 10 additions & 4 deletions osu.Game/Online/API/Requests/PutBeatmapSetRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using osu.Framework.Localisation;
using osu.Game.Localisation;
using osu.Game.Online.API.Requests.Responses;
using osu.Game.Screens.Edit.Submission;

namespace osu.Game.Online.API.Requests
{
Expand Down Expand Up @@ -42,22 +43,27 @@ protected override string Uri
[JsonProperty("target")]
public BeatmapSubmissionTarget SubmissionTarget { get; init; }

[JsonProperty("notify_on_discussion_replies")]
public bool NotifyOnDiscussionReplies { get; init; }

private PutBeatmapSetRequest()
{
}

public static PutBeatmapSetRequest CreateNew(uint beatmapCount, BeatmapSubmissionTarget target) => new PutBeatmapSetRequest
public static PutBeatmapSetRequest CreateNew(uint beatmapCount, BeatmapSubmissionSettings settings) => new PutBeatmapSetRequest
{
BeatmapsToCreate = beatmapCount,
SubmissionTarget = target,
SubmissionTarget = settings.Target.Value,
NotifyOnDiscussionReplies = settings.NotifyOnDiscussionReplies.Value,
};

public static PutBeatmapSetRequest UpdateExisting(uint beatmapSetId, IEnumerable<uint> beatmapsToKeep, uint beatmapsToCreate, BeatmapSubmissionTarget target) => new PutBeatmapSetRequest
public static PutBeatmapSetRequest UpdateExisting(uint beatmapSetId, IEnumerable<uint> beatmapsToKeep, uint beatmapsToCreate, BeatmapSubmissionSettings settings) => new PutBeatmapSetRequest
{
BeatmapSetID = beatmapSetId,
BeatmapsToKeep = beatmapsToKeep.ToArray(),
BeatmapsToCreate = beatmapsToCreate,
SubmissionTarget = target,
SubmissionTarget = settings.Target.Value,
NotifyOnDiscussionReplies = settings.NotifyOnDiscussionReplies.Value,
};

protected override WebRequest CreateWebRequest()
Expand Down
1 change: 1 addition & 0 deletions osu.Game/Online/ProductionEndpointConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public ProductionEndpointConfiguration()
SpectatorUrl = "https://spectator.ppy.sh/spectator";
MultiplayerUrl = "https://spectator.ppy.sh/multiplayer";
MetadataUrl = "https://spectator.ppy.sh/metadata";
BeatmapSubmissionServiceUrl = "https://bss.ppy.sh";
}
}
}
4 changes: 2 additions & 2 deletions osu.Game/Screens/Edit/Submission/BeatmapSubmissionScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ private void createBeatmapSet()
(uint)Beatmap.Value.BeatmapSetInfo.OnlineID,
Beatmap.Value.BeatmapSetInfo.Beatmaps.Where(b => b.OnlineID > 0).Select(b => (uint)b.OnlineID).ToArray(),
(uint)Beatmap.Value.BeatmapSetInfo.Beatmaps.Count(b => b.OnlineID <= 0),
settings.Target.Value)
: PutBeatmapSetRequest.CreateNew((uint)Beatmap.Value.BeatmapSetInfo.Beatmaps.Count, settings.Target.Value);
settings)
: PutBeatmapSetRequest.CreateNew((uint)Beatmap.Value.BeatmapSetInfo.Beatmaps.Count, settings);

createRequest.Success += async response =>
{
Expand Down
2 changes: 2 additions & 0 deletions osu.Game/Screens/Edit/Submission/BeatmapSubmissionSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ namespace osu.Game.Screens.Edit.Submission
public class BeatmapSubmissionSettings
{
public Bindable<BeatmapSubmissionTarget> Target { get; } = new Bindable<BeatmapSubmissionTarget>();

public Bindable<bool> NotifyOnDiscussionReplies { get; } = new Bindable<bool>();
}
}
4 changes: 2 additions & 2 deletions osu.Game/Screens/Edit/Submission/ScreenSubmissionSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public partial class ScreenSubmissionSettings : WizardScreen
[BackgroundDependencyLoader]
private void load(OsuConfigManager configManager, OsuColour colours, BeatmapSubmissionSettings settings)
{
configManager.BindWith(OsuSetting.EditorSubmissionNotifyOnDiscussionReplies, notifyOnDiscussionReplies);
configManager.BindWith(OsuSetting.EditorSubmissionNotifyOnDiscussionReplies, settings.NotifyOnDiscussionReplies);
configManager.BindWith(OsuSetting.EditorSubmissionLoadInBrowserAfterSubmission, loadInBrowserAfterSubmission);

Content.Add(new FillFlowContainer
Expand All @@ -47,7 +47,7 @@ private void load(OsuConfigManager configManager, OsuColour colours, BeatmapSubm
new FormCheckBox
{
Caption = BeatmapSubmissionStrings.NotifyOnDiscussionReplies,
Current = notifyOnDiscussionReplies,
Current = settings.NotifyOnDiscussionReplies,
},
new FormCheckBox
{
Expand Down

0 comments on commit a971013

Please sign in to comment.