osudroid / osu-droid

http://osudroid.moe
Apache License 2.0
506 stars 76 forks source link

Fix bugs and refactor code #79

Closed Rian8337 closed 3 years ago

Rian8337 commented 3 years ago
EdrowsLuo commented 3 years ago

have you test it?

Rian8337 commented 3 years ago

Yes, I've attempted to load the beatmap that is linked in #78 and it was able to load properly now.

My initial fix only considered whitespaces between beatmap sections while in fact it could be anywhere, hence why I made the "better" fix. Now cases like this should also be fixed:

[Metadata]
Title:HONESTY
TitleUnicode:HONESTY
Artist:GYZE
ArtistUnicode:GYZE
Creator:Bibbity Bill
Version:StunterLetsPlay's Originality
Source:
Tags:
BeatmapID:1711767
BeatmapSetID:814850

[Difficulty]
HPDrainRate:4
<whitespace in here>
CircleSize:4.2
OverallDifficulty:10
ApproachRate:9.8
<another whitespace in here>
SliderMultiplier:2
SliderTickRate:1
Rian8337 commented 3 years ago

Alright, I'm done. Please let me know if any improvements are needed.

EdrowsLuo commented 3 years ago

Alright, I'm done. Please let me know if any improvements are needed.

Still bad code quality, :( Can you tolerate a method with more than 200 lines code?

Rian8337 commented 3 years ago

Separated breakMetaData to multiple methods and refactored more codes, should be better now in my opinion.

Rian8337 commented 3 years ago

Attempted to load my whole songs library (16,000 beatmaps) with the latest commit, it went fine. Should be safe now, I can ask Discord users to test later.