diff --git a/src/Logchecker.php b/src/Logchecker.php index 9a80711..0e0a92a 100644 --- a/src/Logchecker.php +++ b/src/Logchecker.php @@ -462,6 +462,7 @@ class Logchecker $this->Combined = count($this->logs); } //is_combined foreach ($this->logs as $LogArrayKey => $Log) { + $this->Tracks[$LogArrayKey] = []; $this->CurrLog = $LogArrayKey + 1; if (preg_match('/Exact Audio Copy (.+) from/i', $Log, $Matches)) { //eac v1 & checksum if ($Matches[1]) { @@ -982,22 +983,28 @@ class Logchecker $this->account('Range rip detected', 30); } $FormattedTrackListing = ''; - //------ Handle individual tracks ------// + $TrackListing = ''; + $TrackBodies = []; if (!$this->Range) { + //------ Handle individual tracks ------// preg_match('/\nTrack( +)([0-9]{1,3})([^<]+)/i', $Log, $Matches); - $TrackListing = $Matches[0]; - $FullTracks = preg_split('/\nTrack( +)([0-9]{1,3})/i', $TrackListing, -1, PREG_SPLIT_DELIM_CAPTURE); - array_shift($FullTracks); - $TrackBodies = preg_split('/\nTrack( +)([0-9]{1,3})/i', $TrackListing, -1); - array_shift($TrackBodies); - //------ Range rip ------// + if (count($Matches) > 0) { + $TrackListing = $Matches[0]; + $FullTracks = preg_split('/\nTrack( +)([0-9]{1,3})/i', $TrackListing, -1, PREG_SPLIT_DELIM_CAPTURE); + array_shift($FullTracks); + $TrackBodies = preg_split('/\nTrack( +)([0-9]{1,3})/i', $TrackListing, -1); + array_shift($TrackBodies); + } } else { - preg_match('/\n( +)Filename +(.*)([^<]+)/i', $Log, $Matches); - $TrackListing = $Matches[0]; - $FullTracks = preg_split('/\n( +)Filename +(.*)/i', $TrackListing, -1, PREG_SPLIT_DELIM_CAPTURE); - array_shift($FullTracks); - $TrackBodies = preg_split('/\n( +)Filename +(.*)/i', $TrackListing, -1); - array_shift($TrackBodies); + //------ Range rip ------// + preg_match('/\n( *)Filename +(.*)([^<]+)/i', $Log, $Matches); + if (count($Matches) > 0) { + $TrackListing = $Matches[0]; + $FullTracks = preg_split('/\n( *)Filename +(.*)/i', $TrackListing, -1, PREG_SPLIT_DELIM_CAPTURE); + array_shift($FullTracks); + $TrackBodies = preg_split('/\n( *)Filename +(.*)/i', $TrackListing, -1); + array_shift($TrackBodies); + } } $Tracks = array(); foreach ($TrackBodies as $Key => $TrackBody) { diff --git a/tests/logs/eac/details/invalid_track_separator.json b/tests/logs/eac/details/invalid_track_separator.json new file mode 100644 index 0000000..cbfc9b9 --- /dev/null +++ b/tests/logs/eac/details/invalid_track_separator.json @@ -0,0 +1,11 @@ +{ + "ripper": "EAC", + "version": "1.6", + "language": "en", + "combined": false, + "score": 0, + "checksum": "checksum_missing", + "details": [ + "Invalid log, no tracks!" + ] +} diff --git a/tests/logs/eac/details/range_rip_no_space_before_filename.json b/tests/logs/eac/details/range_rip_no_space_before_filename.json new file mode 100644 index 0000000..0e10fa9 --- /dev/null +++ b/tests/logs/eac/details/range_rip_no_space_before_filename.json @@ -0,0 +1,13 @@ +{ + "ripper": "EAC", + "version": "1.6", + "language": "en", + "combined": false, + "score": 50, + "checksum": "checksum_invalid", + "details": [ + "Could not verify gap handling (-10 points)", + "Range rip detected (-30 points)", + "Test and copy was not used (-10 points)" + ] +} diff --git a/tests/logs/eac/html/invalid_track_separator.log b/tests/logs/eac/html/invalid_track_separator.log new file mode 100644 index 0000000..ba84bf9 --- /dev/null +++ b/tests/logs/eac/html/invalid_track_separator.log @@ -0,0 +1,87 @@ + +Exact Audio Copy V1.6 from 23. October 2020 + +EAC extraction logfile from 5. October 2023, 12:20 + +Neon Plastix / Dream , On Fire + +Used Drive : PLDS DVD+-RW DS-8ABSH 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 user + +Used output format : User Defined Encoder +Selected bitrate : 1024 kBit/s +Quality : High +Add ID3 tag : No +Command line compressor : Z:\opt\exact-audio-copy\Flac\flac.exe +Additional command line options : -8 -V -T "ARTIST=%artist%" -T "TITLE=%title%" -T "ALBUM=%albumtitle%" -T "DATE=%year%" -T +"userNUMBER=%usernr%" -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 "TOTALuserS=%numusers%" -T "COMMENT=%comment%" %source% -o %dest% + + +TOC of the extracted CD + + user | Start | Length | Start sector | End sector + --------------------------------------------------------- + 1 | 0:00.00 | 3:13.29 | 0 | 14503 + 2 | 3:13.29 | 3:56.16 | 14504 | 32219 + 3 | 7:09.45 | 3:40.26 | 32220 | 48745 + + +user 1 + + Filename Z:\home\LinkLucky\Music\Rips\Neon Plastix - Dream , On Fire [FLAC]\01 - Dream.wav + + Pre-gap length 0:00:02.00 + + Peak level 99.8 % + Extraction speed 2.7 X + user quality 100.0 % + Test CRC 814CB963 + Copy CRC 814CB963 + user not present in AccurateRip database + Copy OK + +user 2 + + Filename Z:\home\LinkLucky\Music\Rips\Neon Plastix - Dream , On Fire [FLAC]\02 - On Fire.wav + + Pre-gap length 0:00:01.60 + + Peak level 99.8 % + Extraction speed 3.0 X + user quality 100.0 % + Test CRC 6C24A712 + Copy CRC 6C24A712 + user not present in AccurateRip database + Copy OK + +user 3 + + Filename Z:\home\LinkLucky\Music\Rips\Neon Plastix - Dream , On Fire [FLAC]\03 - Halfway to Love.wav + + Pre-gap length 0:00:02.58 + + Peak level 99.8 % + Extraction speed 3.3 X + user quality 100.0 % + Test CRC DDE10390 + Copy CRC DDE10390 + user not present in AccurateRip database + Copy OK + + +None of the users are present in the AccurateRip database + +No errors occurred +End of status report \ No newline at end of file diff --git a/tests/logs/eac/html/range_rip_no_space_before_filename.log b/tests/logs/eac/html/range_rip_no_space_before_filename.log new file mode 100644 index 0000000..aae20a7 --- /dev/null +++ b/tests/logs/eac/html/range_rip_no_space_before_filename.log @@ -0,0 +1,72 @@ +Exact Audio Copy V1.6 from 23. October 2020 + +EAC extraction logfile from 18. September 2021, 11:48 + +聖飢魔II / 空の雫 (BMG, BVDR-1213) + +Used Drive : _NEC DVD_RW ND-3550A Adapter: 1 ID: 0 (not found in database) + +Read mode : Secure +Utilize accurate stream : Yes +Defeat audio cache : Yes +Make use of C2 pointers : No + +Read offset correction : 48 +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 + +Used output format : User Defined Encoder +Selected bitrate : 1024 kBit/s +Quality : High +Add ID3 tag : No +Command line compressor : C:\Program Files\Exact Audio Copy\Flac\flac.exe +Additional command line options : -V -8 -T "Date=%year%" -T "Genre=%genre%" %source% + + +TOC of the extracted CD + +Track | Start | Length | Start sector | End sector +--------------------------------------------------------- +1 | 0:00.37 | 4:58.00 | 37 | 22386 +2 | 4:58.37 | 4:46.00 | 22387 | 43836 +3 | 9:44.37 | 4:55.00 | 43837 | 65961 + + +Range status and errors + +Selected range + +Filename C:\Dkogure\聖飢魔II - 空の雫 (BMG, BVDR-1213).wav + +Peak level 100.0 % +Extraction speed 3.4 X +Range quality 99.9 % +Copy CRC 8CB5CC70 +Copy OK + +No errors occurred + + +AccurateRip summary + +Track 1 not present in database +Track 2 not present in database +Track 3 not present in database + +None of the tracks are present in the AccurateRip database + +End of status report + +---- CUETools DB Plugin V2.1.6 + +[CTDB TOCID: nh8tQRWz5TKO_Z7CPWNNCPs3pHk-] found +Submit result: already submitted +Track | CTDB Status +1 | (2/2) Accurately ripped +2 | (2/2) Accurately ripped +3 | (1/2) Accurately ripped, or (1/2) differs in 1 samples @04:54:71 + +==== Log checksum 9187251CC813F706519EADCD5741514C2F7280BC14D54E2E74B2BC32B2D5C986 ==== \ No newline at end of file diff --git a/tests/logs/eac/originals/invalid_track_separator.log b/tests/logs/eac/originals/invalid_track_separator.log new file mode 100644 index 0000000..81fbcb1 --- /dev/null +++ b/tests/logs/eac/originals/invalid_track_separator.log @@ -0,0 +1,87 @@ + +Exact Audio Copy V1.6 from 23. October 2020 + +EAC extraction logfile from 5. October 2023, 12:20 + +Neon Plastix / Dream , On Fire + +Used drive : PLDS DVD+-RW DS-8ABSH 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 user + +Used output format : User Defined Encoder +Selected bitrate : 1024 kBit/s +Quality : High +Add ID3 tag : No +Command line compressor : Z:\opt\exact-audio-copy\Flac\flac.exe +Additional command line options : -8 -V -T "ARTIST=%artist%" -T "TITLE=%title%" -T "ALBUM=%albumtitle%" -T "DATE=%year%" -T "userNUMBER=%usernr%" -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 "TOTALuserS=%numusers%" -T "COMMENT=%comment%" %source% -o %dest% + + +TOC of the extracted CD + + user | Start | Length | Start sector | End sector + --------------------------------------------------------- + 1 | 0:00.00 | 3:13.29 | 0 | 14503 + 2 | 3:13.29 | 3:56.16 | 14504 | 32219 + 3 | 7:09.45 | 3:40.26 | 32220 | 48745 + + +user 1 + + Filename Z:\home\LinkLucky\Music\Rips\Neon Plastix - Dream , On Fire [FLAC]\01 - Dream.wav + + Pre-gap length 0:00:02.00 + + Peak level 99.8 % + Extraction speed 2.7 X + user quality 100.0 % + Test CRC 814CB963 + Copy CRC 814CB963 + user not present in AccurateRip database + Copy OK + +user 2 + + Filename Z:\home\LinkLucky\Music\Rips\Neon Plastix - Dream , On Fire [FLAC]\02 - On Fire.wav + + Pre-gap length 0:00:01.60 + + Peak level 99.8 % + Extraction speed 3.0 X + user quality 100.0 % + Test CRC 6C24A712 + Copy CRC 6C24A712 + user not present in AccurateRip database + Copy OK + +user 3 + + Filename Z:\home\LinkLucky\Music\Rips\Neon Plastix - Dream , On Fire [FLAC]\03 - Halfway to Love.wav + + Pre-gap length 0:00:02.58 + + Peak level 99.8 % + Extraction speed 3.3 X + user quality 100.0 % + Test CRC DDE10390 + Copy CRC DDE10390 + user not present in AccurateRip database + Copy OK + + +None of the users are present in the AccurateRip database + +No errors occurred + +End of status report diff --git a/tests/logs/eac/originals/range_rip_no_space_before_filename.log b/tests/logs/eac/originals/range_rip_no_space_before_filename.log new file mode 100644 index 0000000..9049604 --- /dev/null +++ b/tests/logs/eac/originals/range_rip_no_space_before_filename.log @@ -0,0 +1,73 @@ +Exact Audio Copy V1.6 from 23. October 2020 + +EAC extraction logfile from 18. September 2021, 11:48 + +聖飢魔II / 空の雫 (BMG, BVDR-1213) + +Used drive : _NEC DVD_RW ND-3550A Adapter: 1 ID: 0 + +Read mode : Secure +Utilize accurate stream : Yes +Defeat audio cache : Yes +Make use of C2 pointers : No + +Read offset correction : 48 +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 + +Used output format : User Defined Encoder +Selected bitrate : 1024 kBit/s +Quality : High +Add ID3 tag : No +Command line compressor : C:\Program Files\Exact Audio Copy\Flac\flac.exe +Additional command line options : -V -8 -T "Date=%year%" -T "Genre=%genre%" %source% + + +TOC of the extracted CD + +Track | Start | Length | Start sector | End sector +--------------------------------------------------------- +1 | 0:00.37 | 4:58.00 | 37 | 22386 +2 | 4:58.37 | 4:46.00 | 22387 | 43836 +3 | 9:44.37 | 4:55.00 | 43837 | 65961 + + +Range status and errors + +Selected range + +Filename C:\Dkogure\聖飢魔II - 空の雫 (BMG, BVDR-1213).wav + +Peak level 100.0 % +Extraction speed 3.4 X +Range quality 99.9 % +Copy CRC 8CB5CC70 +Copy OK + +No errors occurred + + +AccurateRip summary + +Track 1 not present in database +Track 2 not present in database +Track 3 not present in database + +None of the tracks are present in the AccurateRip database + +End of status report + +---- CUETools DB Plugin V2.1.6 + +[CTDB TOCID: nh8tQRWz5TKO_Z7CPWNNCPs3pHk-] found +Submit result: already submitted +Track | CTDB Status +1 | (2/2) Accurately ripped +2 | (2/2) Accurately ripped +3 | (1/2) Accurately ripped, or (1/2) differs in 1 samples @04:54:71 + + +==== Log checksum 9187251CC813F706519EADCD5741514C2F7280BC14D54E2E74B2BC32B2D5C986 ====