Skip to content

Commit

Permalink
Evergreen updates
Browse files Browse the repository at this point in the history
- Extend the timeout for loading reading history for Evergreen
- Properly handle titles that no longer exist within Evergreen when loading reading history for a patron.
- When importing lists from Evergreen, ensure that list entries have their titles set so the lists can be sorted by title.
  • Loading branch information
mdnoble73 committed Jan 10, 2025
1 parent 46d1994 commit 25206d5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
29 changes: 16 additions & 13 deletions code/web/Drivers/Evergreen.php
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,7 @@ public function getReadingHistory($patron, $page = 1, $recordsPerPage = -1, $sor
$offset = 0;
$hasMoreHistory = true;

set_time_limit(0);
while ($hasMoreHistory) {
$authToken = $this->getAPIAuthToken($patron, false);
if ($authToken != null) {
Expand Down Expand Up @@ -876,18 +877,20 @@ public function getReadingHistory($patron, $page = 1, $recordsPerPage = -1, $sor
}
} else {
$checkout = $this->loadCheckoutData($patron, $circEntryMapped['source_circ'], $authToken);
$curTitle = [];
$curTitle['id'] = $checkout->recordId;
$curTitle['shortId'] = $checkout->recordId;
$curTitle['recordId'] = $checkout->recordId;
$curTitle['title'] = $checkout->title;
$curTitle['author'] = $checkout->author;
$curTitle['format'] = $checkout->format;
$curTitle['checkout'] = $checkout->checkoutDate;
if (!empty($circEntryMapped['checkin_time'])) {
$curTitle['checkin'] = strtotime($circEntryMapped['checkin_time']);
} else {
$curTitle['checkin'] = null;
if ($checkout != null) {
$curTitle = [];
$curTitle['id'] = $checkout->recordId;
$curTitle['shortId'] = $checkout->recordId;
$curTitle['recordId'] = $checkout->recordId;
$curTitle['title'] = $checkout->title;
$curTitle['author'] = $checkout->author;
$curTitle['format'] = $checkout->format;
$curTitle['checkout'] = $checkout->checkoutDate;
if (!empty($circEntryMapped['checkin_time'])) {
$curTitle['checkin'] = strtotime($circEntryMapped['checkin_time']);
} else {
$curTitle['checkin'] = null;
}
}
}
$readingHistoryTitles[] = $curTitle;
Expand All @@ -898,7 +901,6 @@ public function getReadingHistory($patron, $page = 1, $recordsPerPage = -1, $sor
$offset += 100;
}

set_time_limit(20 * count($readingHistoryTitles));
$systemVariables = SystemVariables::getSystemVariables();
global $aspen_db;
require_once ROOT_DIR . '/RecordDrivers/GroupedWorkDriver.php';
Expand Down Expand Up @@ -2407,6 +2409,7 @@ function importListsFromIls($patron) {
$listEntry = new UserListEntry();
$listEntry->source = 'GroupedWork';
$listEntry->sourceId = $groupedWork->permanent_id;
$listEntry->title = StringUtils::trimStringToLengthAtWordBoundary($groupedWork->full_title, 50, true);
$listEntry->listId = $newList->id;
$listEntry->notes = '';
$listEntry->dateAdded = strtotime($createTime);
Expand Down
5 changes: 5 additions & 0 deletions code/web/release_notes/25.02.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
- Add a new API to retrieve available sublocations for the system. (DIS-195) (*MDN*)
- API updates to support using multiple pickup areas within a location. (DIS-195) (*MDN*)

### Evergreen updates
- Extend the timeout for loading reading history for Evergreen. (*MDN*)
- Properly handle titles that no longer exist within Evergreen when loading reading history for a patron. (*MDN*)
- When importing lists from Evergreen, ensure that list entries have their titles set so the lists can be sorted by title. (*MDN*)

//katherine

//kirstien
Expand Down

0 comments on commit 25206d5

Please sign in to comment.