Skip to content

Commit

Permalink
Merge pull request #474 from oleg-kuh/public/8.0
Browse files Browse the repository at this point in the history
Ignore non-compliant CUE sheets.
  • Loading branch information
mherger committed Dec 10, 2020
2 parents 4214b06 + 309bc7c commit b7d9ed8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Slim/Formats/Playlists/CUE.pm
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ sub parse {
my ($filename, $currtrack);
my $cuesheet = {};
my $tracks = {};
my $fileHasChanged = 0;

main::INFOLOG && $log->info("baseDir: [$baseDir]");

Expand Down Expand Up @@ -185,6 +186,7 @@ sub parse {
} elsif ($command eq 'TRACK') {

$inAlbum = 0;
$fileHasChanged = 0;

#Skipping non audio tracks.
if ($value =~ /^(\d+)\s+AUDIO/i && $filename) {
Expand All @@ -209,6 +211,10 @@ sub parse {

} elsif ($value =~ /^01\s+(\d+):(\d+):(\d+)/i) {

if ($fileHasChanged) {
$log->warn("Found INDEX 01 after FILE but before TRACK. Looks like non-comlaint CUE. Skipping.");
return;
}
$tracks->{$currtrack}->{'START'} = ($1 * 60) + $2 + ($3 / 75);
}

Expand Down Expand Up @@ -316,6 +322,7 @@ sub parse {
if ($value =~ /^\"(.*)\"/i) {
$filename = $embedded || $1;
$filename = Slim::Utils::Misc::fixPath($filename, $baseDir);
$fileHasChanged = 1;

main::DEBUGLOG && $log->is_debug && $log->debug('Filename with quotes ' . Data::Dump::dump({
line => $line,
Expand Down

0 comments on commit b7d9ed8

Please sign in to comment.