Commit 8f136ae9 authored by Tiago Grego's avatar Tiago Grego
Browse files

variable declaration moved to outside of conditional

parent fea6cf69
......@@ -197,11 +197,11 @@ sub get_tracks {
if ($key eq 'parent' || $key eq 'superTrack' || $key =~ /^subGroup[0-9]/) {
my @values = split /\s+/, $value;
my $on_off;
if ($key eq 'parent' || $key eq 'superTrack') {
if ($key eq 'superTrack' && $values[0] eq 'on') {
$tracks{$id}{'superTrack'} = shift @values;
my $on_off = shift @values if scalar @values;
$on_off = shift @values if scalar @values;
if ($on_off) {
$tracks{$id}{'on_off'} = $on_off eq 'show' ? 'on' : 'off';
}
......@@ -209,7 +209,7 @@ sub get_tracks {
else {
## Hack for incorrect hubs that use 'superTrack' in children instead of 'parent'
$tracks{$id}{'parent'} = shift @values;
my $on_off = shift @values if scalar @values;
$on_off = shift @values if scalar @values;
if ($on_off) {
$tracks{$id}{'on_off'} = ($on_off eq 'show' || $on_off eq 'on') ? 'on' : 'off';
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment