View Single Post
Old 02-23-2016, 04:26 PM   #1200
mariosipad
Guru
mariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watchmariosipad is clearly one to watch
 
Posts: 726
Karma: 10738
Join Date: Nov 2012
Device: iPad & iPhone with Marvin 2 + 3 & Kobo Glo HD
@teejcee
Quote:
Plus I've created a minor problem by naming my main library
"Calibre Library" ; note the space.
I had the same problem . I "fixed" it by renaming the library to "Calibre_Library".

Quote:
Yes...I know....GPS coordinates are a little over the top but it's interesting that you can do this kind of stuff
I agree, it's over the top. But I also agree that is is very nice one can do this kind of stuff.

I see you have the same "issue" with the name of the author as I had. I did not swap around the $GIVEN and $SURNAME, but I queried the database some more. See this bit of code:
Code:
  DBASE=${DATABASE["$DB"]}

  SQL1="select title from books where id="$ID" ;" 
  TITLE=$(sqlite3 $DBASE "$SQL1")

  SQL2="select name from authors where id="$(sqlite3 $DBASE "select author from books_authors_link where book="$ID" ;")" ;"
  AUTHOR=$(sqlite3 $DBASE "$SQL2")

  echo "$TIME $USER $IP : $TITLE  by  $AUTHOR" >> $TMPFILE
It now depends on how correct one has used the right given and surname in Calibre.

Another enhancement I made to the original code is:
Code:
Original:
grep -e "azw3"-e "epub" -e "mobi"  $LOGFILE | grep -e "200" > book-log.txt
Code:
New:
grep -E "(epub|mobi|azw3|azw|cbr|cbz)" $LOGFILE | grep -e "200" > book-log.txt
I think this little project is done and we deserve a
Or am I missing something and is there more room for improvement?

Greetz,
Mario
mariosipad is offline   Reply With Quote