mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
News download scheduler: Don't tru to download news when no active internet connection is present (linux/windows only)
This commit is contained in:
parent
136d1e4a19
commit
3f2e08ba67
@ -18,6 +18,7 @@ from calibre.gui2 import config as gconf, error_dialog
|
|||||||
from calibre.web.feeds.recipes.model import RecipeModel
|
from calibre.web.feeds.recipes.model import RecipeModel
|
||||||
from calibre.ptempfile import PersistentTemporaryFile
|
from calibre.ptempfile import PersistentTemporaryFile
|
||||||
from calibre.utils.date import utcnow
|
from calibre.utils.date import utcnow
|
||||||
|
from calibre.utils.network import internet_connected
|
||||||
|
|
||||||
class SchedulerDialog(QDialog, Ui_Dialog):
|
class SchedulerDialog(QDialog, Ui_Dialog):
|
||||||
|
|
||||||
@ -304,6 +305,8 @@ class Scheduler(QObject):
|
|||||||
self.download(urn)
|
self.download(urn)
|
||||||
|
|
||||||
def download(self, urn):
|
def download(self, urn):
|
||||||
|
if not internet_connected():
|
||||||
|
return
|
||||||
self.lock.lock()
|
self.lock.lock()
|
||||||
doit = urn not in self.download_queue
|
doit = urn not in self.download_queue
|
||||||
self.lock.unlock()
|
self.lock.unlock()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user