Cancel processing exports on startup

This commit is contained in:
JonnyWong16 2020-08-04 09:31:41 -07:00
parent 42856e5ac8
commit 61c692ad4e
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
2 changed files with 10 additions and 2 deletions

View file

@ -45,7 +45,7 @@ if PYTHON2:
import common
import database
import datafactory
import helpers
import exporter
import libraries
import logger
import mobile_app
@ -65,7 +65,7 @@ else:
from plexpy import common
from plexpy import database
from plexpy import datafactory
from plexpy import helpers
from plexpy import exporter
from plexpy import libraries
from plexpy import logger
from plexpy import mobile_app
@ -535,6 +535,9 @@ def start():
notification_handler.start_threads(num_threads=CONFIG.NOTIFICATION_THREADS)
notifiers.check_browser_enabled()
# Cancel processing exports
exporter.cancel_exports()
if CONFIG.FIRST_RUN_COMPLETE:
activity_pinger.connect_server(log=True, startup=True)

View file

@ -1068,6 +1068,11 @@ def delete_all_exports():
return True
def cancel_exports():
db = database.MonitorDatabase()
db.action('UPDATE exports SET complete = -1 WHERE complete = 0')
def get_export_datatable(section_id=None, rating_key=None, kwargs=None):
default_return = {'recordsFiltered': 0,
'recordsTotal': 0,