Compare commits

..

8 Commits

Author SHA1 Message Date
ScriptFanix
7a359ad2d6 Merge branch 'dev' into 'master'
v1.0.4 last minute fixes

See merge request atom/AtOM!32
2025-10-13 18:21:25 +02:00
Vincent Riquer
75159a4e2b Hotfix: createindex: fix ID3v1 genre index path 2025-10-13 18:20:54 +02:00
Vincent Riquer
325bdb3c96 Hotfix: missing quote in createindex 2025-10-13 18:20:54 +02:00
Vincent Riquer
2b5bf06e58 Hotfix: commit more often when reading tags 2025-10-13 18:20:54 +02:00
ScriptFanix
3a6c7bfc9c Merge branch 'dev' into 'master'
Bugfix release v1.0.4

Closes #26

See merge request atom/AtOM!30
2025-10-11 22:31:16 +02:00
ScriptFanix
f3e4aed71e Merge branch '26-ffmpeg-tags-are-always-null' into 'dev'
Resolve "ffmpeg tags are always NULL"

See merge request atom/AtOM!29
2025-10-11 22:23:17 +02:00
ScriptFanix
a0756b170c Resolve "ffmpeg tags are always NULL" 2025-10-11 22:23:16 +02:00
Vincent Riquer
1d7a09fcff quickfix: replace calls to date with builtin printf or $EPOCHSECONDS 2025-08-08 20:19:51 +02:00
13 changed files with 33 additions and 180 deletions

View File

@ -20,13 +20,13 @@ in the same format, it will want a constant sample-rate and bitrate. You can
have AtOM do that!
Here's what I have for my tests:
| Directory | Format | Sample rate | Bitrate | Channels | Normalize | FAT32 compat. | ASCII | Size |
| --------- | ------ | ----------- | --------- | -------- | --------- | ------------- | ----- | ---- |
| 0-Full | Mixed | Mixed | Mixed | Mixed | No | No | No | 508G |
| 1-High | Vorbis | Original | Quality 5 | Same | No | Yes | No | 136G |
| 2-Medium | Opus | Original | 64 | Same | No | Yes | No | 58G |
| 3-Small | Opus | Original | 32 | Same | No | Yes | No | 30G |
| 4-MP3 | MP3 | 44100 | 128 | 2 | No | Yes | Yes | 113G |
| Directory | Format | Sample rate | Bitrate | Channels | FAT32 compat. | ASCII | Size |
| --------- | ------ | ----------- | ------- | -------- | ------------- | ----- | ---- |
| 0-Full | Mixed | Mixed | Mixed | Mixed | No | No | 508G |
| 1-High | Opus | Same | 128 | Same | Yes | No | 101G |
| 2-Medium | Opus | Same | 64 | Same | Yes | No | 59G |
| 3-Small | Opus | Same | 32 | Same | Yes | No | 30G |
| 4-MP3 | MP3 | 44100 | 128 | 2 | Yes | Yes | 114G |

8
atom
View File

