Skip to content

Commit

Permalink
Work on #466.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjordan committed Apr 16, 2018
1 parent e7d7ece commit 47884d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/filegetters/CsvBooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@ public function __construct($settings)
*/
public function getChildren($record_key)
{
$item_info = $this->fetcher->getItemInfo($record_key);
$book_directory = $item_info->{$this->file_name_field};

$page_paths = array();
$book_input_path = $this->getBookSourcePath($record_key);
foreach ($this->OBJFilePaths as $path) {
if (strpos($path, $book_input_path) === 0) {
$current_book_dirname = dirname($path);
if ($current_book_dirname === $this->input_directory . DIRECTORY_SEPARATOR . $book_directory) {
$page_paths[] = $path;
}
}
Expand Down
7 changes: 5 additions & 2 deletions src/filegetters/CsvNewspapers.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,15 @@ public function __construct($settings)
*/
public function getChildren($record_key)
{
$item_info = $this->fetcher->getItemInfo($record_key);
$issue_directory = $item_info->{$this->file_name_field};

$page_paths = array();
$issue_input_path = $this->getIssueSourcePath($record_key);
foreach ($this->OBJFilePaths as $paths) {
foreach ($paths as $path) {
// If there's a match, we expect it to start at position 0.
if (strpos($path, $issue_input_path) === 0) {
$current_issue_dirname = dirname($path);
if ($current_issue_dirname === $this->input_directory . DIRECTORY_SEPARATOR . $issue_directory) {
$page_paths[] = $path;
}
}
Expand Down

0 comments on commit 47884d7

Please sign in to comment.