1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 18:42:56 +08:00

Merge pull request #31940 from bdach/notify-discussion-replies

Send "notify on discussion replies" setting value in beatmap creation request
This commit is contained in:
Dean Herbert 2025-02-19 23:13:12 +09:00 committed by GitHub
commit a971013d19
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 17 additions and 8 deletions

View File

@ -11,6 +11,7 @@ using osu.Framework.IO.Network;
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
{
@ -42,22 +43,27 @@ namespace osu.Game.Online.API.Requests
[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()

View File

@ -13,6 +13,7 @@ namespace osu.Game.Online
SpectatorUrl = "https://spectator.ppy.sh/spectator";
MultiplayerUrl = "https://spectator.ppy.sh/multiplayer";
MetadataUrl = "https://spectator.ppy.sh/metadata";
BeatmapSubmissionServiceUrl = "https://bss.ppy.sh";
}
}
}

View File

@ -192,8 +192,8 @@ namespace osu.Game.Screens.Edit.Submission
(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 =>
{

View File

@ -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>();
}
}

View File

@ -28,7 +28,7 @@ namespace osu.Game.Screens.Edit.Submission
[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
@ -47,7 +47,7 @@ namespace osu.Game.Screens.Edit.Submission
new FormCheckBox
{
Caption = BeatmapSubmissionStrings.NotifyOnDiscussionReplies,
Current = notifyOnDiscussionReplies,
Current = settings.NotifyOnDiscussionReplies,
},
new FormCheckBox
{