Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mods to beatmap.last_np #478

Closed
cmyui opened this issue Aug 11, 2023 · 1 comment · Fixed by #526
Closed

Add mods to beatmap.last_np #478

cmyui opened this issue Aug 11, 2023 · 1 comment · Fixed by #526
Labels
enhancement New feature or request good first issue Good for newcomers Priority 2 A typical task - new functionality, organizational work on our software

Comments

@cmyui
Copy link
Member

cmyui commented Aug 11, 2023

The last_np field is used for keeping context of what the player's last /np'ed.

We currently parse the mods out of the /np in regex:

NOW_PLAYING_RGX = re.compile(
r"^\x01ACTION is (?:playing|editing|watching|listening to) "
rf"\[https://osu\.(?:{re.escape(BASE_DOMAIN)}|ppy\.sh)/beatmapsets/(?P<sid>\d{{1,10}})#/?(?:osu|taiko|fruits|mania)?/(?P<bid>\d{{1,10}})/? .+\]"
r"(?: <(?P<mode_vn>Taiko|CatchTheBeat|osu!mania)>)?"
r"(?P<mods>(?: (?:-|\+|~|\|)\w+(?:~|\|)?)+)?\x01$",
)

But we do not store this in the beatmap.last_np field after parsing from regex:

  1. player.last_np = {
    "bmap": bmap,
    "mode_vn": mode_vn,
    "timeout": time.time() + 300, # /np's last 5mins
    }
  2. player.last_np = {
    "bmap": bmap,
    "mode_vn": mode_vn,
    "timeout": time.time() + 300, # /np's last 5mins
    }

This data is useful so it can then later be used for e.g. pp calculation based on context.

@cmyui cmyui added bug Something isn't working triage This issue or pull request needs sorting. Priority 2 A typical task - new functionality, organizational work on our software good first issue Good for newcomers enhancement New feature or request and removed triage This issue or pull request needs sorting. bug Something isn't working labels Aug 11, 2023
@cmyui cmyui changed the title bug: beatmap.last_np doesn't track mods - resolution is lost Add mods to beatmap.last_np Aug 11, 2023
@minisbett
Copy link
Contributor

If this is implemented it could directly be integrated into the !with command. Make sure to merge #356 first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers Priority 2 A typical task - new functionality, organizational work on our software
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants