#!/usr/bin/env bash

for file in *.opus; do
	ffmpeg \
		-hide_banner \
		-i "${file}" -i "cover.jpg" \
		-map_metadata 0:s:a:0 -disposition attached_pic \
		-metadata date="$1" \
		-c:a copy "0${file}"

	rm "$file"
	mv "0${file}" "${file#"0"}"
done
