#1094 -- Better filtering of non-duplicated values during station cloning.

This commit is contained in:
Buster "Silver Eagle" Neece 2019-01-10 02:05:56 -06:00
parent 981a09483d
commit fefbb5d573
1 changed files with 13 additions and 1 deletions

View File

@ -165,7 +165,19 @@ class StationsController
$new_record_data['name'] = $data['name'];
$new_record_data['description'] = $data['description'];
unset($new_record_data['short_name'], $new_record_data['radio_base_dir']);
$unset_values = [
'short_name',
'radio_base_dir',
'nowplaying',
'nowplaying_timestamp',
'is_streamer_live',
'needs_restart',
'has_started',
];
foreach($unset_values as $unset_value) {
unset($new_record_data[$unset_value]);
}
if ($data['clone_media'] === 'share') {
$new_record_data['radio_media_dir'] = $record->getRadioMediaDir();