-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2021-07-29 Fred Gleason <[email protected]>
* Fixed a bug in rdimport(1) that caused the cart title uniqueness check to be applied to the incorrect string when the '--set-string-title=' switch was used. Signed-off-by: Fred Gleason <[email protected]>
- Loading branch information
1 parent
e15c964
commit 0b401e3
Showing
2 changed files
with
24 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20775,3 +20775,7 @@ | |
2021-07-20 Fred Gleason <[email protected]> | ||
* Fixed a bug in rdlogedit(1) that could cause a segfault when | ||
attempting to play a non-audio event in the 'Voice Tracker' dialog. | ||
2021-07-29 Fred Gleason <[email protected]> | ||
* Fixed a bug in rdimport(1) that caused the cart title | ||
uniqueness check to be applied to the incorrect string when | ||
the '--set-string-title=' switch was used. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// | ||
// A Batch Importer for Rivendell. | ||
// | ||
// (C) Copyright 2002-2020 Fred Gleason <[email protected]> | ||
// (C) Copyright 2002-2021 Fred Gleason <[email protected]> | ||
// | ||
// This program is free software; you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License version 2 as | ||
|
@@ -1076,16 +1076,21 @@ MainObject::Result MainObject::ImportFile(const QString &filename, | |
// | ||
// Ensure that we have a valid title | ||
// | ||
bool cart_exists=false; | ||
if(*cartnum!=0) { | ||
cart_exists=RDCart::exists(*cartnum); | ||
if(import_string_title.isEmpty()) { | ||
bool cart_exists=false; | ||
if(*cartnum!=0) { | ||
cart_exists=RDCart::exists(*cartnum); | ||
} | ||
// | ||
// If the cart already exists and no title was found in metadata, | ||
// then keep the existing title. Otherwise, generate a default title. | ||
// | ||
if((!cart_exists)&&wavedata->metadataFound()&&wavedata->title().isEmpty()) { | ||
wavedata->setTitle(effective_group->generateTitle(filename)); | ||
} | ||
} | ||
// | ||
// If the cart already exists and no title was found in metadata, | ||
// then keep the existing title. Otherwise, generate a default title. | ||
// | ||
if((!cart_exists)&&wavedata->metadataFound()&&wavedata->title().isEmpty()) { | ||
wavedata->setTitle(effective_group->generateTitle(filename)); | ||
else { // Use specified title | ||
wavedata->setTitle(import_string_title); | ||
} | ||
|
||
// | ||
|
@@ -1204,13 +1209,11 @@ MainObject::Result MainObject::ImportFile(const QString &filename, | |
settings->setAutotrimLevel(import_autotrim_level/100); | ||
conv->setDestinationSettings(settings); | ||
conv->setUseMetadata(false); | ||
if(import_string_title.isNull()) { | ||
Log(LOG_INFO,QString(). | ||
sprintf(" Importing file \"%s\" [%s] to cart %06u ... ", | ||
RDGetBasePart(filename).toUtf8().constData(), | ||
wavedata->title().stripWhiteSpace().toUtf8().constData(), | ||
*cartnum)); | ||
} | ||
Log(LOG_INFO,QString(). | ||
sprintf(" Importing file \"%s\" [%s] to cart %06u ... ", | ||
RDGetBasePart(filename).toUtf8().constData(), | ||
wavedata->title().stripWhiteSpace().toUtf8().constData(), | ||
*cartnum)); | ||
switch(conv_err=conv->runImport(rda->user()->name(),rda->user()->password(), | ||
&audio_conv_err)) { | ||
case RDAudioImport::ErrorOk: | ||
|
@@ -1340,9 +1343,6 @@ MainObject::Result MainObject::ImportFile(const QString &filename, | |
if(!import_string_song_id.isNull()) { | ||
cart->setSongId(import_string_song_id); | ||
} | ||
if(!import_string_title.isNull()) { | ||
cart->setTitle(import_string_title); | ||
} | ||
if(!import_set_user_defined.isEmpty()) { | ||
cart->setUserDefined(import_set_user_defined); | ||
} | ||
|