Skip to content

Commit

Permalink
add datetime imports
Browse files Browse the repository at this point in the history
  • Loading branch information
rmrector committed May 9, 2023
1 parent 2f81faf commit de7b2c2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/lib/playrandom.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import xbmcgui
from datetime import timedelta

from . import quickjson
from .pykodi import get_main_addon, localize as L
from .pykodi import datetime_now, get_main_addon, localize as L
from .player import get_player
from .generators import get_generator

Expand Down Expand Up @@ -54,7 +55,7 @@ def _build_watched_before_filter(content):

# jsonrpc stopped playing nicely when combining 'notinthelast' with the other operators in our filter, so falling back to 'lessthan'
#lastwatched_filter = {'field': 'lastplayed', 'operator': 'notinthelast', 'value': months*30}
watchbeforedate = (datetime.now() - timedelta(days=months*30)).isoformat(' ')
watchbeforedate = (datetime_now() - timedelta(days=months*30)).isoformat(' ')
lastwatched_filter = {'field': 'lastplayed', 'operator': 'lessthan', 'value': watchbeforedate}
return lastwatched_filter

Expand Down

0 comments on commit de7b2c2

Please sign in to comment.