Skip to content

Commit

Permalink
Work on #498.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjordan committed Feb 20, 2019
1 parent 3af3793 commit 170a2de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/writers/CsvBooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ public function writePackages($metadata, $pages, $record_id)
$filename_segments = explode($this->page_sequence_separator, $pathinfo['filename']);

$page_number = ltrim(end($filename_segments), '0');
if (strlen($page_number) === 0) {
$page_number = '0';
}
$page_level_output_dir = $book_level_output_dir . DIRECTORY_SEPARATOR . $page_number;
mkdir($page_level_output_dir);

Expand Down
3 changes: 3 additions & 0 deletions src/writers/CsvNewspapers.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ public function writePackages($metadata, $pages, $record_id)
$pathinfo = pathinfo($page_path);
$filename_segments = explode($this->page_sequence_separator, $pathinfo['filename']);
$page_number = ltrim(end($filename_segments), '0');
if (strlen($page_number) === 0) {
$page_number = '0';
}
$page_level_output_dir = $issue_level_output_dir . DIRECTORY_SEPARATOR . $page_number;
mkdir($page_level_output_dir);

Expand Down

0 comments on commit 170a2de

Please sign in to comment.