Skip to content

Commit

Permalink
🎨 Merge books path
Browse files Browse the repository at this point in the history
  • Loading branch information
codycodes committed Sep 12, 2020
1 parent d48ce3b commit 815bc9b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/book.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import sqlite3
import os

BOOKS_PATH = '/Library/Containers/com.apple.iBooksX/Data/Documents/BKLibrary/'
BOOKS_PATH = os.path.expanduser('~'
'/Library/Containers/'
'com.apple.iBooksX/Data/Documents/BKLibrary/')


class Book:
Expand Down Expand Up @@ -35,11 +37,10 @@ def display_count(self):


def get_book_db():
book_dir = os.path.expanduser('~' + BOOKS_PATH)
dbs = []
dbs += [each for each in os.listdir(book_dir)
dbs += [each for each in os.listdir(BOOKS_PATH)
if (each.endswith('.sqlite') and each.startswith('BKLibrary'))]
db_path = book_dir + dbs[0]
db_path = BOOKS_PATH + dbs[0]
return db_path


Expand Down

0 comments on commit 815bc9b

Please sign in to comment.