diff options
author | Jordan <me@jordan.im> | 2020-04-20 14:48:22 -0700 |
---|---|---|
committer | Jordan <me@jordan.im> | 2020-04-20 14:48:22 -0700 |
commit | c5459f3a5ede5eb4a73c67e791d0771ef78e091b (patch) | |
tree | affe3b267e78908cd8df35606adaaaa191060103 | |
parent | c58cc26bab83c6c6a1192c637edfac6a7ede9276 (diff) | |
download | roka-c5459f3a5ede5eb4a73c67e791d0771ef78e091b.tar.gz roka-c5459f3a5ede5eb4a73c67e791d0771ef78e091b.zip |
fallback sort by filename rather than title tag
-rwxr-xr-x | rebuild.py | 1 | ||||
-rwxr-xr-x | run.py | 2 |
2 files changed, 2 insertions, 1 deletions
@@ -69,6 +69,7 @@ def get_books(root_path): mp3 = dict() mp3['path'] = file_path mp3['duration'] = tag.duration + mp3['filename'] = os.path.split(file_path)[1] # attribute values must be populated and non-space if tag.title and not tag.title.isspace(): @@ -135,7 +135,7 @@ def list_books(): # remove leading zeros from digits (natural sort) conv = lambda s: [int(x) if x.isdigit() else x.lower() for x in re.split('(\d+)', s)] - key = lambda x: conv(books[a]['files'][x]['title']) + key = lambda x: conv(books[a]['files'][x]['filename']) break track_list.append(track) else: |