commit 7d454b875bbdf2c420b7111415e962869bb5a344
parent 92bea14bb3970310e2a02bdda20f78a641215fc1
Author: hhvn <dev@hhvn.uk>
Date: Mon, 5 Sep 2022 16:04:26 +0100
Scripts for clearing a/v metadata
Diffstat:
3 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/.scripts/tag/clear b/.scripts/tag/clear
@@ -0,0 +1,19 @@
+#!/bin/rc
+#
+# Clear a tag from a file
+#
+
+fn sigexit {
+ rm $tmp
+}
+
+file = $1
+shift
+tmp = /tmp/$pid.clear.`$nl{echo $file | tr / _}
+
+for (tag in $*) {
+ args = ($args -metadata $tag^=)
+}
+
+ffmpeg -nostdin -i $file -c copy $args $tmp
+mv $tmp $file
diff --git a/.scripts/tag/clearalbum_artist b/.scripts/tag/clearalbum_artist
@@ -0,0 +1,8 @@
+#!/bin/rc
+#
+# Grrr.
+#
+
+for (f in *) {
+ tag/clear $f album_artist
+}
diff --git a/.scripts/tag/clearsort b/.scripts/tag/clearsort
@@ -3,11 +3,6 @@
# ways. Let software (i,e, cmus) do it rather than hardcoding different sorting
# systems into files.
-fn sigexit {
- rm $tmp
-}
-
for (f in $*) {
- tmp = /tmp/$pid.`$nl{echo $f | tr / _}
- ffmpeg -y -nostdin -i $f -c copy -metadata TSOP='' -metadata TSOA='' -metadata TSOC='' -metadata TSO2='' -metadata XSOP='' -metadata XSOA='' -metadata XSOC='' -metadata TSP='' -metadata TS2='' -metadata TSA='' -metadata TSC='' -metadata albumsort='' -metadata artistsort='' -metadata albumartistsort='' -metadata album-sort='' -metadata artist-sort='' -metadata albumartist-sort='' $tmp && mv $tmp $f
+ tag/clear $f TSOP TSOA TSOC TSO2 XSOP XSOA XSOC TSP TS2 TSA TSC albumsort artistsort albumartistsort album-sort artist-sort albumartist-sort
}