diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index e00d7a1115..836cbfa6c5 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -16,6 +16,7 @@ using osu.Framework.Extensions.ObjectExtensions; using osu.Framework.Logging; using osu.Game.Beatmaps; using osu.Game.Database; +using osu.Game.Extensions; using osu.Game.IO; using osu.Game.Online.API.Requests.Responses; using osu.Game.Overlays.Notifications; @@ -363,15 +364,15 @@ namespace osu.Game.Tests.Beatmaps.IO var files = osu.Dependencies.Get(); long originalLength; - using (var stream = files.Storage.GetStream(firstFile.FileInfo.StoragePath)) + using (var stream = files.Storage.GetStream(firstFile.FileInfo.GetStoragePath())) originalLength = stream.Length; - using (var stream = files.Storage.GetStream(firstFile.FileInfo.StoragePath, FileAccess.Write, FileMode.Create)) + using (var stream = files.Storage.GetStream(firstFile.FileInfo.GetStoragePath(), FileAccess.Write, FileMode.Create)) stream.WriteByte(0); var importedSecondTime = await LoadOszIntoOsu(osu); - using (var stream = files.Storage.GetStream(firstFile.FileInfo.StoragePath)) + using (var stream = files.Storage.GetStream(firstFile.FileInfo.GetStoragePath())) Assert.AreEqual(stream.Length, originalLength, "Corruption was not fixed on second import"); // check the newly "imported" beatmap is actually just the restored previous import. since it matches hash. diff --git a/osu.Game.Tests/Database/BeatmapImporterTests.cs b/osu.Game.Tests/Database/BeatmapImporterTests.cs index 88d16c8a36..75eb4a043a 100644 --- a/osu.Game.Tests/Database/BeatmapImporterTests.cs +++ b/osu.Game.Tests/Database/BeatmapImporterTests.cs @@ -14,6 +14,7 @@ using osu.Framework.Extensions.ObjectExtensions; using osu.Framework.Logging; using osu.Game.Beatmaps; using osu.Game.Database; +using osu.Game.Extensions; using osu.Game.IO.Archives; using osu.Game.Models; using osu.Game.Overlays.Notifications; @@ -348,15 +349,15 @@ namespace osu.Game.Tests.Database var firstFile = imported.Files.First(); long originalLength; - using (var stream = storage.GetStream(firstFile.File.StoragePath)) + using (var stream = storage.GetStream(firstFile.File.GetStoragePath())) originalLength = stream.Length; - using (var stream = storage.GetStream(firstFile.File.StoragePath, FileAccess.Write, FileMode.Create)) + using (var stream = storage.GetStream(firstFile.File.GetStoragePath(), FileAccess.Write, FileMode.Create)) stream.WriteByte(0); var importedSecondTime = await LoadOszIntoStore(importer, realmFactory.Context); - using (var stream = storage.GetStream(firstFile.File.StoragePath)) + using (var stream = storage.GetStream(firstFile.File.GetStoragePath())) Assert.AreEqual(stream.Length, originalLength, "Corruption was not fixed on second import"); // check the newly "imported" beatmap is actually just the restored previous import. since it matches hash. diff --git a/osu.Game.Tests/Database/FileStoreTests.cs b/osu.Game.Tests/Database/FileStoreTests.cs index 861de5303d..3cb4705381 100644 --- a/osu.Game.Tests/Database/FileStoreTests.cs +++ b/osu.Game.Tests/Database/FileStoreTests.cs @@ -6,6 +6,7 @@ using System.IO; using System.Linq; using NUnit.Framework; using osu.Framework.Logging; +using osu.Game.Extensions; using osu.Game.Models; using osu.Game.Stores; @@ -28,7 +29,7 @@ namespace osu.Game.Tests.Database realm.Write(() => files.Add(testData, realm)); Assert.True(files.Storage.Exists("0/05/054edec1d0211f624fed0cbca9d4f9400b0e491c43742af2c5b0abebf0c990d8")); - Assert.True(files.Storage.Exists(realm.All().First().StoragePath)); + Assert.True(files.Storage.Exists(realm.All().First().GetStoragePath())); }); } @@ -74,7 +75,7 @@ namespace osu.Game.Tests.Database Logger.Log($"Import complete at {timer.ElapsedMilliseconds}"); - string path = file.StoragePath; + string path = file.GetStoragePath(); Assert.True(realm.All().Any()); Assert.True(files.Storage.Exists(path)); @@ -98,7 +99,7 @@ namespace osu.Game.Tests.Database var file = realm.Write(() => files.Add(new MemoryStream(new byte[] { 0, 1, 2, 3 }), realm)); - string path = file.StoragePath; + string path = file.GetStoragePath(); Assert.True(realm.All().Any()); Assert.True(files.Storage.Exists(path)); diff --git a/osu.Game/Beatmaps/BeatmapModelManager.cs b/osu.Game/Beatmaps/BeatmapModelManager.cs index 3becbee0ba..8f55232031 100644 --- a/osu.Game/Beatmaps/BeatmapModelManager.cs +++ b/osu.Game/Beatmaps/BeatmapModelManager.cs @@ -18,6 +18,7 @@ using osu.Framework.Platform; using osu.Framework.Testing; using osu.Game.Beatmaps.Formats; using osu.Game.Database; +using osu.Game.Extensions; using osu.Game.IO; using osu.Game.IO.Archives; using osu.Game.Rulesets; @@ -384,7 +385,7 @@ namespace osu.Game.Beatmaps foreach (var file in files.Where(f => f.Filename.EndsWith(".osu", StringComparison.OrdinalIgnoreCase))) { - using (var raw = Files.Store.GetStream(file.FileInfo.StoragePath)) + using (var raw = Files.Store.GetStream(file.FileInfo.GetStoragePath())) using (var ms = new MemoryStream()) // we need a memory stream so we can seek using (var sr = new LineBufferedReader(ms)) { diff --git a/osu.Game/Beatmaps/BeatmapSetInfo.cs b/osu.Game/Beatmaps/BeatmapSetInfo.cs index a0de50a311..35468ce831 100644 --- a/osu.Game/Beatmaps/BeatmapSetInfo.cs +++ b/osu.Game/Beatmaps/BeatmapSetInfo.cs @@ -8,6 +8,7 @@ using System.Linq; using JetBrains.Annotations; using osu.Framework.Testing; using osu.Game.Database; +using osu.Game.Extensions; namespace osu.Game.Beatmaps { @@ -61,7 +62,7 @@ namespace osu.Game.Beatmaps /// The path returned is relative to the user file storage. /// /// The name of the file to get the storage path of. - public string GetPathForFile(string filename) => Files.SingleOrDefault(f => string.Equals(f.Filename, filename, StringComparison.OrdinalIgnoreCase))?.FileInfo.StoragePath; + public string GetPathForFile(string filename) => Files.SingleOrDefault(f => string.Equals(f.Filename, filename, StringComparison.OrdinalIgnoreCase))?.FileInfo.GetStoragePath(); public override string ToString() => Metadata?.ToString() ?? base.ToString(); diff --git a/osu.Game/Database/ArchiveModelManager.cs b/osu.Game/Database/ArchiveModelManager.cs index e8b6996869..a0e8105285 100644 --- a/osu.Game/Database/ArchiveModelManager.cs +++ b/osu.Game/Database/ArchiveModelManager.cs @@ -325,7 +325,7 @@ namespace osu.Game.Database foreach (TFileModel file in hashableFiles) { - using (Stream s = Files.Store.GetStream(file.FileInfo.StoragePath)) + using (Stream s = Files.Store.GetStream(file.FileInfo.GetStoragePath())) s.CopyTo(hashable); } @@ -480,7 +480,7 @@ namespace osu.Game.Database using (var archive = ZipArchive.Create()) { foreach (var file in model.Files) - archive.AddEntry(file.Filename, Files.Storage.GetStream(file.FileInfo.StoragePath)); + archive.AddEntry(file.Filename, Files.Storage.GetStream(file.FileInfo.GetStoragePath())); archive.SaveTo(outputStream); } diff --git a/osu.Game/Extensions/ModelExtensions.cs b/osu.Game/Extensions/ModelExtensions.cs index 3426484c14..aaf87385c8 100644 --- a/osu.Game/Extensions/ModelExtensions.cs +++ b/osu.Game/Extensions/ModelExtensions.cs @@ -1,8 +1,10 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System.IO; using osu.Game.Beatmaps; using osu.Game.Database; +using osu.Game.IO; using osu.Game.Online.API.Requests.Responses; using osu.Game.Rulesets; using osu.Game.Scoring; @@ -14,6 +16,13 @@ namespace osu.Game.Extensions { public static class ModelExtensions { + /// + /// Get the relative path in osu! storage for this file. + /// + /// The file info. + /// A relative file path. + public static string GetStoragePath(this IFileInfo fileInfo) => Path.Combine(fileInfo.Hash.Remove(1), fileInfo.Hash.Remove(2), fileInfo.Hash); + /// /// Returns a user-facing string representing the . /// diff --git a/osu.Game/IO/FileInfo.cs b/osu.Game/IO/FileInfo.cs index 331546f9f8..277ad0adac 100644 --- a/osu.Game/IO/FileInfo.cs +++ b/osu.Game/IO/FileInfo.cs @@ -1,7 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System.IO; using osu.Game.Database; namespace osu.Game.IO @@ -12,8 +11,6 @@ namespace osu.Game.IO public string Hash { get; set; } - public string StoragePath => Path.Combine(Hash.Remove(1), Hash.Remove(2), Hash); - public int ReferenceCount { get; set; } } } diff --git a/osu.Game/IO/FileStore.cs b/osu.Game/IO/FileStore.cs index bf4e881ed0..165cf756aa 100644 --- a/osu.Game/IO/FileStore.cs +++ b/osu.Game/IO/FileStore.cs @@ -12,6 +12,7 @@ using osu.Framework.IO.Stores; using osu.Framework.Logging; using osu.Framework.Platform; using osu.Game.Database; +using osu.Game.Extensions; namespace osu.Game.IO { @@ -47,7 +48,7 @@ namespace osu.Game.IO var info = existing ?? new FileInfo { Hash = hash }; - string path = info.StoragePath; + string path = info.GetStoragePath(); // we may be re-adding a file to fix missing store entries. bool requiresCopy = !Storage.Exists(path); @@ -120,7 +121,7 @@ namespace osu.Game.IO { try { - Storage.Delete(f.StoragePath); + Storage.Delete(f.GetStoragePath()); context.FileInfo.Remove(f); } catch (Exception e) diff --git a/osu.Game/Models/RealmBeatmapSet.cs b/osu.Game/Models/RealmBeatmapSet.cs index b9b47b697c..da75978977 100644 --- a/osu.Game/Models/RealmBeatmapSet.cs +++ b/osu.Game/Models/RealmBeatmapSet.cs @@ -52,7 +52,7 @@ namespace osu.Game.Models /// The path returned is relative to the user file storage. /// /// The name of the file to get the storage path of. - public string? GetPathForFile(string filename) => Files.SingleOrDefault(f => string.Equals(f.Filename, filename, StringComparison.OrdinalIgnoreCase))?.File.StoragePath; + public string? GetPathForFile(string filename) => Files.SingleOrDefault(f => string.Equals(f.Filename, filename, StringComparison.OrdinalIgnoreCase))?.File.GetStoragePath(); public bool Equals(RealmBeatmapSet? other) { diff --git a/osu.Game/Models/RealmFile.cs b/osu.Game/Models/RealmFile.cs index 2715f4be45..9e8da7cdc4 100644 --- a/osu.Game/Models/RealmFile.cs +++ b/osu.Game/Models/RealmFile.cs @@ -1,7 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using System.IO; using osu.Framework.Testing; using osu.Game.IO; using Realms; @@ -16,7 +15,5 @@ namespace osu.Game.Models { [PrimaryKey] public string Hash { get; set; } = string.Empty; - - public string StoragePath => Path.Combine(Hash.Remove(1), Hash.Remove(2), Hash); } } diff --git a/osu.Game/Rulesets/Edit/Checks/CheckTooShortAudioFiles.cs b/osu.Game/Rulesets/Edit/Checks/CheckTooShortAudioFiles.cs index 57f7c60916..5cc98c5537 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckTooShortAudioFiles.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckTooShortAudioFiles.cs @@ -6,6 +6,7 @@ using System.IO; using System.Linq; using ManagedBass; using osu.Framework.Audio.Callbacks; +using osu.Game.Extensions; using osu.Game.Rulesets.Edit.Checks.Components; namespace osu.Game.Rulesets.Edit.Checks @@ -31,7 +32,7 @@ namespace osu.Game.Rulesets.Edit.Checks foreach (var file in beatmapSet.Files) { - using (Stream data = context.WorkingBeatmap.GetStream(file.FileInfo.StoragePath)) + using (Stream data = context.WorkingBeatmap.GetStream(file.FileInfo.GetStoragePath())) { if (data == null) continue; diff --git a/osu.Game/Rulesets/Edit/Checks/CheckZeroByteFiles.cs b/osu.Game/Rulesets/Edit/Checks/CheckZeroByteFiles.cs index 3a994fabfa..ab9959aec2 100644 --- a/osu.Game/Rulesets/Edit/Checks/CheckZeroByteFiles.cs +++ b/osu.Game/Rulesets/Edit/Checks/CheckZeroByteFiles.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; +using osu.Game.Extensions; using osu.Game.Rulesets.Edit.Checks.Components; namespace osu.Game.Rulesets.Edit.Checks @@ -22,7 +23,7 @@ namespace osu.Game.Rulesets.Edit.Checks foreach (var file in beatmapSet.Files) { - using (Stream data = context.WorkingBeatmap.GetStream(file.FileInfo.StoragePath)) + using (Stream data = context.WorkingBeatmap.GetStream(file.FileInfo.GetStoragePath())) { if (data?.Length == 0) yield return new IssueTemplateZeroBytes(this).Create(file.Filename); diff --git a/osu.Game/Scoring/LegacyDatabasedScore.cs b/osu.Game/Scoring/LegacyDatabasedScore.cs index 81892f65d0..69360cacc7 100644 --- a/osu.Game/Scoring/LegacyDatabasedScore.cs +++ b/osu.Game/Scoring/LegacyDatabasedScore.cs @@ -5,6 +5,7 @@ using System; using System.Linq; using osu.Framework.IO.Stores; using osu.Game.Beatmaps; +using osu.Game.Extensions; using osu.Game.Rulesets; using osu.Game.Scoring.Legacy; @@ -16,7 +17,7 @@ namespace osu.Game.Scoring { ScoreInfo = score; - string replayFilename = score.Files.FirstOrDefault(f => f.Filename.EndsWith(".osr", StringComparison.InvariantCultureIgnoreCase))?.FileInfo.StoragePath; + string replayFilename = score.Files.FirstOrDefault(f => f.Filename.EndsWith(".osr", StringComparison.InvariantCultureIgnoreCase))?.FileInfo.GetStoragePath(); if (replayFilename == null) return; diff --git a/osu.Game/Scoring/ScoreModelManager.cs b/osu.Game/Scoring/ScoreModelManager.cs index c65a6acdfb..c194a7166d 100644 --- a/osu.Game/Scoring/ScoreModelManager.cs +++ b/osu.Game/Scoring/ScoreModelManager.cs @@ -13,6 +13,7 @@ using osu.Framework.Logging; using osu.Framework.Platform; using osu.Game.Beatmaps; using osu.Game.Database; +using osu.Game.Extensions; using osu.Game.IO.Archives; using osu.Game.Rulesets; using osu.Game.Scoring.Legacy; @@ -77,7 +78,7 @@ namespace osu.Game.Scoring if (file == null) return; - using (var inputStream = Files.Storage.GetStream(file.FileInfo.StoragePath)) + using (var inputStream = Files.Storage.GetStream(file.FileInfo.GetStoragePath())) inputStream.CopyTo(outputStream); } diff --git a/osu.Game/Skinning/LegacySkinResourceStore.cs b/osu.Game/Skinning/LegacySkinResourceStore.cs index fb06bb54d0..096b467867 100644 --- a/osu.Game/Skinning/LegacySkinResourceStore.cs +++ b/osu.Game/Skinning/LegacySkinResourceStore.cs @@ -7,6 +7,7 @@ using System.Linq; using osu.Framework.Extensions; using osu.Framework.IO.Stores; using osu.Game.Database; +using osu.Game.Extensions; namespace osu.Game.Skinning { @@ -35,7 +36,7 @@ namespace osu.Game.Skinning } private string getPathForFile(string filename) => - source.Files.Find(f => string.Equals(f.Filename, filename, StringComparison.OrdinalIgnoreCase))?.FileInfo.StoragePath; + source.Files.Find(f => string.Equals(f.Filename, filename, StringComparison.OrdinalIgnoreCase))?.FileInfo.GetStoragePath(); public override IEnumerable GetAvailableResources() => source.Files.Select(f => f.Filename); } diff --git a/osu.Game/Skinning/Skin.cs b/osu.Game/Skinning/Skin.cs index f8f9c1172d..fae1a599d1 100644 --- a/osu.Game/Skinning/Skin.cs +++ b/osu.Game/Skinning/Skin.cs @@ -15,6 +15,7 @@ using osu.Framework.Graphics.OpenGL.Textures; using osu.Framework.Graphics.Textures; using osu.Framework.Logging; using osu.Game.Audio; +using osu.Game.Extensions; using osu.Game.IO; using osu.Game.Screens.Play.HUD; @@ -63,7 +64,7 @@ namespace osu.Game.Skinning if (fileInfo == null) continue; - byte[] bytes = resources?.Files.Get(fileInfo.FileInfo.StoragePath); + byte[] bytes = resources?.Files.Get(fileInfo.FileInfo.GetStoragePath()); if (bytes == null) continue; @@ -93,7 +94,7 @@ namespace osu.Game.Skinning private Stream getConfigurationStream() { - string path = SkinInfo.Files.SingleOrDefault(f => f.Filename.Equals(@"skin.ini", StringComparison.OrdinalIgnoreCase))?.FileInfo.StoragePath; + string path = SkinInfo.Files.SingleOrDefault(f => f.Filename.Equals(@"skin.ini", StringComparison.OrdinalIgnoreCase))?.FileInfo.GetStoragePath(); if (string.IsNullOrEmpty(path)) return null; diff --git a/osu.Game/Skinning/SkinManager.cs b/osu.Game/Skinning/SkinManager.cs index 0739026544..6e0a8e0a11 100644 --- a/osu.Game/Skinning/SkinManager.cs +++ b/osu.Game/Skinning/SkinManager.cs @@ -215,7 +215,7 @@ namespace osu.Game.Skinning { using (var sw = new StreamWriter(stream, Encoding.UTF8, 1024, true)) { - using (var existingStream = Files.Storage.GetStream(existingFile.FileInfo.StoragePath)) + using (var existingStream = Files.Storage.GetStream(existingFile.FileInfo.GetStoragePath())) using (var sr = new StreamReader(existingStream)) { string line; diff --git a/osu.Game/Stores/BeatmapImporter.cs b/osu.Game/Stores/BeatmapImporter.cs index a9605f1fc3..dad2b29dd0 100644 --- a/osu.Game/Stores/BeatmapImporter.cs +++ b/osu.Game/Stores/BeatmapImporter.cs @@ -18,6 +18,7 @@ using osu.Framework.Testing; using osu.Game.Beatmaps; using osu.Game.Beatmaps.Formats; using osu.Game.Database; +using osu.Game.Extensions; using osu.Game.IO; using osu.Game.IO.Archives; using osu.Game.Models; @@ -197,7 +198,7 @@ namespace osu.Game.Stores foreach (var file in files.Where(f => f.Filename.EndsWith(".osu", StringComparison.OrdinalIgnoreCase))) { - using (var memoryStream = new MemoryStream(Files.Store.Get(file.File.StoragePath))) // we need a memory stream so we can seek + using (var memoryStream = new MemoryStream(Files.Store.Get(file.File.GetStoragePath()))) // we need a memory stream so we can seek { IBeatmap decoded; using (var lineReader = new LineBufferedReader(memoryStream, true)) diff --git a/osu.Game/Stores/RealmArchiveModelImporter.cs b/osu.Game/Stores/RealmArchiveModelImporter.cs index 3398cc114d..5b8c73b218 100644 --- a/osu.Game/Stores/RealmArchiveModelImporter.cs +++ b/osu.Game/Stores/RealmArchiveModelImporter.cs @@ -15,6 +15,7 @@ using osu.Framework.Logging; using osu.Framework.Platform; using osu.Framework.Threading; using osu.Game.Database; +using osu.Game.Extensions; using osu.Game.IO.Archives; using osu.Game.Models; using osu.Game.Overlays.Notifications; @@ -305,7 +306,7 @@ namespace osu.Game.Stores foreach (RealmNamedFileUsage file in item.Files.Where(f => HashableFileTypes.Any(ext => f.Filename.EndsWith(ext, StringComparison.OrdinalIgnoreCase))).OrderBy(f => f.Filename)) { - using (Stream s = Files.Store.GetStream(file.File.StoragePath)) + using (Stream s = Files.Store.GetStream(file.File.GetStoragePath())) s.CopyTo(hashable); } diff --git a/osu.Game/Stores/RealmFileStore.cs b/osu.Game/Stores/RealmFileStore.cs index f7b7471634..aebf330443 100644 --- a/osu.Game/Stores/RealmFileStore.cs +++ b/osu.Game/Stores/RealmFileStore.cs @@ -10,6 +10,7 @@ using osu.Framework.Logging; using osu.Framework.Platform; using osu.Framework.Testing; using osu.Game.Database; +using osu.Game.Extensions; using osu.Game.Models; using Realms; @@ -64,7 +65,7 @@ namespace osu.Game.Stores { data.Seek(0, SeekOrigin.Begin); - using (var output = Storage.GetStream(file.StoragePath, FileAccess.Write)) + using (var output = Storage.GetStream(file.GetStoragePath(), FileAccess.Write)) data.CopyTo(output); data.Seek(0, SeekOrigin.Begin); @@ -72,7 +73,7 @@ namespace osu.Game.Stores private bool checkFileExistsAndMatchesHash(RealmFile file) { - string path = file.StoragePath; + string path = file.GetStoragePath(); // we may be re-adding a file to fix missing store entries. if (!Storage.Exists(path)) @@ -100,7 +101,7 @@ namespace osu.Game.Stores try { - Storage.Delete(file.StoragePath); + Storage.Delete(file.GetStoragePath()); realm.Remove(file); } catch (Exception e) diff --git a/osu.Game/Storyboards/Drawables/DrawableStoryboardVideo.cs b/osu.Game/Storyboards/Drawables/DrawableStoryboardVideo.cs index d21616955a..0625ddaffd 100644 --- a/osu.Game/Storyboards/Drawables/DrawableStoryboardVideo.cs +++ b/osu.Game/Storyboards/Drawables/DrawableStoryboardVideo.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using System; +using System.Linq; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; @@ -9,6 +10,7 @@ using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Textures; using osu.Framework.Graphics.Video; using osu.Game.Beatmaps; +using osu.Game.Extensions; namespace osu.Game.Storyboards.Drawables { @@ -29,7 +31,7 @@ namespace osu.Game.Storyboards.Drawables [BackgroundDependencyLoader(true)] private void load(IBindable beatmap, TextureStore textureStore) { - string path = beatmap.Value.BeatmapSetInfo?.Files.Find(f => f.Filename.Equals(Video.Path, StringComparison.OrdinalIgnoreCase))?.FileInfo.StoragePath; + string path = beatmap.Value.BeatmapSetInfo?.Files.FirstOrDefault(f => f.Filename.Equals(Video.Path, StringComparison.OrdinalIgnoreCase))?.File.GetStoragePath(); if (path == null) return; diff --git a/osu.Game/Storyboards/Storyboard.cs b/osu.Game/Storyboards/Storyboard.cs index d3d6797eae..fa90a00f0d 100644 --- a/osu.Game/Storyboards/Storyboard.cs +++ b/osu.Game/Storyboards/Storyboard.cs @@ -8,6 +8,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Textures; using osu.Game.Beatmaps; +using osu.Game.Extensions; using osu.Game.Skinning; using osu.Game.Storyboards.Drawables; @@ -95,7 +96,7 @@ namespace osu.Game.Storyboards public Drawable CreateSpriteFromResourcePath(string path, TextureStore textureStore) { Drawable drawable = null; - string storyboardPath = BeatmapInfo.BeatmapSet?.Files.Find(f => f.Filename.Equals(path, StringComparison.OrdinalIgnoreCase))?.FileInfo.StoragePath; + string storyboardPath = BeatmapInfo.BeatmapSet?.Files.Find(f => f.Filename.Equals(path, StringComparison.OrdinalIgnoreCase))?.FileInfo.GetStoragePath(); if (!string.IsNullOrEmpty(storyboardPath)) drawable = new Sprite { Texture = textureStore.Get(storyboardPath) };