-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
79 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
namespace CollectionManager.DataTypes; | ||
using CollectionManager.Extensions; | ||
using System.Linq; | ||
|
||
namespace CollectionManager.DataTypes; | ||
|
||
public class LazerBeatmap | ||
: BeatmapExtension | ||
{ | ||
public string AudioRelativeFilePath { get; set; } | ||
public string BackgroundRelativeFilePath { get; set; } | ||
public string BackgroundFileName { get; set; } | ||
public string AudioRelativeFilePath => SetFiles.FirstOrDefault(f => f.FileName == Mp3Name)?.RelativeRealmFilePath; | ||
public string BackgroundRelativeFilePath => SetFiles.FirstOrDefault(f => f.FileName == BackgroundFileName)?.RelativeRealmFilePath; | ||
public string MapHash { get; set; } | ||
public LazerFile[] SetFiles { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System.IO; | ||
|
||
namespace CollectionManager.DataTypes; | ||
|
||
public class LazerFile(string Hash, string FileName) | ||
{ | ||
public string Hash { get; } = Hash; | ||
public string FileName { get; } = FileName; | ||
|
||
public string RelativeRealmFilePath => Path.Combine(Hash.Remove(1), Hash.Remove(2), Hash); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
CollectionManagerDll/Extensions/BeatmapSetInfoExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using CollectionManager.DataTypes; | ||
using CollectionManager.Interfaces; | ||
using CollectionManager.Modules.FileIO.OsuLazerDb.RealmModels; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace CollectionManager.Extensions; | ||
internal static class BeatmapSetInfoExtensions | ||
{ | ||
public static IEnumerable<LazerBeatmap> ToLazerBeatmaps(this BeatmapSetInfo beatmapSetInfo, IScoreDataManager scoreDataManager) | ||
{ | ||
LazerFile[] setFiles = beatmapSetInfo.Files.Select(namedFile => namedFile.ToLazerFile()).ToArray(); | ||
|
||
return beatmapSetInfo.Beatmaps.Select(beatmap => beatmap.ToLazerBeatmap(scoreDataManager, setFiles)); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
CollectionManagerDll/Extensions/RealmNamedFileUsageExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using CollectionManager.DataTypes; | ||
using CollectionManager.Modules.FileIO.OsuLazerDb.RealmModels; | ||
|
||
namespace CollectionManager.Extensions; | ||
internal static class RealmNamedFileUsageExtensions | ||
{ | ||
public static LazerFile ToLazerFile(this RealmNamedFileUsage realmNamedFile) | ||
=> new(realmNamedFile.File.Hash, realmNamedFile.Filename); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters