2025-07-01 Fred Gleason <fredg@paravelsystems.com>

* Added a 'bool incl_str_fields' parameter to the
	'RDCut::setMetadata()' and 'RDCut::getMetadata()' methods.
	* Fixed a bug in rdcatchd(8) that caused embedded source start and
	end datetime metadata to fail to be applied in download events when
	the 'Update Library Metadata' attribute was not selected.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason 2025-07-01 11:10:37 -04:00
parent 81bb5e42cc
commit 2d3f70950a
10 changed files with 36 additions and 15 deletions

View File

@ -24995,3 +24995,9 @@
Guide.
2025-06-23 Fred Gleason <fredg@paravelsystems.com>
* Incremented the pacakge version to 4.3.0int9.
2025-07-01 Fred Gleason <fredg@paravelsystems.com>
* Added a 'bool incl_str_fields' parameter to the
'RDCut::setMetadata()' and 'RDCut::getMetadata()' methods.
* Fixed a bug in rdcatchd(8) that caused embedded source start and
end datetime metadata to fail to be applied in download events when
the 'Update Library Metadata' attribute was not selected.

View File

@ -747,6 +747,17 @@
For public web pages and anonymous FTP servers, these fields can be
left blank.
</para>
<para>
If the <computeroutput>Update Library Metadata</computeroutput>
checkbox is ticked, then the string metadata fields of the destination
cart (Title, Artist, etc) will be updated to the values of the
downloaded audio file.
</para>
<note>
A file's intrinsic metadata --e.g. segue markers,
start/end date/times, etc-- will <emphasis>always</emphasis> be
applied.
</note>
<para>
Automated uploads are configured by means of the Edit Upload dialog
(see <xref endterm="para.rdcatch.the_edit_upload_dialog" endlink="metaobject.rdcatch.edit_upload_dialog"/>), which can be accessed either by clicking the

View File

@ -396,7 +396,7 @@ void MainObject::ProcessXmlFile(const QString &xml,const QString &wavname,
q=new RDSqlQuery(sql);
if(q->first()) {
cut=new RDCut(q->value(0).toString());
cut->setMetadata(&data);
cut->setMetadata(&data,true);
delete cut;
}
delete q;

View File

@ -1014,7 +1014,7 @@ bool RDCut::copyTo(RDStation *station,RDUser *user,
}
void RDCut::getMetadata(RDWaveData *data) const
void RDCut::getMetadata(RDWaveData *data,bool incl_str_fields) const
{
QString sql;
RDSqlQuery *q;
@ -1047,8 +1047,10 @@ void RDCut::getMetadata(RDWaveData *data) const
if(q->first()) {
data->setCutName(q->value(0).toString());
data->setCutNumber(RDCut::cutNumber(q->value(0).toString()));
data->setDescription(q->value(1).toString());
data->setOutCue(q->value(2).toString());
if(incl_str_fields) {
data->setDescription(q->value(1).toString());
data->setOutCue(q->value(2).toString());
}
data->setIsrc(q->value(3).toString());
data->setIsci(q->value(4).toString());
data->setOriginationDate(q->value(5).toDate());
@ -1077,7 +1079,7 @@ void RDCut::getMetadata(RDWaveData *data) const
}
void RDCut::setMetadata(RDWaveData *data) const
void RDCut::setMetadata(RDWaveData *data,bool incl_str_fields) const
{
QString sql="update `CUTS` set ";
if(!data->description().isEmpty()) {

View File

@ -134,8 +134,8 @@ class RDCut
void logPlayout() const;
bool copyTo(RDStation *station,RDUser *user,const QString &cutname,
RDConfig *config) const;
void getMetadata(RDWaveData *data) const;
void setMetadata(RDWaveData *data) const;
void getMetadata(RDWaveData *data,bool incl_str_fields) const;
void setMetadata(RDWaveData *data,bool incl_str_fields) const;
bool checkInRecording(const QString &station_name,const QString &user_name,
QString src_hostname,RDSettings *settings,
unsigned msecs) const;

View File

@ -392,7 +392,7 @@ bool MainObject::Export(CatchEvent *evt,QString *err_msg)
if(evt->enableMetadata()) {
wavedata=new RDWaveData();
cart->getMetadata(wavedata);
cut->getMetadata(wavedata);
cut->getMetadata(wavedata,true);
conv->setDestinationWaveData(wavedata);
}
switch((conv_err=conv->convert())) {
@ -481,9 +481,11 @@ bool MainObject::Import(CatchEvent *evt,QString *err_msg)
ret=false;
break;
}
if((conv->sourceWaveData()!=NULL)&&(evt->enableMetadata())) {
cart->setMetadata(conv->sourceWaveData());
cut->setMetadata(conv->sourceWaveData());
if(conv->sourceWaveData()!=NULL) {
cut->setMetadata(conv->sourceWaveData(),evt->enableMetadata());
if(evt->enableMetadata()) {
cart->setMetadata(conv->sourceWaveData());
}
}
rda->syslog(LOG_INFO,"completed import of %s to cut %s, id=%d",
(const char *)evt->tempName().toUtf8(),

View File

@ -1454,7 +1454,7 @@ MainObject::Result MainObject::ImportFile(const QString &filename,
if(cart_created) {
cart->setMetadata(wavedata);
}
cut->setMetadata(wavedata);
cut->setMetadata(wavedata,true);
cut->autoSegue(import_segue_level,import_segue_length,rda->station(),
rda->user(),rda->config());
if(cut->description().isEmpty()) { // Final backstop, so we don't end up

View File

@ -125,7 +125,7 @@ void Xport::Export()
RDCart *cart=new RDCart(cartnum);
RDCut *cut=new RDCut(cartnum,cutnum);
cart->getMetadata(wavedata);
cut->getMetadata(wavedata);
cut->getMetadata(wavedata,true);
if(cart->enforceLength()) {
speed_ratio=(float)cut->length()/(float)cart->forcedLength();
}

View File

@ -229,8 +229,8 @@ void Xport::Import()
remote_host,settings,msecs);
if(use_metadata>0) {
cart->setMetadata(conv->sourceWaveData());
cut->setMetadata(conv->sourceWaveData());
}
cut->setMetadata(conv->sourceWaveData(),use_metadata);
if(autotrim_level!=0) {
cut->autoTrim(RDCut::AudioBoth,100*autotrim_level);
}

View File

@ -238,7 +238,7 @@ void MainObject::GetAudio()
wavedata=new RDWaveData();
if(wavedata!=NULL) {
cart->getMetadata(wavedata);
cut->getMetadata(wavedata);
cut->getMetadata(wavedata,true);
if(cart->enforceLength()) {
speed_ratio=(float)cut->length()/(float)cart->forcedLength();
}