Instead of downloading a book directly to its folder, the amended script downloads into a temporary file in the tmp folder. If a user hits Ctrl+C or Ctrl+Break, the incomplete book stays in the tmp folder. Otherwise, it will be moved over to the intended folder once the download has completed. The amended script also fixes the EPUB being missed out after Ctrl+C or Ctrl+Break and restarting script. Both code fixes solves #41.
I heavily cleaned up the code to keep it D.R.Y. I also improved on the generation of book name. A book name consists of title + author + edition + isbn. Most books have quite reasonable title lengths, but the length of author names can be very long. A few books breach the filename's 150 characters limit due to that. The new book name generator keeps it to the limit by trying different combinations. For example, if the author names are too lengthy, it will be shorten to only the first author's name, like Dietrich Braun et al..
Instead of downloading a book directly to its folder, the amended script downloads into a temporary file in the
tmp
folder. If a user hits Ctrl+C or Ctrl+Break, the incomplete book stays in thetmp
folder. Otherwise, it will be moved over to the intended folder once the download has completed. The amended script also fixes the EPUB being missed out after Ctrl+C or Ctrl+Break and restarting script. Both code fixes solves #41.I heavily cleaned up the code to keep it D.R.Y. I also improved on the generation of book name. A book name consists of
title
+author
+edition
+isbn
. Most books have quite reasonable title lengths, but the length of author names can be very long. A few books breach the filename's 150 characters limit due to that. The new book name generator keeps it to the limit by trying different combinations. For example, if the author names are too lengthy, it will be shorten to only the first author's name, likeDietrich Braun et al.
.