Skip to content

Commit

Permalink
sort loaded entries, fixes #1163
Browse files Browse the repository at this point in the history
  • Loading branch information
segler-alex committed Sep 28, 2023
1 parent a0f78c3 commit 48ac2d4
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -527,14 +527,22 @@ List<DataRadioStation> LoadM3UReader(Reader reader) {
br.close();

List<DataRadioStation> listStationsNew = Utils.getStationsByUuid(httpClient, context, listUuids);
if (listStationsNew != null) {
return listStationsNew;

// sort list to have the same order as the initial save file
List<DataRadioStation> listStationsSorted = new ArrayList<DataRadioStation>();
for (String uuid: listUuids)
{
for (DataRadioStation s: listStationsNew){
if (uuid.equals(s.StationUuid)){
listStationsSorted.add(s);
break;
}
}
}
return listStationsSorted;
} catch (Exception e) {
Log.e("LOAD", "File read failed: " + e.toString());
return null;
}
List<DataRadioStation> loadedItems = new ArrayList<>();
return loadedItems;
}
}

0 comments on commit 48ac2d4

Please sign in to comment.