Jatie1 / osu-beatmap-downloader

Beatmap downloader for the rhythm game osu!
3 stars 1 forks source link

Inflexibility in the directory validation code #1

Closed Ctaehko closed 1 month ago

Ctaehko commented 1 month ago

https://github.com/Jatie1/osu-beatmap-downloader/blob/7ae7481e0a02e647e15bc82b8555321329873d91/src/main/java/com/jatie/BeatmapDownloader.java#L151 This line expects at least one subdirectory before the osu! install.

There's no real reason to expect osu! to be in a subdirectory, my install for example is (or used to be) at 'E:\osu', which in this instance would be an invalid location, though it is infact an osu! install. This inflexibility forced me to move my 280GB osu install to a subdirectory for the program to work

I suggest changing the validation criteria to thisPath.matches(".*\\\\osu!$"); to support top-level directories

sorry for the scuffed issue, pretty new to github, wanted to point out a slight inconvenience though.

Jatie1 commented 1 month ago

Thanks for the suggestion!

Actually I've planned to rewrite this program entirely using my new knowledge when I find the motivation.

You can see the new branch here (obviously it's unfinished): https://github.com/Jatie1/osu-beatmap-downloader/tree/rewrite

I make the logic check for:

  1. If the directory entered is called osu!
  2. If there is a Songs folder
  3. If there is an osu.db file

But it's cool to see someone actually used this program, I just made it for myself and a few friends around me as a pet project! Might give me motivation to finish it off 😄

PS new version won't need osu!direct

Jatie1 commented 1 month ago

Just released a new version fixing this issue. I couldn't replicate it, as my directory is D:\osu! and it still worked, but the regex was crap anyway.

Ctaehko commented 1 month ago

Thanks for the suggestion!

Actually I've planned to rewrite this program entirely using my new knowledge when I find the motivation.

You can see the new branch here (obviously it's unfinished): https://github.com/Jatie1/osu-beatmap-downloader/tree/rewrite

I make the logic check for:

  1. If the directory entered is called osu!
  2. If there is a Songs folder
  3. If there is an osu.db file

But it's cool to see someone actually used this program, I just made it for myself and a few friends around me as a pet project! Might give me motivation to finish it off 😄

PS new version won't need osu!direct

well, i made a gamble cuz i needed to get 2024 maps and the other beatmap downloaders didnt look that user friendly. gamble paid off, thanks for writing the program, saved me an hour of clicking thru osu!direct :D

PS, no clue how D:\osu! works but E:\osu! doesnt, a mystery for sure