radiobrowser-api-rust icon indicating copy to clipboard operation
radiobrowser-api-rust copied to clipboard

Duplicate entries for some countries in countries list

Open fn-ix opened this issue 2 years ago • 1 comments

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 avatar Oct 11 '22 19:10 fn-ix

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.

fn-ix avatar Oct 11 '22 20:10 fn-ix