Add radio station from params util
This commit is contained in:
@@ -225,4 +225,22 @@ function reloadAllRadioStationsCommand(command, params, client) {
|
||||
messageAdminAction(`All radio stations have been reloaded by an admin!`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function getRadioStationFromParams(params) {
|
||||
if(isNaN(params)) {
|
||||
for(let i in getServerData().radioStations) {
|
||||
if(toLowerCase(getServerData().radioStations[i].name).indexOf(toLowerCase(params)) != -1) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(typeof getServerData().radioStations[params] != "undefined") {
|
||||
return toInteger(params);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
Reference in New Issue
Block a user