#!/bin/bash

UD=`xdg-user-dir PICTURES`/Jolla/
# This should be enough but seems the tracker db is in an inconsistent state
# It thinks the files are indexed already
#for image in $(find $UD -name "*.jpg") ; do
#  tracker-control -f $image
#done

ACTUAL=$(find $UD -type f | wc -l)
INDEXED=$(tracker-search -i | grep $UD | wc -l)
test $INDEXED -ge $ACTUAL || tracker-control -rs

