Browse Source

Add missing genres and languages

master
Natsu Kagami 9 months ago
parent
commit
bc9e45969a
Signed by: natsukagami <natsukagami@gmail.com> GPG Key ID: 73376E117CD20735
2 changed files with 10 additions and 0 deletions
  1. +5
    -0
      youmubot-osu/src/models/mod.rs
  2. +5
    -0
      youmubot-osu/src/models/parse.rs

+ 5
- 0
youmubot-osu/src/models/mod.rs View File

@@ -132,7 +132,10 @@ pub enum Genre {
Novelty,
HipHop,
Electronic,
Metal,
Classical,
Folk,
Jazz,
}

impl fmt::Display for Genre {
@@ -160,6 +163,8 @@ pub enum Language {
Swedish,
Spanish,
Italian,
Russian,
Polish,
}

impl fmt::Display for Language {


+ 5
- 0
youmubot-osu/src/models/parse.rs View File

@@ -195,6 +195,8 @@ fn parse_language(s: impl AsRef<str>) -> ParseResult<Language> {
9 => Swedish,
10 => Spanish,
11 => Italian,
12 => Russian,
13 => Polish,
_ => {
return Err(ParseError::InvalidValue {
field: "language",
@@ -218,7 +220,10 @@ fn parse_genre(s: impl AsRef<str>) -> ParseResult<Genre> {
7 => Novelty,
9 => HipHop,
10 => Electronic,
11 => Metal,
12 => Classical,
13 => Folk,
14 => Jazz,
_ => {
return Err(ParseError::InvalidValue {
field: "genre",


Loading…
Cancel
Save