Merge branch 'deltecent-rddbmgr'

This commit is contained in:
Fred Gleason 2019-06-03 18:25:29 -04:00
commit b06c71541f
5 changed files with 121 additions and 27 deletions

View File

@ -18702,7 +18702,7 @@
2019-05-31 Patrick Linstruth <patrick@deltecent.com> 2019-05-31 Patrick Linstruth <patrick@deltecent.com>
* Fixed bug in rdlogmanager(1) deconflicting rules. * Fixed bug in rdlogmanager(1) deconflicting rules.
2019-05-31 Patrick Linstruth <patrick@deltecent.com> 2019-05-31 Patrick Linstruth <patrick@deltecent.com>
* Added RD_PREFIX to rddbmgr(1) path and process start error * Added RD_PREFIX to rddbmgr(8) path and process start error
message dialog to rddbconfig(1). message dialog to rddbconfig(1).
2019-05-31 Patrick Linstruth <patrick@deltecent.com> 2019-05-31 Patrick Linstruth <patrick@deltecent.com>
* Fixed bug in 'RDWaveFile' class that exhausted file handles. * Fixed bug in 'RDWaveFile' class that exhausted file handles.
@ -18710,3 +18710,6 @@
* Fixed a bug in rdlibrary(1) that made it impossible to configure * Fixed a bug in rdlibrary(1) that made it impossible to configure
more than 100 cuts in a cart using 'By Specified Order' scheduling more than 100 cuts in a cart using 'By Specified Order' scheduling
rules. rules.
2019-06-02 Patrick Linstruth <patrick@deltecent.com>
* Added '--orphaned-audio', '--orphaned-carts', '--orphaned-cuts',
and '--orphaned-tracks' command line switches to rddbmgr(8).

View File

@ -202,6 +202,50 @@
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term>
<option>--orphaned-audio</option>
</term>
<listitem>
<para>
Disable all checks. Add check for orphaned audio files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--orphaned-carts</option>
</term>
<listitem>
<para>
Disable all checks. Add check for orphaned carts.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--orphaned-cuts</option>
</term>
<listitem>
<para>
Disable all checks. Add check for orphaned cuts.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>--orphaned-tracks</option>
</term>
<listitem>
<para>
Disable all checks. Add check for orphaned voice tracks.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<option>--rehash=</option><replaceable>target</replaceable> <option>--rehash=</option><replaceable>target</replaceable>

View File

