~yerinalexey/dotfiles

ref: 144a38b0aa0a39003633d53b77fe4e3ca29c054b dotfiles/scripts/opus-edit -rwxr-xr-x 643 bytes
144a38b0Alexey Yerin river,update-volume: fix old wob crashes 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh

# Basic interactive (kind of) opus metadata editor

file="$1"

if [ -z "$file" ]; then
	printf "Usage: opus-edit <file>\n"
	exit 1
fi

video_title="$(basename "$file" .opus)"

artist="$(printf "%s" "$video_title" | sed 's/ - .*//g')"
song="$(printf "%s" "$video_title" | sed 's/.* - //g')"

printf "Original video title: %s\n" "$video_title"

# Update artist
printf "Artist [%s]: " "$artist"
read -r new_artist

[ -n "$new_artist" ] && artist="$new_artist"

# Update title
printf "Song title [%s]: " "$song"
read -r new_song

[ -n "$new_song" ] && song="$new_song"

opustags -D --add ARTIST="$artist" --add TITLE="$song" -i "$file"