Skip to content

Commit

Permalink
Define 'book' based on ProQuest data
Browse files Browse the repository at this point in the history
  • Loading branch information
maccabeelevine committed Jan 29, 2025
1 parent 11b8543 commit ed7c53f
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions module/VuFind/src/VuFind/RecordDriver/ProQuestFSG.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function getTitle()
public function getContainerTitle()
{
// For books, don't display any container.
if ('Book' === $this->getOpenUrlFormat()) {
if ($this->isBook()) {
return '';
}
return $this->getFirstFieldValue('773', ['t']);
Expand All @@ -120,12 +120,23 @@ public function getContainerTitle()
public function getContainerReference()
{
// For books, don't display any container.
if ('Book' === $this->getOpenUrlFormat()) {
if ($this->isBook()) {
return '';
}
return $this->getFirstFieldValue('773', ['g']);
}

/**
* Try to determine if this is a book, based on ProQuest's use of MARC.
*
* @return bool
*/
protected function isBook()
{
$type = $this->getFirstFieldValue('513', ['a']);
return str_contains($type, 'Book') && !str_contains($type, 'Book Review');
}

/**
* Get the item's source.
*
Expand All @@ -146,7 +157,7 @@ public function getHumanReadablePublicationDates()
{
$dates = $this->marcGetHumanReadablePublicationDates();
// For books, we should only display the year
if ('Book' === $this->getOpenUrlFormat()) {
if ($this->isBook()) {
foreach ($dates as $i => $date) {
if (($pos = strpos($date, ',')) !== false) {
$dates[$i] = trim(substr($date, $pos + 1));
Expand Down

0 comments on commit ed7c53f

Please sign in to comment.