Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <louis@chmn.me>
  • Loading branch information
artonge committed Nov 14, 2023
1 parent 498ecdb commit 18582ec
Showing 1 changed file with 34 additions and 12 deletions.
46 changes: 34 additions & 12 deletions src/services/PhotoSearch.js
Expand Up @@ -100,21 +100,43 @@ export default async function(path = '', options = {}) {
let timeWindow = ''
if (options.dateTimeUpperBound !== undefined) {
timeWindow = `
<d:lt>
<d:prop>
<nc:metadata-photos-original_date_time/>
</d:prop>
<d:literal>${options.dateTimeUpperBound}</d:literal>
</d:lt>`
<d:or>
<d:lte>
<d:prop><nc:metadata-photos-original_date_time/></d:prop>
<d:literal>${options.dateTimeUpperBound}</d:literal>
</d:lte>
<d:and>
<d:not>
<d:is-defined>
<d:prop><nc:metadata-photos-original_date_time/></d:prop>
</d:is-defined>
</d:not>
<d:lte>
<d:prop><d:getlastmodified/></d:prop>
<d:literal>${options.dateTimeUpperBound}</d:literal>
</d:lte>
</d:and>
</d:or>`
}
if (options.dateTimeLowerBound !== undefined) {
timeWindow += `
<d:gt>
<d:prop>
<nc:metadata-photos-original_date_time/>
</d:prop>
<d:literal>${options.dateTimeLowerBound}</d:literal>
</d:gt>`
<d:or>
<d:gt>
<d:prop><nc:metadata-photos-original_date_time/></d:prop>
<d:literal>${options.dateTimeLowerBound}</d:literal>
</d:gt>
<d:and>
<d:not>
<d:is-defined>
<d:prop><nc:metadata-photos-original_date_time/></d:prop>
</d:is-defined>
</d:not>
<d:gt>
<d:prop><d:getlastmodified/></d:prop>
<d:literal>${options.dateTimeLowerBound}</d:literal>
</d:gt>
</d:and>
</d:or>`
}

options = Object.assign({
Expand Down

0 comments on commit 18582ec

Please sign in to comment.