Skip to content

Commit

Permalink
temporarily turning off limit parameter
Browse files Browse the repository at this point in the history
produces an error when the total number of items is less than the limit
  • Loading branch information
nathangibson committed Jun 25, 2020
1 parent ca8114e commit efcc9b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion get-zotero-data.xql
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ declare function local:get-zotero-data($url){
declare function local:get-zotero(){
let $start := if(request:get-parameter('start', '') != '') then concat('&start=',request:get-parameter('start', '')) else '&start=0'
let $limit := if(request:get-parameter('limit', '') != '') then concat('&limit=',request:get-parameter('limit', '')) else '&limit=100'
let $url := if(request:get-parameter('next', '') != '') then request:get-parameter('next', '') else concat($zotero-api,'/groups/',$groupid,'/items?format=',$format,if($format='json') then '&include=bib,data,coins,citation&style=chicago-fullnote-bibliography' else(),$start, $limit)
let $url := if(request:get-parameter('next', '') != '') then request:get-parameter('next', '') else concat($zotero-api,'/groups/',$groupid,'/items?format=',$format,if($format='json') then '&include=bib,data,coins,citation&style=chicago-fullnote-bibliography' else(),$start (:, $limit:))
let $items := local:get-zotero-data($url)
let $items-info := $items[1]
let $total := $items-info/http:header[@name='total-results']/@value
Expand Down

3 comments on commit efcc9b5

@nathangibson
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wsalesky The Zotero API gives an error when the limit is higher than the actual number of items, such as https://api.zotero.org/groups/2349036/collections/SZNGBJ7Z/items?format=tei&start=0&limit=1000
I've just commented that out here, but does something need to be changed properly in the code? Should I make an issue?

@wsalesky
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nathangibson yes, please make an issue. Thanks!

@nathangibson
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.