Created
August 29, 2023 19:35
-
-
Save maforget/744970dbdad47877e731a3d41d4190d7 to your computer and use it in GitHub Desktop.
UserScript SmartList - Returns the books added in the last (x) hours
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from System import DateTime | |
#@Name Books Added the Last (x) Hours | |
#@Hook CreateBookList | |
#@PCount 1 | |
#@Enabled false | |
#@Description Books Added the Last (x) Hours | |
def GetBooksWith (books, a, b): | |
newList = [] | |
for book in books: | |
if (DateTime.Now - book.AddedTime).TotalHours <= int(a): | |
newList.append(book) | |
return newList |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment