Skip to content

Commit

Permalink
generic elib deleted remover per sigel
Browse files Browse the repository at this point in the history
  • Loading branch information
kaipoykio committed Nov 27, 2024
1 parent 7a7fc81 commit f538db5
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//241127 KP, removes all fake deleted holds for 'sigel' with 'origin:Elib'
// add -Dsigel=SIGEL to command line

def sigel = System.getProperty("sigel")

if ( sigel == null ) {
println('set sigel with -Dsigel=SIGEL')
System.exit(0)
}

def sigel_elib_holds = """
collection = 'hold'
and data#>>'{@graph,1,heldBy,@id}' = 'https://libris.kb.se/library/${sigel}'
and data#>'{@graph,1,cataloguersNote}' @> '["origin:Elib"]'::jsonb
and data#>'{@graph,1,cataloguersNote}' @> '["deleted"]'::jsonb
and deleted = false
"""

selectBySqlWhere(sigel_elib_holds) { d ->
//def hold = d.getGraph()
//def id = hold[0].'@id'
//println('I: ' + id)
//println(hold)
d.scheduleDelete(loud: true)
}

0 comments on commit f538db5

Please sign in to comment.