diff --git a/ChangeLog b/ChangeLog index ca339e1a..7316bcbc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19074,3 +19074,15 @@ * Remove deleted scheduler codes from rdlogmanager(1) events. * Changed empty scheduler code selection from "" to "[none]" in rdlogmanager(1) event editor. +2019-09-02 Fred Gleason + * Removed text labels from the transport button in the cue + editor in rdairplay(1). +2019-09-02 Fred Gleason + * Fixed a bug in the 'pypad' module that caused the DB connection + to be opened in 'latin1' mode. +2019-09-02 Fred Gleason + * Modified the 'pypad' module so as not to throw a + 'UnicodeDecodeError' exception when processing a PAD update + containing an invalid UTF-8 character. +2019-09-02 Patrick Linstruth + * Refactored 'pypad_tunein.py' ProcessPad while loop. diff --git a/apis/pypad/api/pypad.py b/apis/pypad/api/pypad.py index b1684423..b6a5bdd7 100644 --- a/apis/pypad/api/pypad.py +++ b/apis/pypad/api/pypad.py @@ -797,7 +797,9 @@ class Receiver(object): def __openDb(self): creds=self.__getDbCredentials() - return MySQLdb.connect(creds[2],creds[0],creds[1],creds[3]) + return MySQLdb.connect(user=creds[0],password=creds[1], + host=creds[2],database=creds[3], + charset='utf8mb4') def setPadCallback(self,callback): """ @@ -906,8 +908,9 @@ class Receiver(object): c=sock.recv(1) line+=c if c[0]==10: - msg+=line.decode('utf-8') - if line.decode('utf-8')=="\r\n": + linebytes=line.decode('utf-8','replace') + msg+=linebytes + if linebytes=='\r\n': self.__pypad_Process(Update(json.loads(msg),self.__config_parser,rd_config)) msg="" line=bytes() diff --git a/apis/pypad/scripts/pypad_tunein.py b/apis/pypad/scripts/pypad_tunein.py index fec55a4c..2c58069a 100755 --- a/apis/pypad/scripts/pypad_tunein.py +++ b/apis/pypad/scripts/pypad_tunein.py @@ -31,31 +31,38 @@ import configparser def ProcessPad(update): if update.hasPadType(pypad.TYPE_NOW): - section='Station'+str(n) - n=1 - while(update.config().has_section(section)): - values={} - values['id']=update.config().get(section,'StationID') - values['partnerId']=update.config().get(section,'PartnerID') - values['partnerKey']=update.config().get(section,'PartnerKey') - values['title']=update.resolvePadFields(update.config().get(section,'TitleString'),pypad.ESCAPE_NONE) - values['artist']=update.resolvePadFields(update.config().get(section,'ArtistString'),pypad.ESCAPE_NONE) - values['album']=update.resolvePadFields(update.config().get(section,'AlbumString'),pypad.ESCAPE_NONE) - update.syslog(syslog.LOG_INFO,'Updating TuneIn: artist='+values['artist']+' title='+values['title']+' album='+values['album']) - try: - response=requests.get('http://air.radiotime.com/Playing.ashx',params=values) - response.raise_for_status() - except requests.exceptions.RequestException as e: - update.syslog(syslog.LOG_WARNING,str(e)) - else: - xml=ET.fromstring(response.text) - status=xml.find('./head/status') - if(status.text!='200'): - update.syslog(syslog.LOG_WARNING,'Update Failed: '+xml.find('./head/fault').text) - n=n+1 - section='Station'+str(n) - if(n==1): - update.syslog(syslog.LOG_WARNING,'No station config found') + n=1 + while(True): + section='Station'+str(n) + try: + values={} + values['id']=update.config().get(section,'StationID') + values['partnerId']=update.config().get(section,'PartnerID') + values['partnerKey']=update.config().get(section,'PartnerKey') + values['title']=update.resolvePadFields(update.config().get(section,'TitleString'),pypad.ESCAPE_NONE) + values['artist']=update.resolvePadFields(update.config().get(section,'ArtistString'),pypad.ESCAPE_NONE) + values['album']=update.resolvePadFields(update.config().get(section,'AlbumString'),pypad.ESCAPE_NONE) + except configparser.NoSectionError: + if(n==1): + update.syslog(syslog.LOG_WARNING,'No station config found') + return + + # + # Now, send the update + # + if update.shouldBeProcessed(section): + update.syslog(syslog.LOG_INFO,'Updating TuneIn: artist='+values['artist']+' title='+values['title']+' album='+values['album']) + try: + response=requests.get('http://air.radiotime.com/Playing.ashx',params=values) + response.raise_for_status() + except requests.exceptions.RequestException as e: + update.syslog(syslog.LOG_WARNING,str(e)) + else: + xml=ET.fromstring(response.text) + status=xml.find('./head/status') + if(status.text!='200'): + update.syslog(syslog.LOG_WARNING,'Update Failed: '+xml.find('./head/fault').text) + n=n+1 # # Program Name diff --git a/lib/librd_cs.ts b/lib/librd_cs.ts index 5e3a5c13..cd4ce2a7 100644 --- a/lib/librd_cs.ts +++ b/lib/librd_cs.ts @@ -1239,18 +1239,6 @@ ze &souboru RDCueEdit - - &Audition - - - - &Pause - - - - &Stop - - Start diff --git a/lib/librd_de.ts b/lib/librd_de.ts index 16b5bd26..661161f1 100644 --- a/lib/librd_de.ts +++ b/lib/librd_de.ts @@ -1230,18 +1230,6 @@ senden RDCueEdit - - &Audition - - - - &Pause - - - - &Stop - - Start diff --git a/lib/librd_es.ts b/lib/librd_es.ts index cd065c63..0b1b7f7f 100644 --- a/lib/librd_es.ts +++ b/lib/librd_es.ts @@ -1230,18 +1230,6 @@ Color RDCueEdit - - &Audition - - - - &Pause - - - - &Stop - - Start diff --git a/lib/librd_fr.ts b/lib/librd_fr.ts index 3db0a25a..3460176b 100644 --- a/lib/librd_fr.ts +++ b/lib/librd_fr.ts @@ -1116,17 +1116,13 @@ La Couleur RDCueEdit - - &Audition - - &Pause - &Pause + &Pause &Stop - &Stop + &Stop Start diff --git a/lib/librd_nb.ts b/lib/librd_nb.ts index 79858fc7..a3c5b201 100644 --- a/lib/librd_nb.ts +++ b/lib/librd_nb.ts @@ -1229,18 +1229,6 @@ farge RDCueEdit - - &Audition - - - - &Pause - - - - &Stop - - Start diff --git a/lib/librd_nn.ts b/lib/librd_nn.ts index 79858fc7..a3c5b201 100644 --- a/lib/librd_nn.ts +++ b/lib/librd_nn.ts @@ -1229,18 +1229,6 @@ farge RDCueEdit - - &Audition - - - - &Pause - - - - &Stop - - Start diff --git a/lib/librd_pt_BR.ts b/lib/librd_pt_BR.ts index ebd44143..2ab041c8 100644 --- a/lib/librd_pt_BR.ts +++ b/lib/librd_pt_BR.ts @@ -1230,18 +1230,6 @@ Cor RDCueEdit - - &Audition - - - - &Pause - - - - &Stop - - Start diff --git a/lib/rdcueedit.cpp b/lib/rdcueedit.cpp index 65cb77f8..a1850f8d 100644 --- a/lib/rdcueedit.cpp +++ b/lib/rdcueedit.cpp @@ -118,7 +118,7 @@ RDCueEdit::RDCueEdit(RDCae *cae,int card,int port,QWidget *parent) edit_audition_button-> setPalette(QPalette(backgroundColor(),QColor(Qt::gray))); edit_audition_button->setFont(button_font); - edit_audition_button->setText(tr("&Audition")); + // edit_audition_button->setText(tr("&Audition")); connect(edit_audition_button,SIGNAL(clicked()), this,SLOT(auditionButtonData())); @@ -130,7 +130,7 @@ RDCueEdit::RDCueEdit(RDCae *cae,int card,int port,QWidget *parent) edit_pause_button-> setPalette(QPalette(backgroundColor(),QColor(Qt::gray))); edit_pause_button->setFont(button_font); - edit_pause_button->setText(tr("&Pause")); + // edit_pause_button->setText(tr("&Pause")); connect(edit_pause_button,SIGNAL(clicked()),this,SLOT(pauseButtonData())); // @@ -142,7 +142,7 @@ RDCueEdit::RDCueEdit(RDCae *cae,int card,int port,QWidget *parent) edit_stop_button-> setPalette(QPalette(backgroundColor(),QColor(Qt::gray))); edit_stop_button->setFont(button_font); - edit_stop_button->setText(tr("&Stop")); + // edit_stop_button->setText(tr("&Stop")); connect(edit_stop_button,SIGNAL(clicked()),this,SLOT(stopButtonData())); //