Skip to content

Commit a8d9331

Browse files
committed
refactor: Changed audio and cover URL from computed properties to required properties
- Changed AudioUrl and JacketUrl in CommonRecord from computed properties to required properties - Updated Record mapping logic for Lxns and DivingFish data sources to explicitly pass these two properties - Fixed the cover URL address for the DivingFish data source and optimized the ID processing logic for the audio URL
1 parent 754fd0e commit a8d9331

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

src/Prober/Common/CommonRecord.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ public record CommonRecord : IComparer<CommonRecord>
3030

3131
public required bool InCurrentVersion { get; init; }
3232

33-
public string AudioUrl => $"https://assets2.lxns.net/maimai/music/{Id % 10000}.mp3";
33+
public required string AudioUrl { get; init; }
3434

35-
public string JacketUrl => $"https://assets2.lxns.net/maimai/jacket/{Id % 10000}.png";
35+
public required string JacketUrl { get; init; }
3636

3737
public int Compare(CommonRecord? x, CommonRecord? y)
3838
{

src/Prober/DivingFish/Models/Record.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ public class Record
4949
[JsonPropertyName("type")]
5050
public required SongTypes Type { get; init; }
5151

52-
public string AudioUrl => $"https://assets2.lxns.net/maimai/music/{Id % 10000}.mp3";
52+
public string AudioUrl => $"https://assets2.lxns.net/maimai/music/{(Id is > 10000 and < 100000 ? Id % 10000 : Id)}.mp3";
5353

54-
public string JacketUrl => $"https://assets2.lxns.net/maimai/jacket/{Id % 10000}.png";
54+
public string JacketUrl => $"https://maimai.diving-fish.com/covers/{Id}.png";
5555

5656
public Song Song
5757
{
@@ -114,6 +114,8 @@ public static implicit operator CommonRecord(Record record) =>
114114
DXScore = record.DXScore,
115115
TotalDXScore = record.TotalDXScore,
116116
LevelValue = record.LevelValue,
117-
InCurrentVersion = record.Song.BasicInfo.InCurrentVersion
117+
InCurrentVersion = record.Song.BasicInfo.InCurrentVersion,
118+
AudioUrl = record.AudioUrl,
119+
JacketUrl = record.JacketUrl
118120
};
119121
}

src/Prober/Lxns/Models/Record.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ public static implicit operator CommonRecord(Record record) =>
118118
DXScore = record.DXScore,
119119
TotalDXScore = record.TotalDXScore,
120120
LevelValue = record.LevelValue,
121-
InCurrentVersion = (SongData.Shared.Versions[^1].VersionNumber / 100) == (record.Chart.Version / 100)
121+
InCurrentVersion = (SongData.Shared.Versions[^1].VersionNumber / 100) == (record.Chart.Version / 100),
122+
AudioUrl = record.AudioUrl,
123+
JacketUrl = record.JacketUrl
122124
};
123125
}

0 commit comments

Comments
 (0)