Skip to content

Commit bd02cd9

Browse files
author
Ivy Bowman
committed
Update version number and hopefully fix issue
1 parent 8940a8f commit bd02cd9

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

autobooks/AutoBooks.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def cleanup(m4bs, odms, odmfolder):
152152
# Function for login
153153
def web_login(driver, name, cardno, pin, select):
154154
global error_count
155-
web_logger.info("web_login: Logging into %s", name)
155+
web_logger.info("web_login: Logging into library: %s", name)
156156
# Attempt selecting library from dropdown
157157
if select != "false":
158158
select_box = driver.find_element(By.XPATH, '//input[@id="signin-options"]')
@@ -178,11 +178,11 @@ def web_dl(driver, df, name):
178178
#Gather all book title elements and check if any found
179179
books = driver.find_elements(By.XPATH, '//a[@tabindex="0"][@role="link"]')
180180
if len(books) == 0:
181-
web_logger.warning("Can't find books skipped library %s", name)
181+
web_logger.warning("Can't find books skipped library: %s", name)
182182
error_count += 1
183183
return ()
184184
else:
185-
web_logger.info("web_dl: Begin DL from %s", name)
185+
web_logger.info("web_dl: Begin DL from library: %s ", name)
186186
bookcount = 0
187187
for i in books:
188188
#Fetch info about the book
@@ -196,14 +196,13 @@ def web_dl(driver, df, name):
196196
if str(book_id) in df['book_id'].to_string():
197197
web_logger.info('web_dl: Skipped %s found in known books', book_title)
198198
else:
199-
200199
# Download book
201200
driver.get(book_dl_url)
202201
web_logger.info("web_dl: Downloaded book: %s", book_title)
203202
book_odm = max(glob.glob("*.odm"), key=os.path.getmtime)
203+
bookcount += 1
204204

205205
#Add book data to vars
206-
bookcount += 1
207206
library_list.append(name)
208207
book_id_list.append(book_id)
209208
book_title_list.append(book_title)
@@ -279,10 +278,12 @@ def web_run():
279278
driver = webdriver.Chrome(options=options)
280279

281280
# Attempt to read known files csv for checking books
282-
try:
281+
if os.path.exists(csv_path):
283282
df = pd.read_csv(csv_path, sep=",")
284-
except FileNotFoundError:
285-
df = False
283+
else:
284+
df = pd.DataFrame({
285+
'book_id': book_id_list,
286+
})
286287
os.chdir(os.path.join(scriptdir,"web_downloads"))
287288
# For every library, open site, attempt sign in, and attempt download.
288289
for i in range(0, len(parser.sections())):
@@ -305,7 +306,7 @@ def web_run():
305306
'book_id': book_id_list,
306307
'book_title': book_title_list,
307308
'book_odm': book_odm_list
308-
})
309+
})
309310
if os.path.exists(csv_path):
310311
df_out.to_csv(csv_path, mode='a', index=False, header=False)
311312
else:

setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Note: AutoBooks Web is not compatible with WSL, and requires X11 forwarding to r
4545
To install from the latest source run the following command.
4646
`pip3 install git+https://git@github.com/ivybowman/autobooks.git --upgrade --force-reinstall`
4747
To install from a specific version run the following command.
48-
`pip3 install git+https://git@github.com/ivybowman/autobooks.git@v0.2.0-alpha --upgrade`
48+
`pip3 install git+https://git@github.com/ivybowman/autobooks.git@v0.2.1-alpha --upgrade`
4949
To uninstall AutoBooks run the following command.
5050
`pip3 uninstall autobooks`
5151

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from setuptools import setup
22

3-
VERSION = '0.2.0'
3+
VERSION = '0.2.1'
44
DESCRIPTION = 'Python tool to automate processing a batch of OverDrive audiobooks.'
55
LONG_DESCRIPTION = 'Python tool to automate processing a batch of OverDrive audiobooks.'
66

0 commit comments

Comments
 (0)