Compare commits

..

4 Commits

Author SHA1 Message Date
lukas dcbc0b23d6 Remove DEBUG statement 2022-11-15 22:06:39 +01:00
lukas f22c4ce044 Handle location of SQL file more robustly 2022-11-15 22:03:38 +01:00
lukas 353b86af65 Add TODOs 2022-11-15 22:02:42 +01:00
lukas 1f6761bf5a Move DEBUG enablement to the top 2022-11-15 22:01:29 +01:00
+7 -2
View File
@@ -1,5 +1,6 @@
#!/usr/bin/env bash
set -ueo pipefail
[ "${DEBUG:-0}" = "1" ] && set -x
# usage:
# - init - create an empty database
# - import - import $FILE or import $DIR, both can be multiple values
@@ -12,12 +13,16 @@ set -ueo pipefail
# - tag $FILENAME $TAG - tag $FILENAME with $TAG, $TAG can be repeated
# - listtags $FILENAME - list all tags for $FILENAME
# TODO: when tagging, check if tags exist
# TODO: when tagging, allow more than one tag
# FIXME: adding tags doesn't work
SCRIPT_DIR=$(dirname $(readlink "$0"))
DB_FILE="tags.db"
DB_SCHEMA="database.sql"
DB_SCHEMA="${SCRIPT_DIR}/database.sql"
declare -A FILTERS
FILTERS[video]="avi|flv|mkv|mov|mp4|mpg|ogv|webm|wmv"
[ "${DEBUG:-0}" = "1" ] && set -x
fail() {
echo "$1" >&2;