|
|
@ -213,8 +213,14 @@ public class RadioPlayer implements Device { |
|
|
|
|
|
|
|
public String changeOrderInSavedPlaylist(int nr) { |
|
|
|
String station = playedStation; |
|
|
|
savedPlaylist.remove(playedStation); |
|
|
|
savedPlaylist.add(nr-1,station); |
|
|
|
return"Station " + playedStation + " is now on place 0" + nr + "in saved playlist"; |
|
|
|
if((nr-1) > savedPlaylist.size()) { |
|
|
|
savedPlaylist.remove(playedStation); |
|
|
|
savedPlaylist.add(savedPlaylist.size(),station); |
|
|
|
return"Station " + playedStation + " is now on place 0" + nr + "in saved playlist"; |
|
|
|
} else { |
|
|
|
savedPlaylist.remove(playedStation); |
|
|
|
savedPlaylist.add(nr - 1, station); |
|
|
|
return "Station " + playedStation + " is now on place 0" + (savedPlaylist.size()+1) + "in saved playlist"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |