2018-12-20 Fred Gleason <fredg@paravelsystems.com>

* Fixed a bug in the 'pypad_ando.py' script that caused duplicate
	PAD updates to be generated.
This commit is contained in:
Fred Gleason 2018-12-20 14:12:03 -05:00
parent 71102036f2
commit 8d1660d13f
2 changed files with 12 additions and 1 deletions

View File

@ -18253,3 +18253,6 @@
* Removed the 'rlm_liqcomp' RLM.
2018-12-20 Fred Gleason <fredg@paravelsystems.com>
* Fixed a typo in 'pypad_liqcomp.exemplar'.
2018-12-20 Fred Gleason <fredg@paravelsystems.com>
* Fixed a bug in the 'pypad_ando.py' script that caused duplicate
PAD updates to be generated.

View File

@ -25,15 +25,23 @@ import socket
import configparser
import PyPAD
last_updates={}
def eprint(*args,**kwargs):
print(*args,file=sys.stderr,**kwargs)
def ProcessPad(update):
try:
last_updates[update.machine()]
except KeyError:
last_updates[update.machine()]=None
n=1
while(True):
section='System'+str(n)
try:
if update.shouldBeProcessed(section) and update.hasPadType(PyPAD.TYPE_NOW):
if update.shouldBeProcessed(section) and update.hasPadType(PyPAD.TYPE_NOW) and (last_updates[update.machine()] != update.startDateTimeString(PyPAD.TYPE_NOW)):
last_updates[update.machine()]=update.startDateTimeString(PyPAD.TYPE_NOW)
title=update.resolvePadFields(update.config().get(section,'Title'),PyPAD.ESCAPE_NONE)
artist=update.resolvePadFields(update.config().get(section,'Artist'),PyPAD.ESCAPE_NONE)
album=update.resolvePadFields(update.config().get(section,'Album'),PyPAD.ESCAPE_NONE)