Updates for show "repair" processing

InternetArchive/future_upload: Added logging and debugging

InternetArchive/ia_db.sql: Added new tables

InternetArchive/recover_transcripts: New script to run on 'borg' and
    copy missing files from the backup disk to the IA

InternetArchive/repair_assets: More comments, including one about a bug in the design.

InternetArchive/repair_item: Fix relating to octal numbers (if there are
    leading zeroes in a number). '_DEBUG' is now in the function
    library. Added comments to explain obscure stuff.

InternetArchive/snapshot_metadata: New Bash script (to run on my
    desktop) which collects metadata for a show and stores in in the
    '~/HPR/IA/assets' directory. Runs 'view_derivatives' on it to find
    derivative files for deletion.

InternetArchive/tidy_uploaded: Moves files and directories containing
    uploaded files into a holding area for later backup. Added
    debugging, logging and a 'force' mode.

InternetArchive/upload_manager: Manages 'ia.db' (on my workstation).
    Needs many updates which have just started to be added.

InternetArchive/weekly_upload: Old script, now obsolete.
This commit is contained in:
Dave Morriss
2024-08-22 13:13:38 +01:00
parent dc0f29e957
commit 19030fee71
9 changed files with 994 additions and 73 deletions

View File

@@ -3,11 +3,11 @@
* =========
*
* Schema for SQLite database 'ia.db' used to hold IA upload information
* Last updated: 2022-06-16
* Last updated: 2024-07-15
*
*/
/*
/* ----------------------------------------------------------------------------
* Table: episodes
*
* id show number from HPR
@@ -44,7 +44,7 @@ CREATE TABLE episodes (
notes text
);
/*
/* ----------------------------------------------------------------------------
* Table: assets
*
* id primary key
@@ -62,7 +62,7 @@ CREATE TABLE assets (
uploaded integer default 0
);
/*
/* ----------------------------------------------------------------------------
* Index: assets_filename_idx
*
* Attempt to constrain duplicates in the assets table
@@ -70,7 +70,7 @@ CREATE TABLE assets (
*/
CREATE UNIQUE INDEX assets_filename_idx ON assets (episode_id, filename);
/*
/* ----------------------------------------------------------------------------
* Table: dirlist
*
* id primary key
@@ -82,6 +82,66 @@ CREATE TABLE dirlist (
filename text NOT NULL
);
/* ----------------------------------------------------------------------------
* Table: hpr_repairs
*
* episode_id Primary key, foreign key for 'episodes'
* repaired Boolean showing whether the show has been repaired
* repair_date Date of repair
* notes Notes about any anomalies
* asset_count Number of assets (after ignoring transcripts, etc)
*
*/
CREATE TABLE hpr_repairs (
episode_id integer PRIMARY KEY REFERENCES episodes(id),
repaired integer default 0,
repair_date integer default 0,
notes text default null,
asset_count integer default 0
);
/* ----------------------------------------------------------------------------
* Table: ia_repairs
*
* episode_id Primary key, foreign key for 'episodes'
* repaired Boolean showing whether the show has been repaired
* repair_date Date of repair
* notes Notes about any anomalies
*
*/
CREATE TABLE ia_repairs (
episode_id integer PRIMARY KEY REFERENCES episodes(id),
repaired integer default 0,
repair_date integer default 0,
notes text default null
);
/* ----------------------------------------------------------------------------
* Table: show_host_xref
*
* episode_id Foreign key for 'episodes'
* hostid Host number from MySQL database
* hostname Host name from MySQL database
*
*/
CREATE TABLE "show_host_xref" (
"episode_id" integer,
"hostid" integer,
"hostname" text DEFAULT null,
FOREIGN KEY("episode_id") REFERENCES "episodes"("id")
);
/* ----------------------------------------------------------------------------
* Index: show_host_xref_idx
*
* Attempt to constrain duplicates in the show_host_xref table
*
*/
CREATE UNIQUE INDEX "show_host_xref_idx" ON "show_host_xref" (
"episode_id" ASC
);
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* View: episodes_view
*