#!/bin/sh -eu

datadir="$RUN_DIR"/data/imdb

[ -z "${DEBUG:-}" ] || set -x

# See
# - https://www.imdb.com/interfaces/
# - https://datasets.imdbws.com/

wget -N \
    --no-directories \
    --directory-prefix "$datadir" \
    https://datasets.imdbws.com/title.basics.tsv.gz \
    https://datasets.imdbws.com/title.ratings.tsv.gz
"$RUN_BIN" app import-imdb-dataset \
    --basics "$datadir"/title.basics.tsv.gz \
    --ratings "$datadir"/title.ratings.tsv.gz
