ppy / osu-web

the browser-facing portion of osu!
https://osu.ppy.sh
GNU Affero General Public License v3.0
970 stars 381 forks source link

Extending flexibility of playlist system to better support spotlights evolving #8736

Open venix12 opened 2 years ago

venix12 commented 2 years ago

This issue is proposal of implementation of basic spotlights sytems into the osu-web, I'm willing to work on that, putting a draft in here, open for improvements.

Basic infrastructure

This kind of implementation could serve as a base for moving the spotlights leaderboard onto osu-web in the future.

Some ideas (would be nice to have but not really high priority)

peppy commented 2 years ago

I think a lot of what is asked for here should potentially be added to the playlist system itself, ie. allowing any playlist to have an attached description, URL, etc.

Maybe we could also implement a "seasons" system where multiple playlists could be grouped together (implement the backend for spotlights but eventually let others use this?)

nanaya commented 2 years ago

The title says "Basic implementation" so is it a different system from existing lazer playlist's spotlight flag (which also already have leaderboard in osu-web)?

peppy commented 2 years ago

The goal here is to give spotlights more of an official presence as they expand in scope (ie. more users are interacting with the system). Making it visible on a beatmap's page (and potentially.. the beatmap listing as proposed), as well as allowing better linking of metadata so players can get more info on the spotlight/playlist they are playing on.

To get some context you can check the latest news post regarding the system usage (https://osu.ppy.sh/home/news/2022-02-15-beatmap-spotlights-season-5-winter-2022). At very least I'd want to see the ability for us to add descriptive text (maybe full markdown?) so spotlight ranking pages (and in-game display) could give users the same amount of detail as the news post. Or just link to the news post if that's simpler.

Basically it's very hard for a user to understand what spotlights are right now unless they follow news posts closely. Given that playlists/spotlights are an area I really hope to build on in the future expanding the general flexibility of the system seems like a good next step.

The admin panel part is lower priority (I'd like to see this as part of the playlist creation interface in-game to keep things in one place).

nanaya commented 2 years ago

So... extending current system and not a basic implementation? Can use a better issue title at least I think.

venix12 commented 2 years ago

@peppy since I'm gonna work on the seasons thing now, i wanted to ask, should there be an interOp API endpoint or something to make assigning certain rooms to certain seasons (assuming the Season creation can go straight into database) a thing in the script you're working on? https://github.com/ppy/osu-web/issues/8927#issuecomment-1131277619

The workflow could be pretty much:

  1. a Season is created
  2. script is hitting interOp endpoint along with season_id and room_id, which then proceeds:
    • Room is marked as spotlight
    • Room items (beatmaps) are marked with spotlights tag and reindexed

That kind of solution seems pretty handy to manage all this stuff.

The season thing could also be used later without the interop/reindexing endpoint stuff to group some of non-spotlights lobbies (as mentioned in https://github.com/ppy/osu-web/issues/8736#issuecomment-1074707151).

peppy commented 2 years ago

Is the work you're planning to do at osu-web end? Or is it an external system? If it's being added osu-web end (which would be good, I think) then interop is not required as all of the pieces above are already supported via osu-web calls directly.

venix12 commented 2 years ago

Thought you wanted to use it in an external script, that's why i suggested the interOp, did the stance change since and therefore i should make it a website UI thing instead?🤔(or am i misunderstanding something)

https://github.com/ppy/osu-web/issues/8927#issuecomment-1131277619

If it makes more sense, we could implement this as an api endpoint and skip requiring the UI overhead. Or if it's something which is going to involve a manual switch from our end (ie. also flagging the playlists in lazer as spotlight), it can potentially be automated as part of that process.

peppy commented 2 years ago

Right, sounds good.

The easiest way for me is to expose an ASS command to perform the necessary ops. If you give me a list of the commands you'd like I can get them prepared (that was the plan for the indexing which i haven't got to). Is it just the mark-spotlight-and-index flow that needs addressing? I'm unsure of the database requirements you mention for seasons above.

venix12 commented 2 years ago

ok so what i mentioned database-side is mostly explained in the opening post i believe, to put it simple way:

other than that, regarding the ASS commands, when the above is implemented, what i imagined it to be is:

hopefully everything's clear now 🤔

peppy commented 2 years ago

The implementation with a Season table sounds best from a flexibility perspective.

I'll get to adding a command to do the management as soon as I find the bandwidth (right now making the changes manually is lower effort due to how rare the requests come in). But feel free to continue pushing forward with the surrounding implementation and I'll adapt as required.

venix12 commented 2 years ago

ok, so just to clarify, should i go with season_id on Room or with separate SeasonRooms table to allow one-to-many relationship between rooms and seasons?

peppy commented 2 years ago

The second sounds better. Or if the list of rooms is decided at the start of the season and never changed, a CSV column could work fine too. Whatever is simpler.