Compare commits

...
6 Commits
2 changed files with 21 additions and 7 deletions

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "orpheusnet/logchecker",
"description": "Logchecker for validating logs generated from supported ripping programs (like EAC and XLD)",
"version": "0.8.3",
"version": "0.8.6",
"license": "Unlicense",
"type": "library",
"authors": [
+20 -6
View File
@@ -116,6 +116,11 @@ class Logchecker {
}
private function convert_encoding() {
// Whipper uses UTF-8 so we don't need to bother checking, especially as it's
// possible a log may be falsely detected as a different encoding by chardet
if (strpos($this->Log, "Log created by: whipper") !== false) {
return;
}
// To parse the log, we want to deal with the log in UTF-8. EAC by default should
// always output to UTF-16 and XLD to UTF-8, but sometimes people view the log and
// re-encode them to something else (like Windows-1251), and we need to use chardet
@@ -159,8 +164,15 @@ class Logchecker {
}
private function whipper_parse() {
// Whipper 0.7.x has an issue where it can produce invalid YAML
// as it hand writes out the values without dealing properly
// with the escaping the output, so we fix that here
$log = preg_replace_callback('/^ (Release|Album): (.+)$/m', function ($match) {
return " {$match[1]}: ".Yaml::dump($match[2]);
}, $this->Log);
try {
$Yaml = Yaml::parse($this->Log);
$Yaml = Yaml::parse($log);
}
catch (ParseException $exception) {
$this->account('Could not parse whipper log.', 100);
@@ -512,7 +524,7 @@ class Logchecker {
'accurate_stream_eac_pre99'
), $Log, 1, $EAC_ac_stream_pre99);
if (!$EAC_ac_stream && !$EAC_ac_stream_pre99 && !$this->NonSecureMode && $EAC) {
$this->account('Could not verify accurate stream');
$this->account('Could not verify accurate stream', 20);
}
$Log = preg_replace_callback('/Defeat audio cache( +): (Yes|No)/i', array(
$this,
@@ -1154,18 +1166,20 @@ class Logchecker {
function accurate_stream($Matches)
{
if ($Matches[2] == 'Yes') {
$Class = 'goodish';
$Class = 'good';
} else {
$Class = 'badish';
$Class = 'bad';
$this->account('"Utilize accurate stream" should be yes', 20);
}
return '<span class="log5">Utilize accurate stream' . $Matches[1] . '</span>: <span class="' . $Class . '">' . $Matches[2] . '</span>';
}
function accurate_stream_eac_pre99($Matches)
{
if (strtolower($Matches[1]) != 'no ') {
$Class = 'goodish';
$Class = 'good';
} else {
$Class = 'badish';
$Class = 'bad';
$this->account('"accurate stream" should be yes', 20);
}
return ', <span class="' . $Class . '">' . $Matches[1] . 'accurate stream</span>';
}