From a44ba579c5c39f8878e3f93f51614a270a13fc66 Mon Sep 17 00:00:00 2001
From: Dean Herbert <pe@ppy.sh>
Date: Tue, 11 Oct 2022 11:29:17 +0900
Subject: [PATCH] Fix beatmap update button not respecting user "prefer no
 video" setting

Closes #20701.
---
 osu.Game/Database/ModelDownloader.cs                   |  2 +-
 .../Screens/Select/Carousel/UpdateBeatmapSetButton.cs  | 10 ++++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/osu.Game/Database/ModelDownloader.cs b/osu.Game/Database/ModelDownloader.cs
index 877c90a534..6cba8fe819 100644
--- a/osu.Game/Database/ModelDownloader.cs
+++ b/osu.Game/Database/ModelDownloader.cs
@@ -45,7 +45,7 @@ namespace osu.Game.Database
 
         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)
         {
diff --git a/osu.Game/Screens/Select/Carousel/UpdateBeatmapSetButton.cs b/osu.Game/Screens/Select/Carousel/UpdateBeatmapSetButton.cs
index 3c4ed4734b..023d3627b0 100644
--- a/osu.Game/Screens/Select/Carousel/UpdateBeatmapSetButton.cs
+++ b/osu.Game/Screens/Select/Carousel/UpdateBeatmapSetButton.cs
@@ -2,12 +2,14 @@
 // See the LICENCE file in the repository root for full licence text.
 
 using osu.Framework.Allocation;
+using osu.Framework.Bindables;
 using osu.Framework.Graphics;
 using osu.Framework.Graphics.Containers;
 using osu.Framework.Graphics.Shapes;
 using osu.Framework.Graphics.Sprites;
 using osu.Framework.Input.Events;
 using osu.Game.Beatmaps;
+using osu.Game.Configuration;
 using osu.Game.Graphics;
 using osu.Game.Graphics.Sprites;
 using osu.Game.Graphics.UserInterface;
@@ -43,11 +45,15 @@ namespace osu.Game.Screens.Select.Carousel
             Origin = Anchor.CentreLeft;
         }
 
+        private Bindable<bool> preferNoVideo = null!;
+
         [BackgroundDependencyLoader]
-        private void load()
+        private void load(OsuConfigManager config)
         {
             const float icon_size = 14;
 
+            preferNoVideo = config.GetBindable<bool>(OsuSetting.PreferNoVideo);
+
             Content.Anchor = Anchor.CentreLeft;
             Content.Origin = Anchor.CentreLeft;
 
@@ -104,7 +110,7 @@ namespace osu.Game.Screens.Select.Carousel
                     return;
                 }
 
-                beatmapDownloader.DownloadAsUpdate(beatmapSetInfo);
+                beatmapDownloader.DownloadAsUpdate(beatmapSetInfo, preferNoVideo.Value);
                 attachExistingDownload();
             };
         }