Compare commits

..

No commits in common. "5032bb8739aa641d53b0aed722e4680d2cb000cf" and "2cf968353f792e3ffd62b99b710e57591836a33c" have entirely different histories.

17 changed files with 30 additions and 94 deletions

View File

@ -45,7 +45,7 @@ higher-than 128
# rename file, path unchanged
rename %{track}--%{artist}-%{title}
# change the whole filepath
#rename %{genre}/%{albumartist}/%{year}-%{album}-%{releasecountry}/%{track}--%{artist}-%{title}
#rename %{genre}/%{albumartist}/%{year}-%{album}/%{track}--%{artist}-%{title}
skip_mime-type image/*
skip_mime-type text/*

View File

@ -1,5 +1,5 @@
#!/bin/bash
currentdbversion=4
currentdbversion=3
checkDatabaseVersion() {
local dbversion
if dbversion=$(Select atom version <<<"\"1\" = 1")

View File

@ -1,9 +0,0 @@
#!/bin/bash
upgradedatabase_3_4() {
echo "Upgrading database to version 4... (backup is $database.bak_v3)"
cp "$database" "$database.bak_v3"
echo 'ALTER TABLE tags ADD COLUMN releasecountry TEXT;' >&3
Update atom version 4 <<<"1 = 1"
}

View File

@ -11,8 +11,6 @@ encodeFile::mp3() {
[ -n "$albumartist" ] && lameopts+=(--tv TPE2="$albumartist")
[ -n "$composer" ] && lameopts+=(--tv TCOM="$composer")
[ -n "$performer" ] && lameopts+=(--tv TOPE="$performer")
[ -n "$releasecountry" ] \
&& lameopts+=(--tv TXXX="MusicBrainz Album Release Country=$releasecountry")
[ -n "$disc" ] && lameopts+=(--tv TPOS="$disc")
if (( ${destinationnoresample[$destination]:-0} == 1 ))
then

View File

@ -11,8 +11,6 @@ encodeFile::opus() {
[ -n "$disc" ] && opusencopts+=(--comment "DISCNUMBER=$disc")
[ -n "$genre" ] && opusencopts+=(--comment "GENRE=$genre")
[ -n "$performer" ] && opusencopts+=(--comment "PERFORMER=$performer")
[ -n "$releasecountry" ] \
&& opusencopts+=(--comment "RELEASECOUNTRY=$releasecountry")
[ -n "$title" ] && opusencopts+=(--title "$title")
[ -n "$track" ] && opusencopts+=(--comment "TRACKNUMBER=${track%/*}")
[ -n "${track#*/}" ] && opusencopts+=(--comment "TRACKTOTAL=${track#*/}")

View File

@ -8,8 +8,6 @@ encodeFile::vorbis() {
[ -n "$disc" ] && oggencopts+=(-c "DISCNUMBER=$disc")
[ -n "$genre" ] && oggencopts+=(-G "$genre")
[ -n "$performer" ] && oggencopts+=(-c "PERFORMER=$performer")
[ -n "$releasecountry" ] \
&& oggencopts+=(--comment "RELEASECOUNTRY=$releasecountry")
[ -n "$title" ] && oggencopts+=(-t "$title")
[ -n "$track" ] && oggencopts+=(-N "$track")
[ -n "$year" ] && oggencopts+=(-d "$year")

View File

@ -10,10 +10,6 @@ getDestDir() {
[[ ${destinationrenamepath[$destination]} == \
*?([^[])%\{albumartist\}?([^\]])* ]] \
&& [ -n "$albumartist" ]
) || (
[[ ${destinationrenamepath[$destination]} == \
*?([^[])%\{releasecountry\}?([^\]])* ]] \
&& [ -n "$releasecountry" ]
) || (
[[ ${destinationrenamepath[$destination]} == \
*?([^[])%\{artist\}?([^\]])* ]] \
@ -48,8 +44,6 @@ getDestDir() {
read -r -u${toascii[0]} album
echo "$albumartist" >&${toascii[1]}
read -r -u${toascii[0]} albumartist
echo "$releasecountry" >&${toascii[1]}
read -r -u${toascii[0]} releasecountry
echo "$artist" >&${toascii[1]}
read -r -u${toascii[0]} artist
echo "$genre" >&${toascii[1]}
@ -67,8 +61,6 @@ getDestDir() {
destdir+="${destinationrenamepath[$destination]//?(\[)%\{album\}?(\])/$replace}"
replace=$(sanitizeFile "$albumartist" dir)
destdir="${destdir//?(\[)%\{albumartist\}?(\])/$replace}"
replace=$(sanitizeFile "$releasecountry" dir)
destdir="${destdir//?(\[)%\{releasecountry\}?(\])/$releasecountry}"
replace=$(sanitizeFile "$artist" dir)
destdir="${destdir//?(\[)%\{artist\}?(\])/$replace}"
replace=$(sanitizeFile "$genre" dir)

View File

@ -10,10 +10,6 @@ getDestFile() {
[[ ${destinationrename[$destination]} == \
*?([^[])%\{albumartist\}?([^\]])* ]] \
&& [ -n "$albumartist" ]
) || (
[[ ${destinationrenamepath[$destination]} == \
*?([^[])%\{releasecountry\}?([^\]])* ]] \
&& [ -n "$releasecountry" ]
) || (
[[ ${destinationrename[$destination]} == \
*?([^[])%\{artist\}?([^\]])* ]] \
@ -43,7 +39,6 @@ getDestFile() {
then
destfile="${destinationrename[$destination]//?(\[)%\{album\}?(\])/$album}"
destfile="${destfile//?(\[)%\{albumartist\}?(\])/$albumartist}"
destfile="${destfile//?(\[)%\{releasecountry\}?(\])/$releasecountry}"
destfile="${destfile//?(\[)%\{artist\}?(\])/$artist}"
destfile="${destfile//?(\[)%\{genre\}?(\])/$genre}"
destfile="${destfile//?(\[)%\{title\}?(\])/$title}"

View File

@ -1,5 +1,5 @@
#!/bin/bash
getInfosffmpeg_version='ffmpeg-7'
getInfosffmpeg_version='ffmpeg-6'
tagreaders+=( "$getInfosffmpeg_version" )
getInfos::ffmpeg() {
tagreader="$getInfosffmpeg_version"
@ -32,8 +32,6 @@ getInfos::ffmpeg() {
disc=$(gettag disc)
genre=$(gettag genre)
performer=$(gettag TOPE)
releasecountry=$(gettag releasecountry)
[[ -z "$releasecountry" ]] && releasecountry=$(gettag "MusicBrainz Album Release Country")
title=$(gettag title)
tracknum=$(gettag track)
year=$(gettag date)
@ -45,14 +43,6 @@ getInfos::ffmpeg() {
infos="$fmt_infos"
channels=$(gettag channels)
rate=$(gettag 'sample_rate')
case $rate in
96) rate=96000;;
48) rate=48000;;
441) rate=44100;;
32) rate=32000;;
24) rate=24000;;
225) rate=22500;;
esac
bitrate=$(gettag 'bit_rate')
bitdepth=$(gettag 'sample_fmt')
bitdepth=${bitdepth//[A-z]/}

View File

@ -1,5 +1,5 @@
#!/bin/bash
getInfosFLAC_version='FLAC-4'
getInfosFLAC_version='FLAC-3'
tagreaders+=( "$getInfosFLAC_version" )
getInfos::FLAC() {
tagreader="$getInfosFLAC_version"
@ -13,7 +13,6 @@ getInfos::FLAC() {
--show-tag=DISCNUMBER \
--show-tag=GENRE \
--show-tag=PERFORMER \
--show-tag=RELEASECOUNTRY \
--show-tag=TITLE \
--show-tag=TRACKNUMBER \
--show-tag=TRACKTOTAL \
@ -26,7 +25,6 @@ getInfos::FLAC() {
disc=$(gettag discnumber)
genre=$(gettag genre)
performer=$(gettag performer)
releasecountry=$(gettag releasecountry)
title=$(gettag title)
tracknum=$(gettag tracknumber)
tracktotal=$(gettag tracktotal)

View File

@ -11,15 +11,11 @@ getTags() {
type=Opus
(( disableopusinfo )) && unset type
;;
'audio/ogg opus')
type=Opus
(( disableopusinfo )) && unset type
;;
application/ogg*)
type=soxi
(( disablesoxi )) && unset type
;;
audio/ogg*)
audio/ogg)
type=soxi
(( disablesoxi )) && unset type
;;

View File

@ -1,5 +1,5 @@
#!/bin/bash
getInfosOpus_version='Opus-3'
getInfosOpus_version='Opus-2'
tagreaders+=( "$getInfosOpus_version" )
getInfos::Opus() {
tagreader="$getInfosOpus_version"
@ -14,7 +14,6 @@ getInfos::Opus() {
disc=$(gettag discnumber)
genre=$(gettag genre)
performer=$(gettag performer)
releasecountry=$(gettag releasecountry)
title=$(gettag title)
tracknum=$(gettag tracknumber)
tracktotal=$(gettag tracktotal)
@ -25,9 +24,7 @@ getInfos::Opus() {
year=$(gettag date)
infos="${infos//: /=}"
rate=$(gettag 'original sample rate'|head -n1)
rate=${rate% Hz}
channels=$(gettag channels|head -n1)
bitrate=$(gettag 'average bitrate')
bitrate=${bitrate%% kbit*}
bitrate=${bitrate%%.*}
}

View File

@ -1,5 +1,5 @@
#!/bin/bash
getInfosSoxi_version='soxi-2'
getInfosSoxi_version='soxi-1'
tagreaders+=( "$getInfosSoxi_version" )
getInfos::soxi() {
tagreader="$getInfosSoxi_version"
@ -13,7 +13,6 @@ getInfos::soxi() {
disc=$(gettag discnumber)
genre=$(gettag genre)
performer=$(gettag performer)
releasecountry=$(gettag releasecountry)
title=$(gettag title)
tracknum=$(gettag tracknumber)
tracktotal=$(gettag tracktotal)

6
lib/tags/tryAPE Normal file
View File

@ -0,0 +1,6 @@
#!/bin/bash
tryAPE() {
grep -q 'APETAGEX' \
"$sourcepath/$filename" \
&& type=APE
}

View File

@ -18,7 +18,6 @@ updateTags() {
tags.disc,
tags.genre,
tags.performer,
tags.releasecountry,
tags.title,
tags.track,
tags.year,
@ -82,8 +81,6 @@ echo '
rest=${rest#*::AtOM:SQL:Sep::}
oldperformer=${rest%%::AtOM:SQL:Sep::*}
rest=${rest#*::AtOM:SQL:Sep::}
oldreleasecountry=${rest%%::AtOM:SQL:Sep::*}
rest=${rest#*::AtOM:SQL:Sep::}
oldtitle=${rest%%::AtOM:SQL:Sep::*}
rest=${rest#*::AtOM:SQL:Sep::}
oldtrack=${rest%%::AtOM:SQL:Sep::*}
@ -113,7 +110,6 @@ echo '
[[ $olddisc != "$disc" ]]&& udi=1
[[ $oldgenre != "$genre" ]]&& uge=1
[[ $oldperformer != "$performer" ]]&& upe=1
[[ $oldreleasecountry != "$releasecountry" ]]&& urc=1
[[ $oldtitle != "$title" ]]&& uti=1
[[ $oldtrack != "$tracknum" ]]&& utr=1
[[ $oldyear != "$year" ]]&& uye=1
@ -129,7 +125,6 @@ echo '
${udi:+disc "${disc:-NULL}"} \
${uge:+genre "${genre:-NULL}"} \
${upe:+performer "${performer:+::AtOM:FT::}${performer:-NULL}"}\
${urc:+releasecountry "${releasecountry:+::AtOM:FT::}${releasecountry:-NULL}"}\
${uti:+title "${title:+::AtOM:FT::}${title:-NULL}"}\
${utr:+track "${track:+::AtOM:FT::}${tracknum:-NULL}"}\
${uye:+year "${year:-NULL}"} \
@ -149,7 +144,6 @@ echo '
title \
composer \
performer \
releasecountry \
rate \
bitdepth \
bitrate \
@ -162,7 +156,6 @@ echo '
udi \
uge \
upe \
urc \
uti \
utr \
uye \

View File

@ -58,7 +58,6 @@ CREATE TABLE IF NOT EXISTS tags (
title TEXT,
composer TEXT,
performer TEXT,
releasecountry TEXT,
depth INTEGER,
rate INTEGER,
channels INTEGER,

View File

@ -73,7 +73,6 @@ do
'-M') show+=(types) ;;
'-N') show+=(tracktotals) ;;
'-p') show+=(performers) ;;
'-r') show+=(releasecountries) ;;
'-s') show+=(rates) ;;
'-S') show+=(size)
length[count]=5 ;;
@ -122,7 +121,6 @@ done
-d Disc
-g Genre
-p Performer
-r Release Country
-N Track total
-t Title
-y Year
@ -282,8 +280,8 @@ fi
cat <<-EOBrag
# Generated by AtOM's createindex toy.
# https://framagit.org/atom/AtOM/
# (C) 2012-2025 Vincent Riquer (GPL-3)
# https://gitorious.org/atom
# (C) 2012-2013 Vincent Riquer (GPL-3)
#
# $0 $args
#
@ -314,7 +312,6 @@ do
oldtimestamp) info='Last modified' ;;
types) info='Format' ;;
performers) info='Performer' ;;
releasecountries) info='Country' ;;
rates) info='Sample rate' ;;
titles) info='Title' ;;
tracktotals) info='Track total' ;;
@ -348,7 +345,6 @@ SELECT
tags.disc,
tags.genre,
tags.performer,
tags.releasecountry,
tags.title,
tags.track,
tags.year,
@ -407,8 +403,6 @@ do
rest="${rest#*::AtOM:SQL:Sep::}"
performer="${rest%%::AtOM:SQL:Sep::*}"
rest="${rest#*::AtOM:SQL:Sep::}"
releasecountry="${rest%%::AtOM:SQL:Sep::*}"
rest="${rest#*::AtOM:SQL:Sep::}"
title="${rest%%::AtOM:SQL:Sep::*}"
rest="${rest#*::AtOM:SQL:Sep::}"
track="${rest%%::AtOM:SQL:Sep::*}"
@ -536,13 +530,6 @@ do
[ -n "$performer" ] \
&& performers+="${performers+,}$performer"
fi
if ! [[ $releasecountries =~ $expr1"$releasecountry"$expr2 ]]
then
[ -z "$releasecountries" ] \
&& unset releasecountries
[ -n "$releasecountry" ] \
&& releasecountries+="${releasecountries+,}$releasecountry"
fi
if ! [[ $titles =~ $expr1"$title"$expr2 ]]
then
[ -z "$titles" ] \
@ -569,10 +556,10 @@ do
then
printline
fi
unset bitrates depths rates
unset bitrates
channelss="$channels"
(( rate )) && rates="$rate"
(( depth )) && depths="$depth"
rates="$rate"
depths="$depth"
types="$type"
albumartists="$albumartist"
albums="$album"
@ -581,7 +568,6 @@ do
discs="$disc"
genres="$genre"
performers="$performer"
releasecountries="$releasecountry"
titles="$title"
tracktotals="$tracktotal"
years="$year"