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

Store additional beatmap data #582

Open
3 of 6 tasks
myssto opened this issue Jan 18, 2025 · 0 comments
Open
3 of 6 tasks

Store additional beatmap data #582

myssto opened this issue Jan 18, 2025 · 0 comments
Assignees
Labels
area:beatmaps database:schema-change Items that contain or propose schema changes to the database epic Feature that requires significant effort to implement project:API Items related to the API project project:Database Items related to the Database project project:DataWorkerService Items related to the DataWorkerService project project:OsuApiClient Items related to the OsuApiClient project proposal type:feature

Comments

@myssto
Copy link
Contributor

myssto commented Jan 18, 2025

Currently we do not store the osu! id of the beatmap set for each beatmap, which is relevant for certain use cases such as accessing the beatmap's image assets. In addition to this, the osu! API returns different objects for each beatmap when requesting /beatmaps/{id} and /beatmapsets/{id}. When requesting /beatmapsets/{id}, the API will include the proper user data for all collab members (see below). When a single beatmap is requested from /beatmaps/{id}, the owner will always be set to the user who uploaded the beatmap set. Finally, we should support fetching and storing beatmap attributes (namely SR, as that cannot be calculated with a formula without having the beatmap file) so we can display that information properly on the website.

Image

Tasks

osu! API example responses

Pastebin below contains example osu! API responses for each of the possible variations of the data concerned in this proposal
https://pastebin.com/bkC1ytwr

Entity Structures

type BeatmapSet = {
  // PK
  id: number;
  created: Date;
  updated?: Date;
  // Index - unique
  osuId: long;
  artist: string = "";
  title: string = "";
  ranked_status: BeatmapRankedStatus;
  ranked_date?: Date;
  submitted_date?: Date;
  // FK - players { id }
  creatorId: number;
  creator: Player;
  // Relation - 1TM -> beatmaps
  beatmaps: Beatmap[];
}
type BeatmapAttributes = {
  // PK
  id: number;
  created: Date;
  // FK - beatmaps { id }
  beatmap_id: number;
  // Index - unique compound { beatmap_id, mods }
  mods: Mods;
  sr: double;
}
type Beatmap = {
  // PK
  id: number;
  created: Date;
  updated?: Date;
  // Index - unique
  osuId: long;
  ruleset: Ruleset;
  diff_name: string = "";
  // Seconds
  total_length: number;
  // Seconds
  drain_length: number;
  bpm: double;
  count_circle: number;
  count_slider: number;
  count_spinner: number;
  cs: double;
  hp: double;
  od: double;
  ar: double;
  // Should always be the NM star rating
  sr: double;
  // Not always present
  max_combo?: number;
  // Relation - MTM -> players
  creators: Player[];
  // FK - beatmap_sets { id }
  beatmapset_id: number;
  beatmapset: BeatmapSet;
  // Relation - MT1 -> games
  games: Game[];
  // Relation - MTM -> tournaments
  tournaments_pooled_in: Tournament[];
}
@myssto myssto added area:beatmaps database:schema-change Items that contain or propose schema changes to the database epic Feature that requires significant effort to implement project:API Items related to the API project project:Database Items related to the Database project project:DataWorkerService Items related to the DataWorkerService project project:OsuApiClient Items related to the OsuApiClient project proposal type:feature labels Jan 18, 2025
@github-project-automation github-project-automation bot moved this to Backlog in otr-beta-v2 Jan 18, 2025
@myssto myssto moved this from Backlog to Ready in otr-beta-v2 Jan 18, 2025
@myssto myssto moved this from Ready to In progress in otr-beta-v2 Jan 19, 2025
@myssto myssto self-assigned this Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:beatmaps database:schema-change Items that contain or propose schema changes to the database epic Feature that requires significant effort to implement project:API Items related to the API project project:Database Items related to the Database project project:DataWorkerService Items related to the DataWorkerService project project:OsuApiClient Items related to the OsuApiClient project proposal type:feature
Projects
Status: In progress
Development

No branches or pull requests

1 participant