This is an attempt to fix issues seen when the addon is run manually that result in multiple loops of the updater or issues with library cleaning.
The existing main branch treats manual runs as a special case by tricking the scheduler into running outside the normal scheduled time. This works but leaves some ancillary classes - namely the Monitor operating when really this should only exist when the updater is run as a Service.
In testing it was observed that multiple versions of the Monitor, created through a manual run, created issues with scans being kicked off in a repeated loop. The creation of the Monitor class, which triggers on scan complete actions, is now moved from the Updater class creation to inside of the runProgram method. runProgram should only be called when the service is created at Kodi startup. Manual runs of the scanner now call the evalSchedules function directly.
This is an attempt to fix issues seen when the addon is run manually that result in multiple loops of the updater or issues with library cleaning.
The existing main branch treats manual runs as a special case by tricking the scheduler into running outside the normal scheduled time. This works but leaves some ancillary classes - namely the
Monitor
operating when really this should only exist when the updater is run as a Service.In testing it was observed that multiple versions of the Monitor, created through a manual run, created issues with scans being kicked off in a repeated loop. The creation of the
Monitor
class, which triggers on scan complete actions, is now moved from the Updater class creation to inside of therunProgram
method.runProgram
should only be called when the service is created at Kodi startup. Manual runs of the scanner now call theevalSchedules
function directly.