segler-alex / radiobrowser-api-rust

radio-browser API implementation in rust
GNU Affero General Public License v3.0
227 stars 97 forks source link

Duplicate entries for some countries in countries list #171

Closed fn-ix closed 10 months ago

fn-ix commented 1 year ago

Hi!

When sending an API call to .../json/countries, I get back two entries for Turkey:

  {
    "name": "Turkey",
    "iso_3166_1": "TR",
    "stationcount": 343
  },
  {
    "name": "Turkey",
    "iso_3166_1": "tr",
    "stationcount": 3
  }

The only differentiating factor seems to be the capitalization of the ISO code; these entries should be merged since they apply to the same country & it's also causing bugs when using the name as a unique identifier.

fn-ix commented 1 year ago

Very curious; an hour later, Turkey appears only once as expected, but now there are two entries for Italy:

  {
    "name": "Italy",
    "iso_3166_1": "IT",
    "stationcount": 1191
  },
  {
    "name": "Italy",
    "iso_3166_1": "it",
    "stationcount": 1
  }

Perhaps this is somehow related to how the server parses newly added stations? An Italian radio station shows up at the top of the “recently changed” list.