-
Notifications
You must be signed in to change notification settings - Fork 0
/
gtstt.sh
executable file
·54 lines (47 loc) · 1 KB
/
gtstt.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#! /bin/bash
sql_head="SELECT nie:url(?image)
WHERE {
?image a nfo:Image"
sql_tags=
sql_date_filter=
sql_foot="
}
ORDER BY DESC(nie:contentCreated(?image))"
#tags_arr=
sql_lim=
sql_rating=
sql_final=
while getopts t:l:y:r: opt
do
case $opt in
t) tags_arr=(${OPTARG//,/ })
;;
l) sql_lim=" LIMIT ${OPTARG}"
;;
y) sql_date_filter="
;nie:contentCreated ?date .
FILTER (?date >= '${OPTARG}-01-01T00:00:00'
&& ?date < '${OPTARG}-12-31T00:00:00')"
;;
r) sql_rating="
;nao:numericRating ?rt .
FILTER (?rt >= '${OPTARG}')"
;;
esac
done
shift $((OPTIND - 1))
for i in "${tags_arr[@]}"; do
sql_tags="${sql_tags}
;nao:hasTag [ nao:prefLabel '$i' ]"
done
sql_final="${sql_head}\
${sql_tags}\
${sql_date_filter}\
${sql_rating}\
${sql_foot}\
${sql_lim}"
#echo "${sql_final}"
tracker-sparql -q "${sql_final}" \
| grep -o 'file:///.*' \
| xargs gthumb
# | xargs feh -t -W 1200 -. --index-info %u -