Set self.last_sent_time on first call to flush
This fixes that on first call to batch() 1-size batch is sent
MODIFY
plextraktsync/trakt_api.py
plextraktsync/trakt_api.py
@@ -423,6 +423,9 @@ def flush(self, force=False):
if self.queue_size() == 0:
return
+ if not self.last_sent_time:
+ self.last_sent_time = time()
+
elapsed = time() - self.last_sent_time
if elapsed >= self.batch_delay or force is True:
self.submit()

Set self.last_sent_time on first call to flush

This fixes that on first call to batch() 1-size batch is sent