@ -51,7 +51,7 @@ bool MainObject::Check(QString *err_msg)
// //
// Recover Audio // Recover Audio
// //
if(!db_relink_audio.isEmpty()) { if((db_check_all)&&!db_relink_audio.isEmpty()) {
RelinkAudio(db_relink_audio); RelinkAudio(db_relink_audio);
return true; return true;
} }
@ -59,63 +59,79 @@ bool MainObject::Check(QString *err_msg)
// //
// Check Table Attributes // Check Table Attributes
// //
printf("Checking DB/table attributes...\n"); if(db_check_all) {
CheckTableAttributes(); printf("Checking DB/table attributes...\n");
printf("done.\n\n"); CheckTableAttributes();
printf("done.\n\n");
}
// //
// Check for Orphaned Voice Tracks // Check for Orphaned Voice Tracks
// //
printf("Checking voice tracks...\n"); if(db_check_all||db_check_orphaned_tracks) {
CheckOrphanedTracks(); printf("Checking voice tracks...\n");
printf("done.\n\n"); CheckOrphanedTracks();
printf("done.\n\n");
}
// //
// Check for stale reservations // Check for stale reservations
// //
printf("Checking for stale cart reservations...\n"); if(db_check_all) {
CheckPendingCarts(); printf("Checking for stale cart reservations...\n");
printf("done.\n\n"); CheckPendingCarts();
printf("done.\n\n");
}
// //
// Check for orphaned carts // Check for orphaned carts
// //
printf("Checking for orphaned carts...\n"); if(db_check_all||db_check_orphaned_carts) {
CheckOrphanedCarts(); printf("Checking for orphaned carts...\n");
printf("done.\n\n"); CheckOrphanedCarts();
printf("done.\n\n");
}
// //
// Check for orphaned cuts // Check for orphaned cuts
// //
printf("Checking for orphaned cuts...\n"); if(db_check_all||db_check_orphaned_cuts) {
CheckOrphanedCuts(); printf("Checking for orphaned cuts...\n");
printf("done.\n\n"); CheckOrphanedCuts();
printf("done.\n\n");
}
// //
// Check Cart->Cut Counts // Check Cart->Cut Counts
// //
printf("Checking cart->cuts counters...\n"); if(db_check_all) {
CheckCutCounts(); printf("Checking cart->cuts counters...\n");
printf("done.\n\n"); CheckCutCounts();
printf("done.\n\n");
}
// //
// Check Orphaned Audio // Check Orphaned Audio
// //
printf("Checking for orphaned audio...\n"); if(db_check_all||db_check_orphaned_audio) {
CheckOrphanedAudio(); printf("Checking for orphaned audio...\n");
printf("done.\n\n"); CheckOrphanedAudio();
printf("done.\n\n");
}
// //
// Validating Audio Lengths // Validating Audio Lengths
// //
printf("Validating audio lengths (this may take some time)...\n"); if(db_check_all) {
ValidateAudioLengths(); printf("Validating audio lengths (this may take some time)...\n");
printf("done.\n\n"); ValidateAudioLengths();
printf("done.\n\n");
}
// //
// Rehash // Rehash
// //
if(!db_rehash.isEmpty()) { if((db_check_all)&&!db_rehash.isEmpty()) {
printf("Checking hashes...\n"); printf("Checking hashes...\n");
Rehash(db_rehash); Rehash(db_rehash);
printf("done.\n\n"); printf("done.\n\n");

View File

@ -53,6 +53,12 @@ MainObject::MainObject(QObject *parent)
db_relink_audio=""; db_relink_audio="";
db_relink_audio_move=false; db_relink_audio_move=false;
db_check_all=true;
db_check_orphaned_audio=false;
db_check_orphaned_carts=false;
db_check_orphaned_cuts=false;
db_check_orphaned_tracks=false;
// //
// Check that we're 'root' // Check that we're 'root'
// //
@ -205,6 +211,26 @@ MainObject::MainObject(QObject *parent)
db_rehash=cmd->value(i); db_rehash=cmd->value(i);
cmd->setProcessed(i,true); cmd->setProcessed(i,true);
} }
if(cmd->key(i)=="--orphaned-audio") {
db_check_all=false;
db_check_orphaned_audio=true;
cmd->setProcessed(i,true);
}
if(cmd->key(i)=="--orphaned-carts") {
db_check_all=false;
db_check_orphaned_carts=true;
cmd->setProcessed(i,true);
}
if(cmd->key(i)=="--orphaned-cuts") {
db_check_all=false;
db_check_orphaned_cuts=true;
cmd->setProcessed(i,true);
}
if(cmd->key(i)=="--orphaned-tracks") {
db_check_all=false;
db_check_orphaned_tracks=true;
cmd->setProcessed(i,true);
}
if(!cmd->processed(i)) { if(!cmd->processed(i)) {
fprintf(stderr,"rddbmgr: unrecognized option \"%s\"\n", fprintf(stderr,"rddbmgr: unrecognized option \"%s\"\n",

View File

@ -132,6 +132,11 @@ class MainObject : public QObject
bool db_verbose; bool db_verbose;
bool db_yes; bool db_yes;
bool db_no; bool db_no;
bool db_check_all;
bool db_check_orphaned_audio;
bool db_check_orphaned_tracks;
bool db_check_orphaned_carts;
bool db_check_orphaned_cuts;
QString db_orphan_group_name; QString db_orphan_group_name;
QString db_dump_cuts_dir; QString db_dump_cuts_dir;
QString db_rehash; QString db_rehash;