fsantini / KoboCloud

A set of scripts to synchronize a kobo reader with popular cloud services
Other
994 stars 95 forks source link

Books with spaces don't work with REMOVE_DELETED feature #105

Closed dgsiegel closed 2 years ago

dgsiegel commented 2 years ago

I've got plenty of books with spaces in their filenames, e.g. McLuhan - Understanding Media.kepub.epub. With the newest version of KoboCloud, the logs are full of lines like these:

grep: Understanding: No such file or directory
grep: Media.kepub.epub: No such file or directory
McLuhan - Understanding Media.kepub.epub found

My guess would be that this comes from this line https://github.com/fsantini/KoboCloud/blob/master/src/usr/local/kobocloud/get.sh#L67 in which $item should be quoted. In my example this will expand to

elif grep -q McLuhan - Understanding Media.kepub.epub "$Lib/filesList.log"; then

where grep will look for the string "McLuhan" in files "Understanding", "Media.kepub.epub" and "$Lib/filesList.log" (and probably also in - which is the input).

fsantini commented 2 years ago

Thanks, well spotted! I made the proposed change, have a look if it helps!

dgsiegel commented 2 years ago

Yeah, that fixes it. Thanks for being this so fast!

One remaining question: Why is filesList.log in $Lib and not in $Logs? Would make sense to move it there and also would get rid of these lines https://github.com/fsantini/KoboCloud/blob/master/src/usr/local/kobocloud/get.sh#L16-L18?

fsantini commented 2 years ago

Also a very good point. I'll look into that, but it should be an easy fix.