@ -555,16 +555,16 @@ echo "Created ${count:-0} tasks for $filecount files ${togo:+($togo left) }(${co
concurrency=$(( maxload / 2 ))
(( concurrency )) || concurrency=1
active=0
concurrencychange=$(date +%s)
concurrencychange=$EPOCHSECONDS
starttime=$concurrencychange
taskcount=$count
remaining=$taskcount
failed=0
echo 'BEGIN TRANSACTION;' >&3
committime=$(date +%s)
committime=$EPOCHSECONDS
while (( (remaining || ${#workers[@]}) && ! quit ))
do
timestamp=$(date +%s)
timestamp=$EPOCHSECONDS
if (( $timestamp - committime >= 60 ))
then
echo $'COMMIT;\nBEGIN TRANSACTION;' >&3
@ -673,7 +673,7 @@ done
echo 'COMMIT;' >&3
unset count
endtime=$(date +%s)
endtime=$EPOCHSECONDS
(( elapsedseconds = endtime - starttime - pausedtime ))
(( days =

View File

@ -47,20 +47,6 @@ Sections:
Default: /var/lib/mpd/music
* skip <directory>: String. Files in <directory> will be ignored. Note that
<directory> can be any expression accepted by find.
* tag-guessing <expression>: String. Filenaming scheme to allow for guessing
tags from filenames and directories. The placeholders are the same as thosefor rename below:
%{album},
%{albumartist},
%{artist},
%{disc},
%{genre},
%{releasecountry},
%{title},
%{track},
%{year}.
* tag-guessing-trigger <tag>: String. Specify multiple times for multiple
tags.
If <tag> cannot be fetched by tag readers, guessing will be attempted.
[<some arbitrary string>]
Each section not named 'general' or 'source' will define a new destination.

View File

@ -49,33 +49,6 @@ skip /last
skip /lastfm
skip /zzz-atrier
# Tag guessing expresssion. Uses same values as "rename" below. This is used to
# guess tags from filenames and paths. This is useful for files with no tags but
# can lead to issues if a strict naming scheme is not used.
# Tag guessing disabled if unset (default).
# %{album},
# %{albumartist},
# %{artist},
# %{disc} (1 digit),
# %{genre},
# %{releasecountry} (2 letter code),
# %{title},
# %{track} (2 digits),
# %{year}.
#tag-guessing %{genre}/%{albumartist}/%{year}-%{album}-%{releasecountry}/%{disc}%{track}--%{artist}-%{title}
# Guess tags on missing infos:
#tag-guessing-trigger artist
#tag-guessing-trigger albumartist
#tag-guessing-trigger album
#tag-guessing-trigger releasecountry
#tag-guessing-trigger disc
#tag-guessing-trigger title
#tag-guessing-trigger track
#tag-guessing-trigger year
#tag-guessing-trigger genre
[Vorbis]
# Each section not named 'general' or 'source' will define a new destination.

View File

@ -7,11 +7,5 @@ getConfigSource() {
'skip')
skippeddirectories+=( "$value" )
;;
'tag-guessing')
tagguessing="$value"
;;
'tag-guessing-trigger')
tagguessingtriggers+=( "$value" )
;;
esac
}

View File

@ -21,16 +21,6 @@ printConfig() {
printed=1
done
unset printed
echo " |Tag guessing expression|$tagguessing"
for trigger in "${tagguessingtriggers[@]}"
do
(( printed )) \
&& echo -n ' | |' \
|| echo -n ' |Tag guessing triggers|'
echo "$trigger"
printed=1
done
for destination in ${destinations[@]}
do
cat <<-EOF

View File

@ -51,32 +51,6 @@ path $sourcepath
cat <<-EOCfg
# Tag guessing expresssion. Uses same values as "rename" below. This is used to
# guess tags from filenames and paths. This is useful for files with no tags but
# can lead to issues if a strict naming scheme is not used.
# Tag guessing disabled if unset (default).
# %{album},
# %{albumartist},
# %{artist},
# %{disc} (1 digit),
# %{genre},
# %{releasecountry} (2 letter code),
# %{title},
# %{track} (2 digits),
# %{year}.
#tag-guessing %{genre}/%{albumartist}/%{year}-%{album}-%{releasecountry}/%{disc}%{track}--%{artist}-%{title}
tag-guessing $tagguessing
# Guess tags on missing infos:
#tag-guessing-trigger artist
#tag-guessing-trigger albumartist
EOCfg
for trigger in "${tagguessingtriggers[@]}"
do
echo $'tag-guessing-trigger\t'"$trigger"
done
EOCfg
for destination in "${destinations[@]}"
do

View File

@ -1,6 +1,6 @@
#!/bin/bash
getFiles() {
scantime=$(date +%s)
scantime=$EPOCHSECONDS
for prune_expression in "${skippeddirectories[@]}"
do
prunes+=( -path "$sourcepath$prune_expression" -prune -o )

View File

@ -55,58 +55,4 @@ setupSource() {
done
unset count
cd - >/dev/null
cat <<-EODesc
Tag guessing pattern:
This is a pattern that will be used to guess the tag names of files
that do not have any tags. The pattern is a string with the following
variables:
%{album} - The album name
%{albumartist} - The album artist name
%{artist} - The artist name
%{disc} - The disc number - 1 digit
%{genre} - The genre name
%{releasecountry} - The country of the release - 2 letter code
%{title} - The title of the track
%{track} - The track number - 2 digits
%{year} - The year or date of the album
EODesc
read \
-e \
-i"${tagguessing} \
-p'Pattern: ' \
tagguessing
cat <<-EODesc
Tag guessing trigger(s):
Tags whose absence will trigger tag guessing.
album - The album name
albumartist - The album artist name
artist - The artist name
disc - The disc number
genre - The genre name
releasecountry - The country of the release
title - The title of the track
track - The track number
year - The year or date of the album
EODesc
count=${#tagguessingtriggers[@]}
for (( i=0 ; 1 ; i++ ))
do
read \
-e \
${tagguessingtriggers[i]+-i"${tagguessingtriggers[i]}"}\
-p'Tag guessing trigger: ' \
value
if [ -n "$value" ]
then
tagguessingtriggers[i]="$value"
elif (( i < count ))
then
unset tagguessingtriggers[i]
else
break
fi
done
unset count
}

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
getInfosffmpeg_version='ffmpeg-8'
getInfosffmpeg_version='ffmpeg-9'
tagreaders+=( "$getInfosffmpeg_version" )
getInfos::ffmpeg() {
tagreader="$getInfosffmpeg_version"
@ -27,27 +27,27 @@ getInfos::ffmpeg() {
:stream= \
bit_rate, \
channels, \
sample_fmt \
sample_rate, \
" \
-of default=noprint_wrappers=1 \
-i "$sourcepath/$filename"
-i "$sourcepath/$filename" \
| egrep -v '=N/A$'
)
albumartist=$(gettag album_artist)
album=$(gettag album)
artist=$(gettag artist)
composer=$(gettag composer)
disc=$(gettag disc)
genre=$(gettag genre)
performer=$(gettag TOPE)
releasecountry=$(gettag releasecountry)
albumartist=$(gettag TAG:album_artist)
album=$(gettag TAG:album)
artist=$(gettag TAG:artist)
composer=$(gettag TAG:composer)
disc=$(gettag TAG:disc)
genre=$(gettag TAG:genre)
performer=$(gettag TAG:TOPE)
releasecountry=$(gettag TAG:releasecountry)
[[ -z "$releasecountry" ]] \
&& releasecountry=$(gettag "MusicBrainz Album Release Country")
replaygain_alb=$(gettag replaygain_album_gain)
replaygain_trk=$(gettag replaygain_track_gain)
title=$(gettag title)
tracknum=$(gettag track)
year=$(gettag date)
&& releasecountry=$(gettag "TAG:MusicBrainz Album Release Country")
replaygain_alb=$(gettag TAG:replaygain_album_gain)
replaygain_trk=$(gettag TAG:replaygain_track_gain)
title=$(gettag TAG:title)
tracknum=$(gettag TAG:track)
year=$(gettag TAG:date)
expr='^[0-9]*$'
if [ -n "$genre" ] && [[ $genre =~ $expr ]]
then

View File

@ -1,10 +0,0 @@
#!/usr/bin/env bash
getInfosGuess_version='guess-1'
tagreaders+=( "$getInfosGuess_version" )
getInfos::Guess() {
tagreader="$getInfosGuess_version"
local \
infos \
: #FIXME
}

View File

@ -105,7 +105,7 @@ echo '
oldbitrate=${rest%%::AtOM:SQL:Sep::*}
((++count))
(( cron )) || echo -en "\rTags: $((count*100/filecount))%"
if (( count % 1000 == 0 ))
if (( count % 100 == 0 ))
then
echo 'COMMIT;BEGIN TRANSACTION;' >&3
(( debug )) \

View File

@ -38,7 +38,7 @@ LC_ALL=C
shopt -s extglob
source ./share/id3genres
source "$SHAREDIR"/id3genres
for function in "$LIBDIR"/*/*
do
@ -287,12 +287,12 @@ cat <<-EOBrag
#
# $0 $args
#
# Last database update: $(date -d @$lastupdate +'%x %X')
# Last database update: $(printf "%(%x %X)T" "$lastupdate")
EOBrag
printDate() {
date -d"@$1" +"${timeformat:-%x %X}"
printf "%("${timeformat:-%x %X}")T" "$1"
}
for index in ${!show[@]}