mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-11-26 15:20:29 +01:00
Added new '--orphaned-*' command line switches.
This commit is contained in:
@@ -51,7 +51,7 @@ bool MainObject::Check(QString *err_msg)
|
||||
//
|
||||
// Recover Audio
|
||||
//
|
||||
if(!db_relink_audio.isEmpty()) {
|
||||
if((db_check_all)&&!db_relink_audio.isEmpty()) {
|
||||
RelinkAudio(db_relink_audio);
|
||||
return true;
|
||||
}
|
||||
@@ -59,63 +59,79 @@ bool MainObject::Check(QString *err_msg)
|
||||
//
|
||||
// Check Table Attributes
|
||||
//
|
||||
printf("Checking DB/table attributes...\n");
|
||||
CheckTableAttributes();
|
||||
printf("done.\n\n");
|
||||
if(db_check_all) {
|
||||
printf("Checking DB/table attributes...\n");
|
||||
CheckTableAttributes();
|
||||
printf("done.\n\n");
|
||||
}
|
||||
|
||||
//
|
||||
// Check for Orphaned Voice Tracks
|
||||
//
|
||||
printf("Checking voice tracks...\n");
|
||||
CheckOrphanedTracks();
|
||||
printf("done.\n\n");
|
||||
if(db_check_all||db_check_orphaned_tracks) {
|
||||
printf("Checking voice tracks...\n");
|
||||
CheckOrphanedTracks();
|
||||
printf("done.\n\n");
|
||||
}
|
||||
|
||||
//
|
||||
// Check for stale reservations
|
||||
//
|
||||
printf("Checking for stale cart reservations...\n");
|
||||
CheckPendingCarts();
|
||||
printf("done.\n\n");
|
||||
if(db_check_all) {
|
||||
printf("Checking for stale cart reservations...\n");
|
||||
CheckPendingCarts();
|
||||
printf("done.\n\n");
|
||||
}
|
||||
|
||||
//
|
||||
// Check for orphaned carts
|
||||
//
|
||||
printf("Checking for orphaned carts...\n");
|
||||
CheckOrphanedCarts();
|
||||
printf("done.\n\n");
|
||||
if(db_check_all||db_check_orphaned_carts) {
|
||||
printf("Checking for orphaned carts...\n");
|
||||
CheckOrphanedCarts();
|
||||
printf("done.\n\n");
|
||||
}
|
||||
|
||||
//
|
||||
// Check for orphaned cuts
|
||||
//
|
||||
printf("Checking for orphaned cuts...\n");
|
||||
CheckOrphanedCuts();
|
||||
printf("done.\n\n");
|
||||
if(db_check_all||db_check_orphaned_cuts) {
|
||||
printf("Checking for orphaned cuts...\n");
|
||||
CheckOrphanedCuts();
|
||||
printf("done.\n\n");
|
||||
}
|
||||
|
||||
//
|
||||
// Check Cart->Cut Counts
|
||||
//
|
||||
printf("Checking cart->cuts counters...\n");
|
||||
CheckCutCounts();
|
||||
printf("done.\n\n");
|
||||
if(db_check_all) {
|
||||
printf("Checking cart->cuts counters...\n");
|
||||
CheckCutCounts();
|
||||
printf("done.\n\n");
|
||||
}
|
||||
|
||||
//
|
||||
// Check Orphaned Audio
|
||||
//
|
||||
printf("Checking for orphaned audio...\n");
|
||||
CheckOrphanedAudio();
|
||||
printf("done.\n\n");
|
||||
if(db_check_all||db_check_orphaned_audio) {
|
||||
printf("Checking for orphaned audio...\n");
|
||||
CheckOrphanedAudio();
|
||||
printf("done.\n\n");
|
||||
}
|
||||
|
||||
//
|
||||
// Validating Audio Lengths
|
||||
//
|
||||
printf("Validating audio lengths (this may take some time)...\n");
|
||||
ValidateAudioLengths();
|
||||
printf("done.\n\n");
|
||||
if(db_check_all) {
|
||||
printf("Validating audio lengths (this may take some time)...\n");
|
||||
ValidateAudioLengths();
|
||||
printf("done.\n\n");
|
||||
}
|
||||
|
||||
//
|
||||
// Rehash
|
||||
//
|
||||
if(!db_rehash.isEmpty()) {
|
||||
if((db_check_all)&&!db_rehash.isEmpty()) {
|
||||
printf("Checking hashes...\n");
|
||||
Rehash(db_rehash);
|
||||
printf("done.\n\n");
|
||||
|
||||
@@ -53,6 +53,12 @@ MainObject::MainObject(QObject *parent)
|
||||
db_relink_audio="";
|
||||
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'
|
||||
//
|
||||
@@ -205,6 +211,26 @@ MainObject::MainObject(QObject *parent)
|
||||
db_rehash=cmd->value(i);
|
||||
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)) {
|
||||
fprintf(stderr,"rddbmgr: unrecognized option \"%s\"\n",
|
||||
|
||||
@@ -132,6 +132,11 @@ class MainObject : public QObject
|
||||
bool db_verbose;
|
||||
bool db_yes;
|
||||
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_dump_cuts_dir;
|
||||
QString db_rehash;
|
||||
|
||||
Reference in New Issue
Block a user