Skip to content

Instantly share code, notes, and snippets.

@master-of-zen
Last active October 6, 2019 16:28
Show Gist options
  • Save master-of-zen/bb416e927575e3545d0823e0b1dc1665 to your computer and use it in GitHub Desktop.
Save master-of-zen/bb416e927575e3545d0823e0b1dc1665 to your computer and use it in GitHub Desktop.
Book Sort for BookDonkeyBot
def sort_books(all_books, booktup) -> list:
# Remove books that not match language or extension
valid_books = all_books
if booktup.lang:
for book in list(all_books):
if book[2].lower() != booktup.lang.lower():
valid_books.remove(book)
if booktup.ext:
for book in list(all_books):
if book[4].lower() != booktup.ext.lower():
valid_books.remove(book)
return valid_books
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment