Name : Add music transfer.
This commit is contained in:
parent
0436631084
commit
34edaae576
|
@ -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]
|
||||||
|
|
Reference in a new issue