[rhythmbox: 3/5] listenbrainz: less frequent checks for queue submission, but increase number of items submitted per




commit 0d65b90fd1fb02123d0c33c3c5e0d984880bf34b
Author: Philipp Wolfer <ph wolfer gmail com>
Date:   Sun Sep 4 10:52:51 2022 +0200

    listenbrainz: less frequent checks for queue submission, but increase number of items submitted per call

 plugins/listenbrainz/queue.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/plugins/listenbrainz/queue.py b/plugins/listenbrainz/queue.py
index 4a5020960..a01b9b9a0 100644
--- a/plugins/listenbrainz/queue.py
+++ b/plugins/listenbrainz/queue.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2018-2019 Philipp Wolfer <ph wolfer gmail com>
+# Copyright (c) 2018-2019, 2022 Philipp Wolfer <ph wolfer gmail com>
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
@@ -25,7 +25,8 @@ import os
 from gi.repository import GLib
 from client import Track
 
-MAX_TRACKS_PER_IMPORT = 10
+MAX_TRACKS_PER_IMPORT = 100
+SUBMISSION_INTERVAL_SECONDS = 120
 
 logger = logging.getLogger("listenbrainz")
 
@@ -37,7 +38,8 @@ class ListenBrainzQueue:
         self.__queue = []
 
     def activate(self):
-        self.__timeout_id = GLib.timeout_add_seconds(30, self.submit_batch)
+        self.__timeout_id = GLib.timeout_add_seconds(
+            SUBMISSION_INTERVAL_SECONDS, self.submit_batch)
 
     def deactivate(self):
         GLib.source_remove(self.__timeout_id)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]