Name : Add music transfer.

This commit is contained in:
Dmitry Voronin 2024-01-18 00:17:11 +03:00
parent 0436631084
commit 34edaae576

View file

@ -204,6 +204,28 @@ function name_manga() {
_iterate_targets process ${targets[@]} _iterate_targets process ${targets[@]}
} }
# Rename files for ffmpeg_music_meta format.
# All files by default.
# Usage: name_music [FILES]
function name_music() {
local IFS=$'\n'
local targets=(${@})
[[ "${targets}" = "" ]] && targets=($(ls))
process() {
# Extract new name.
local new_name="$(parse_titlecase $(parse_simplify ${target}))"
# Skip on no change.
[[ "${target%/}" = "${new_name}" ]] && return 0
# Rename target.
mv -- ${target} ${new_name} && echo ${new_name}
}
_iterate_targets process ${targets[@]}
}
# Rename files with new extension. # Rename files with new extension.
# All files by default. # All files by default.
# Usage: name_ext <EXTENSION> [FILES] # Usage: name_ext <EXTENSION> [FILES]