aboutsummaryrefslogtreecommitdiff
path: root/lib/books.py
diff options
context:
space:
mode:
authorDylan Garrett <dylan.garrett@gmail.com>2021-06-06 15:51:04 -0700
committerDylan Garrett <dylan.garrett@gmail.com>2021-06-06 15:51:04 -0700
commitf27620092d16676b77e92ae409c15e71d246f025 (patch)
tree75c53fc1a75d138bbf18055146c7b0df4444b6d4 /lib/books.py
parentb8838edda4e9c9a9fd68ab61ecef868218b44f36 (diff)
downloadroka-f27620092d16676b77e92ae409c15e71d246f025.tar.gz
roka-f27620092d16676b77e92ae409c15e71d246f025.zip
Allow setting scan dir from terminal
Diffstat (limited to 'lib/books.py')
-rw-r--r--lib/books.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/books.py b/lib/books.py
index 1c4b4a5..84754f6 100644
--- a/lib/books.py
+++ b/lib/books.py
@@ -86,7 +86,7 @@ class Books:
now = datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%S")
print('%s %s' % (now, msg))
- def scan_books(self):
+ def scan_books(self, audiobook_path=None):
'''
Discover audiobooks under :root_path: and populate books object
@@ -94,7 +94,7 @@ class Books:
(existing content is not re-hashed)
'''
ex = self._get_path_hash_dict()
- dirs = self._get_dirs(APP.config['ROOT_PATH'])
+ dirs = self._get_dirs(audiobook_path or APP.config['ROOT_PATH'])
books = dict()
for path in dirs:
@@ -145,7 +145,7 @@ class Books:
# previous conditions met, we've found at least one track
is_book = True
- self._log(f)
+ self._log(os.path.join(path, f))
# hash track (used as a key) and update folder hash
file_hash = hashlib.md5()