File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -75,13 +75,13 @@ public static implicit operator CommonRecord(Record record)
7575 {
7676 Chart chart = record . Chart ;
7777 SongData songData = SongData . Shared ;
78- int versionGroup = chart . Version / 100 ;
78+ int versionGroup = chart . Version - ( chart . Version % 100 ) ;
7979 if ( ! songData . VersionsByGroup . TryGetValue ( versionGroup , out Version ? version ) )
8080 {
81- throw new InvalidDataException ( ) ;
81+ throw new InvalidDataException ( $ "Version group { versionGroup } not found" ) ;
8282 }
8383
84- bool inCurrentGenre = songData . Versions [ ^ 1 ] . VersionNumber / 100 == versionGroup ;
84+ bool inCurrentGenre = songData . Versions [ ^ 1 ] . VersionNumber == versionGroup ;
8585
8686 return new ( )
8787 {
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ public record SongData
1919 public FrozenDictionary < int , Song > SongsById => field ??= Songs . ToFrozenDictionary ( x => x . Id ) ;
2020
2121 public FrozenDictionary < int , Version > VersionsByGroup => field ??=
22- Versions . GroupBy ( x => x . VersionNumber / 100 ) . ToFrozenDictionary ( x => x . Key , x => x . First ( ) ) ;
22+ Versions . GroupBy ( x => x . VersionNumber ) . ToFrozenDictionary ( x => x . Key , x => x . First ( ) ) ;
2323
2424 public static SongData Shared
2525 {
You can’t perform that action at this time.
0 commit comments