Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Ignore mp3 files that mp3gain cannot process #120

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions application/libraries/Librivox_id3tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ function _create_files_table($dir, $map = array(), $freeze = false)

//analyze volume
$mp3gain_result = $this->librivox_mp3gain->analyze_file($dir, $file);
if (! $mp3gain_result) continue;

$file_array = $this-> _create_file_array($freeze); //prototype

Expand Down
10 changes: 7 additions & 3 deletions application/libraries/Librivox_mp3gain.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,13 @@ public function analyze_file($dir, $file_name)
$command = $this->mp3gain . ' ' . $this->flag . $dir. $file_name;
exec($command, $output);

$parts = explode("\t", $output[1]);
if (count($output) > 1) {
$parts = explode("\t", $output[1]);
return $parts;
} else {
return false;
}

return $parts;

}

Expand All @@ -89,4 +93,4 @@ public function adjust($dir, $map)
unset($output);
}
}
}
}