From 525b5fc17dbd38eaf4fccd98895bdb1502949e33 Mon Sep 17 00:00:00 2001 From: itismadness Date: Wed, 29 Apr 2020 13:09:07 +0100 Subject: [PATCH] fix bug where some combined logs would be checksum_missing instead of checksum_invalid --- src/Logchecker.php | 8 +- tests/logs/eac/details/combined_mp3_1.json | 12 ++ tests/logs/eac/html/combined_mp3_1.log | 223 ++++++++++++++++++++++++++++ tests/logs/eac/originals/combined_mp3_1.log | 223 ++++++++++++++++++++++++++++ 4 files changed, 464 insertions(+), 2 deletions(-) create mode 100644 tests/logs/eac/details/combined_mp3_1.json create mode 100644 tests/logs/eac/html/combined_mp3_1.log create mode 100644 tests/logs/eac/originals/combined_mp3_1.log diff --git a/src/Logchecker.php b/src/Logchecker.php index 7dedf12..a58c891 100644 --- a/src/Logchecker.php +++ b/src/Logchecker.php @@ -536,14 +536,18 @@ class Logchecker } $Class = $this->checksumStatus === Check\Checksum::CHECKSUM_OK ? 'good' : 'bad'; - $Log = preg_replace('/(\=+\s+Log checksum.*)/i', "$1", $Log, 1, $Count); + $Log = preg_replace('/(\=+\s+Log checksum.*)/i', "$1", $Log, 1, $eacCount); $Log = preg_replace( '/([\-]+BEGIN XLD SIGNATURE[\S\n\-]+END XLD SIGNATURE[\-]+)/i', "$1", $Log, 1, - $Count + $xldCount ); + // EAC will at least output "no checksum" for some malformed logs with checksums + if (($eacCount > 0 || $xldCount > 0) && $this->checksumStatus === Check\Checksum::CHECKSUM_MISSING) { + $this->checksumStatus = Check\Checksum::CHECKSUM_INVALID; + } $Log = preg_replace_callback("/Used drive( *): (.+)/i", array( $this, diff --git a/tests/logs/eac/details/combined_mp3_1.json b/tests/logs/eac/details/combined_mp3_1.json new file mode 100644 index 0000000..936f819 --- /dev/null +++ b/tests/logs/eac/details/combined_mp3_1.json @@ -0,0 +1,12 @@ +{ + "ripper": "EAC", + "version": "1.5", + "language": "en", + "combined": true, + "score": 99, + "checksum": "checksum_invalid", + "details": [ + "Combined Log (2)", + "ID3 tags should not be added to FLAC files - they are mainly for MP3 files. FLACs should have vorbis comments for tags instead. (-1 point)" + ] +} diff --git a/tests/logs/eac/html/combined_mp3_1.log b/tests/logs/eac/html/combined_mp3_1.log new file mode 100644 index 0000000..57f2bf8 --- /dev/null +++ b/tests/logs/eac/html/combined_mp3_1.log @@ -0,0 +1,223 @@ +Exact Audio Copy V1.5 from 20. February 2020 + +EAC extraction logfile from 17. April 2020, 19:35 + +John Coltrane / A Love Supreme + +Used Drive : HL-DT-STDVDRAM GH24NSB0 Adapter: 1 ID: 0 + +Read mode : Secure +Utilize accurate stream : Yes +Defeat audio cache : Yes +Make use of C2 pointers : No + +Read offset correction : 6 +Overread into Lead-In and Lead-Out : No +Fill up missing offset samples with silence : Yes +Delete leading and trailing silent blocks : No +Null samples used in CRC calculations : Yes +Used interface : Native Win32 interface for Win NT & 2000 +Gap handling : Appended to previous track + +Used output format : User Defined Encoder +Selected bitrate : 768 kBit/s +Quality : High +Add ID3 tag : No +Command line compressor : C:\Program Files (x86)\Exact Audio Copy\FLAC\FLAC.EXE +Additional command line options : -8 -e -p -V -T "ARTIST=%artist%" -T "TITLE=%title%" -T "ALBUM=%albumtitle%" -T "DATE=%year%" -T +"TRACKNUMBER=%tracknr%" -T "GENRE=%genre%" -T "PERFORMER=%albuminterpret%" -T "COMPOSER=%composer%" %haslyrics%--tag-from-file=LYRICS="%lyricsfile%"%haslyrics% -T "ALBUMARTIST=%albumartist%" -T "DISCNUMBER=%cdnumber%" -T "TOTALDISCS=%totalcds%" -T "TOTALTRACKS=%numtracks%" -T "COMMENT=%comment%" %source% -o %dest% + + +TOC of the extracted CD + + Track | Start | Length | Start sector | End sector + --------------------------------------------------------- + 1 | 0:00.00 | 7:42.65 | 0 | 34714 + 2 | 7:42.65 | 7:19.34 | 34715 | 67673 + 3 | 15:02.24 | 10:42.38 | 67674 | 115861 + 4 | 25:44.62 | 7:02.68 | 115862 | 147579 + + +Track 1 + + Filename E:\Test Rip\01 Acknowledgement.wav + + Pre-gap length 0:00:02.00 + + Peak level 97.6 % + Extraction speed 5.3 X + Track quality 100.0 % + Test CRC 322247B3 + Copy CRC 322247B3 + Accurately ripped (confidence 200) [FB072CAB] (AR v2) + Copy OK + +Track 2 + + Filename E:\Test Rip\02 Resolution.wav + + Peak level 97.6 % + Extraction speed 6.1 X + Track quality 100.0 % + Test CRC 4732C420 + Copy CRC 4732C420 + Accurately ripped (confidence 200) [F8254929] (AR v2) + Copy OK + +Track 3 + + Filename E:\Test Rip\03 Pursuance.wav + + Pre-gap length 0:00:01.46 + + Peak level 97.6 % + Extraction speed 7.1 X + Track quality 100.0 % + Test CRC 71958F92 + Copy CRC 71958F92 + Accurately ripped (confidence 200) [4FC2DCC6] (AR v2) + Copy OK + +Track 4 + + Filename E:\Test Rip\04 Psalm.wav + + Peak level 95.7 % + Extraction speed 7.6 X + Track quality 100.0 % + Test CRC 0C8D6B7E + Copy CRC 0C8D6B7E + Accurately ripped (confidence 200) [36EF184C] (AR v2) + Copy OK + + +All tracks accurately ripped + +No errors occurred + +End of status report + +---- CUETools DB Plugin V2.1.6 + +[CTDB TOCID: 3Ymtej0heE3Qv3LM2ZTKNGwiRV8-] found +Submit result: already submitted +Track | CTDB Status + 1 | (961/1326) Accurately ripped + 2 | (966/1326) Accurately ripped + 3 | (961/1326) Accurately ripped + 4 | (963/1326) Accurately ripped + +==== Log checksum 5168768818AD8271F9E33889E0FF7123188A08EB490B3FD922F4335E1C74BEDC ==== + +------------------------------------------------------------ + +Exact Audio Copy V1.5 from 20. February 2020 + +EAC extraction logfile from 17. April 2020, 19:35 + +John Coltrane / A Love Supreme + +Used Drive : HL-DT-STDVDRAM GH24NSB0 Adapter: 1 ID: 0 + +Read mode : Secure +Utilize accurate stream : Yes +Defeat audio cache : Yes +Make use of C2 pointers : No + +Read offset correction : 6 +Overread into Lead-In and Lead-Out : No +Fill up missing offset samples with silence : Yes +Delete leading and trailing silent blocks : No +Null samples used in CRC calculations : Yes +Used interface : Native Win32 interface for Win NT & 2000 +Gap handling : Appended to previous track + +Used output format : User Defined Encoder +Selected bitrate : 320 kBit/s +Quality : High +Add ID3 tag : Yes +Command line compressor : E:\Tools\lame.exe +Additional command line options : -V0 --vbr-new --tt "%title%" --ta "%artist%" --tl "%albumtitle%" --ty "%year%" --tn "%tracknr%" %source% +%dest% + + +TOC of the extracted CD + + Track | Start | Length | Start sector | End sector + --------------------------------------------------------- + 1 | 0:00.00 | 7:42.65 | 0 | 34714 + 2 | 7:42.65 | 7:19.34 | 34715 | 67673 + 3 | 15:02.24 | 10:42.38 | 67674 | 115861 + 4 | 25:44.62 | 7:02.68 | 115862 | 147579 + + +Track 1 + + Filename E:\Test Rip\01 Acknowledgement.wav + + Pre-gap length 0:00:02.00 + + Peak level 97.6 % + Extraction speed 5.3 X + Track quality 100.0 % + Test CRC 322247B3 + Copy CRC 322247B3 + Accurately ripped (confidence 200) [FB072CAB] (AR v2) + Copy OK + +Track 2 + + Filename E:\Test Rip\02 Resolution.wav + + Peak level 97.6 % + Extraction speed 6.1 X + Track quality 100.0 % + Test CRC 4732C420 + Copy CRC 4732C420 + Accurately ripped (confidence 200) [F8254929] (AR v2) + Copy OK + +Track 3 + + Filename E:\Test Rip\03 Pursuance.wav + + Pre-gap length 0:00:01.46 + + Peak level 97.6 % + Extraction speed 7.1 X + Track quality 100.0 % + Test CRC 71958F92 + Copy CRC 71958F92 + Accurately ripped (confidence 200) [4FC2DCC6] (AR v2) + Copy OK + +Track 4 + + Filename E:\Test Rip\04 Psalm.wav + + Peak level 95.7 % + Extraction speed 7.6 X + Track quality 100.0 % + Test CRC 0C8D6B7E + Copy CRC 0C8D6B7E + Accurately ripped (confidence 200) [36EF184C] (AR v2) + Copy OK + + +All tracks accurately ripped + +No errors occurred + +End of status report + +---- CUETools DB Plugin V2.1.6 + +[CTDB TOCID: 3Ymtej0heE3Qv3LM2ZTKNGwiRV8-] found +Submit result: already submitted +Track | CTDB Status + 1 | (961/1326) Accurately ripped + 2 | (966/1326) Accurately ripped + 3 | (961/1326) Accurately ripped + 4 | (963/1326) Accurately ripped + +==== Log checksum 9FE4FA4CE31EF3C9B70A448AFA4B9E5862E040593FE0673DC1C8A4BA257D9E97 ==== \ No newline at end of file diff --git a/tests/logs/eac/originals/combined_mp3_1.log b/tests/logs/eac/originals/combined_mp3_1.log new file mode 100644 index 0000000..a43e2af --- /dev/null +++ b/tests/logs/eac/originals/combined_mp3_1.log @@ -0,0 +1,223 @@ +Exact Audio Copy V1.5 from 20. February 2020 + +EAC extraction logfile from 17. April 2020, 19:35 + +John Coltrane / A Love Supreme + +Used drive : HL-DT-STDVDRAM GH24NSB0 Adapter: 1 ID: 0 + +Read mode : Secure +Utilize accurate stream : Yes +Defeat audio cache : Yes +Make use of C2 pointers : No + +Read offset correction : 6 +Overread into Lead-In and Lead-Out : No +Fill up missing offset samples with silence : Yes +Delete leading and trailing silent blocks : No +Null samples used in CRC calculations : Yes +Used interface : Native Win32 interface for Win NT & 2000 +Gap handling : Appended to previous track + +Used output format : User Defined Encoder +Selected bitrate : 768 kBit/s +Quality : High +Add ID3 tag : No +Command line compressor : C:\Program Files (x86)\Exact Audio Copy\FLAC\FLAC.EXE +Additional command line options : -8 -e -p -V -T "ARTIST=%artist%" -T "TITLE=%title%" -T "ALBUM=%albumtitle%" -T "DATE=%year%" -T "TRACKNUMBER=%tracknr%" -T "GENRE=%genre%" -T "PERFORMER=%albuminterpret%" -T "COMPOSER=%composer%" %haslyrics%--tag-from-file=LYRICS="%lyricsfile%"%haslyrics% -T "ALBUMARTIST=%albumartist%" -T "DISCNUMBER=%cdnumber%" -T "TOTALDISCS=%totalcds%" -T "TOTALTRACKS=%numtracks%" -T "COMMENT=%comment%" %source% -o %dest% + + +TOC of the extracted CD + + Track | Start | Length | Start sector | End sector + --------------------------------------------------------- + 1 | 0:00.00 | 7:42.65 | 0 | 34714 + 2 | 7:42.65 | 7:19.34 | 34715 | 67673 + 3 | 15:02.24 | 10:42.38 | 67674 | 115861 + 4 | 25:44.62 | 7:02.68 | 115862 | 147579 + + +Track 1 + + Filename E:\Test Rip\01 Acknowledgement.wav + + Pre-gap length 0:00:02.00 + + Peak level 97.6 % + Extraction speed 5.3 X + Track quality 100.0 % + Test CRC 322247B3 + Copy CRC 322247B3 + Accurately ripped (confidence 200) [FB072CAB] (AR v2) + Copy OK + +Track 2 + + Filename E:\Test Rip\02 Resolution.wav + + Peak level 97.6 % + Extraction speed 6.1 X + Track quality 100.0 % + Test CRC 4732C420 + Copy CRC 4732C420 + Accurately ripped (confidence 200) [F8254929] (AR v2) + Copy OK + +Track 3 + + Filename E:\Test Rip\03 Pursuance.wav + + Pre-gap length 0:00:01.46 + + Peak level 97.6 % + Extraction speed 7.1 X + Track quality 100.0 % + Test CRC 71958F92 + Copy CRC 71958F92 + Accurately ripped (confidence 200) [4FC2DCC6] (AR v2) + Copy OK + +Track 4 + + Filename E:\Test Rip\04 Psalm.wav + + Peak level 95.7 % + Extraction speed 7.6 X + Track quality 100.0 % + Test CRC 0C8D6B7E + Copy CRC 0C8D6B7E + Accurately ripped (confidence 200) [36EF184C] (AR v2) + Copy OK + + +All tracks accurately ripped + +No errors occurred + +End of status report + +---- CUETools DB Plugin V2.1.6 + +[CTDB TOCID: 3Ymtej0heE3Qv3LM2ZTKNGwiRV8-] found +Submit result: already submitted +Track | CTDB Status + 1 | (961/1326) Accurately ripped + 2 | (966/1326) Accurately ripped + 3 | (961/1326) Accurately ripped + 4 | (963/1326) Accurately ripped + + +==== Log checksum 5168768818AD8271F9E33889E0FF7123188A08EB490B3FD922F4335E1C74BEDC ==== + +------------------------------------------------------------ + +Exact Audio Copy V1.5 from 20. February 2020 + +EAC extraction logfile from 17. April 2020, 19:35 + +John Coltrane / A Love Supreme + +Used drive : HL-DT-STDVDRAM GH24NSB0 Adapter: 1 ID: 0 + +Read mode : Secure +Utilize accurate stream : Yes +Defeat audio cache : Yes +Make use of C2 pointers : No + +Read offset correction : 6 +Overread into Lead-In and Lead-Out : No +Fill up missing offset samples with silence : Yes +Delete leading and trailing silent blocks : No +Null samples used in CRC calculations : Yes +Used interface : Native Win32 interface for Win NT & 2000 +Gap handling : Appended to previous track + +Used output format : User Defined Encoder +Selected bitrate : 320 kBit/s +Quality : High +Add ID3 tag : Yes +Command line compressor : E:\Tools\lame.exe +Additional command line options : -V0 --vbr-new --tt "%title%" --ta "%artist%" --tl "%albumtitle%" --ty "%year%" --tn "%tracknr%" %source% %dest% + + +TOC of the extracted CD + + Track | Start | Length | Start sector | End sector + --------------------------------------------------------- + 1 | 0:00.00 | 7:42.65 | 0 | 34714 + 2 | 7:42.65 | 7:19.34 | 34715 | 67673 + 3 | 15:02.24 | 10:42.38 | 67674 | 115861 + 4 | 25:44.62 | 7:02.68 | 115862 | 147579 + + +Track 1 + + Filename E:\Test Rip\01 Acknowledgement.wav + + Pre-gap length 0:00:02.00 + + Peak level 97.6 % + Extraction speed 5.3 X + Track quality 100.0 % + Test CRC 322247B3 + Copy CRC 322247B3 + Accurately ripped (confidence 200) [FB072CAB] (AR v2) + Copy OK + +Track 2 + + Filename E:\Test Rip\02 Resolution.wav + + Peak level 97.6 % + Extraction speed 6.1 X + Track quality 100.0 % + Test CRC 4732C420 + Copy CRC 4732C420 + Accurately ripped (confidence 200) [F8254929] (AR v2) + Copy OK + +Track 3 + + Filename E:\Test Rip\03 Pursuance.wav + + Pre-gap length 0:00:01.46 + + Peak level 97.6 % + Extraction speed 7.1 X + Track quality 100.0 % + Test CRC 71958F92 + Copy CRC 71958F92 + Accurately ripped (confidence 200) [4FC2DCC6] (AR v2) + Copy OK + +Track 4 + + Filename E:\Test Rip\04 Psalm.wav + + Peak level 95.7 % + Extraction speed 7.6 X + Track quality 100.0 % + Test CRC 0C8D6B7E + Copy CRC 0C8D6B7E + Accurately ripped (confidence 200) [36EF184C] (AR v2) + Copy OK + + +All tracks accurately ripped + +No errors occurred + +End of status report + +---- CUETools DB Plugin V2.1.6 + +[CTDB TOCID: 3Ymtej0heE3Qv3LM2ZTKNGwiRV8-] found +Submit result: already submitted +Track | CTDB Status + 1 | (961/1326) Accurately ripped + 2 | (966/1326) Accurately ripped + 3 | (961/1326) Accurately ripped + 4 | (963/1326) Accurately ripped + + +==== Log checksum 9FE4FA4CE31EF3C9B70A448AFA4B9E5862E040593FE0673DC1C8A4BA257D9E97 ==== \ No newline at end of file