mdr2.abacus.import

Functionality for the initial import of the production data from ABACUS to Madras2.

This is meant to be used only once when importing the productions from ABACUS. Use from within a repl.

abacus-csv

all-commercial-productions

all-files-by-id

all-productions

append-to-file

(append-to-file filename s)

archived?

(archived? production)

cleanup-commercial-production

(cleanup-commercial-production m)

copy-obi-project!

(copy-obi-project! production)

copy-sigtuna-project!

(copy-sigtuna-project! production)

create-archived-productions!

(create-archived-productions! productions)

Create all productions with state “archived”

create-obi-config-file!

(create-obi-config-file! production)

create-ready-productions!

(create-ready-productions! productions)

Create all productions with state “ready”

create-recording-productions-with-obi!

(create-recording-productions-with-obi! productions)

Create all productions with state “recording” that contain an obi project. Add to the db and create the directories. Copy the obi project to the new place. Place an obi config file inside the obi project

create-recording-productions-with-struct!

(create-recording-productions-with-struct! productions)

Create all productions with state “recording” that do not contain any wav but a struct file. Add to the db, create the directories and create the config file. Finally merge the the “struct.html” with the dtbook file.

create-recording-productions-without-obi!

(create-recording-productions-without-obi! productions)

Create all productions with state “recording” with wav files that do not contain an obi project. Add to the db and create the directories

extract-id

(extract-id regexp s)

extract-id-from-db

extract-id-from-file

file-dump

files-by-id

(files-by-id f)

fix-date

(fix-date s)

fix-production

(fix-production {:keys [id periodical_number], :as production})

Fix a production, i.e. fix some of the fields as they are coming from ABACUS the values as they are expected by Madras2

format-merge

(format-merge production)

format-obi-move

(format-obi-move production)

format-recode-xml

(format-recode-xml production)

format-sigtuna-move

(format-sigtuna-move production)

get-all-files

(get-all-files {id :id})

Get all files for a production

library-signature?

(library-signature? id)

merge-struct-file!

(merge-struct-file! production)

move-script

ncc-file?

(ncc-file? f)

normalize-commercial-production

(normalize-commercial-production m)

obi-project-path

(obi-project-path production)

obi-project?

(obi-project? f)

old-production-root

parse-int

(parse-int s)

print-stats

(print-stats)

Print a summary of all the productions that are about to be migrated

production-id-to-library-signature-map

production-id?

(production-id? id)

productions

(productions f)

Given a file or a filename f return a lazy seq of productions

ready?

(ready? production)

recording-no-wav-with-struct?

(recording-no-wav-with-struct? production)

recording-no-wav?

(recording-no-wav? production)

recording-with-obi?

(recording-with-obi? production)

recording-with-wav-no-obi?

(recording-with-wav-no-obi? production)

recording-with-wav?

(recording-with-wav? production)

recording?

(recording? production)

smil-file?

(smil-file? f)

struct-file?

(struct-file? f)

to-millis

(to-millis s)

Convert a string s of the form “31:28:47” to milliseconds

wav-file?

(wav-file? f)