mysql commandline client:
Create ~/.my.cnf with:
[mysql]
# mysql user, not OS user
user = root
password = ...
database = zeipis



Mass delete recordings, with or without re-record:

How much space do they occupy on disk, direct DB query:
$ echo "USE zeipis; SELECT filename FROM recording LEFT JOIN film USING (filmid) WHERE done = true AND deleted = false AND title LIKE 'Stargate%'" | mysql --skip-column-names | xargs du -shc
(possibly add AND seen = true)
Choose recordings to delete:
(e.g. all "Stargate*")
$ echo "USE zeipis; SELECT filename, recordid FROM recording LEFT JOIN film USING (filmid) WHERE done = true AND deleted = false AND title LIKE 'Stargate%'" | mysql --skip-column-names > del.list
How many recordings are that:
$ cat del.list | wc -l
How much space to they occupy on disk:
$ cd <your recordings directory>
$ sed -e "s|\t.*||" del.list | xargs du -shc
Delete files:
$ sed -e "s|\t.*||" del.list | xargs rm
Check delete database:
$ sed -e "s|.*\t||" del.list|xargs -iRECID echo "USE zeipis; SELECT title, subtitle, filename FROM recording LEFT JOIN film USING (filmid) WHERE recordid=RECID;"|mysql --skip-column-names
Delete database entries (allow re-record):
$ sed -e "s|.*\t||" del.list|xargs -iRECID echo "USE zeipis; DELETE FROM recording WHERE recordid=RECID;"|mysql
Mark recordings as deleted (do not re-record):
$ sed -e "s|.*\t||" del.list|xargs -iRECID echo "USE zeipis; UPDATE recording SET deleted = true WHERE recordid=RECID;"|mysql
