Fix beatmap update button not respecting user "prefer no video" setting

Closes #20701.
This commit is contained in:
Dean Herbert
2022-10-11 11:29:17 +09:00
parent 5a43cb6bb2
commit a44ba579c5
2 changed files with 9 additions and 3 deletions

View File

@ -45,7 +45,7 @@ namespace osu.Game.Database
public bool Download(T model, bool minimiseDownloadSize = false) => Download(model, minimiseDownloadSize, null); public bool Download(T model, bool minimiseDownloadSize = false) => Download(model, minimiseDownloadSize, null);
public void DownloadAsUpdate(TModel originalModel) => Download(originalModel, false, originalModel); public void DownloadAsUpdate(TModel originalModel, bool minimiseDownloadSize) => Download(originalModel, minimiseDownloadSize, originalModel);
protected bool Download(T model, bool minimiseDownloadSize, TModel? originalModel) protected bool Download(T model, bool minimiseDownloadSize, TModel? originalModel)
{ {

View File

@ -2,12 +2,14 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Configuration;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
@ -43,11 +45,15 @@ namespace osu.Game.Screens.Select.Carousel
Origin = Anchor.CentreLeft; Origin = Anchor.CentreLeft;
} }
private Bindable<bool> preferNoVideo = null!;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load(OsuConfigManager config)
{ {
const float icon_size = 14; const float icon_size = 14;
preferNoVideo = config.GetBindable<bool>(OsuSetting.PreferNoVideo);
Content.Anchor = Anchor.CentreLeft; Content.Anchor = Anchor.CentreLeft;
Content.Origin = Anchor.CentreLeft; Content.Origin = Anchor.CentreLeft;
@ -104,7 +110,7 @@ namespace osu.Game.Screens.Select.Carousel
return; return;
} }
beatmapDownloader.DownloadAsUpdate(beatmapSetInfo); beatmapDownloader.DownloadAsUpdate(beatmapSetInfo, preferNoVideo.Value);
attachExistingDownload(); attachExistingDownload();
}; };
} }