Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional add album art into tags #123

Merged
merged 2 commits into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 30 additions & 29 deletions manual-build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,35 @@ ENV DEBIAN_FRONTEND=noninteractive \
CMD ["/sbin/my_init"]

# Configure user nobody to match unRAID's settings
RUN usermod -u 99 nobody && \
usermod -g 100 nobody && \
usermod -d /home nobody && \
RUN usermod -u 99 nobody &&
usermod -g 100 nobody &&
usermod -d /home nobody &&
chown nobody:users /home -R

# Install Required packages
RUN apt-get update && \
RUN apt-get update &&
apt-get install -y --no-install-recommends \
abcde \
eject \
eyed3 \
ffmpeg \
flac \
gddrescue \
id3 \
id3v2 \
lame \
mkcue \
python3 \
python3-docopt \
python3-flask \
python3-waitress \
sdparm \
speex \
vorbis-tools \
vorbisgain && \
apt-get autoremove -y && \
apt-get clean && \
abcde \
eject \
eyed3 \
ffmpeg \
flac \
gddrescue \
glyrc \
id3 \
id3v2 \
lame \
mkcue \
python3 \
python3-docopt \
python3-flask \
python3-waitress \
sdparm \
speex \
vorbis-tools \
vorbisgain &&
apt-get autoremove -y &&
apt-get clean &&
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Invalidate build cache on forum post change
Expand All @@ -47,11 +48,11 @@ ADD "https://forum.makemkv.com/forum/viewtopic.php?f=3&t=224" /dev/null
# Move Files, set permissions and install makemkv
COPY root/ /
COPY manual-build/install/ /install
RUN chmod +x /etc/my_init.d/*.sh && \
chmod -R 777 /tmp && \
chmod 775 /install && \
chmod +x /install/install.sh && \
/install/install.sh && \
RUN chmod +x /etc/my_init.d/*.sh &&
chmod -R 777 /tmp &&
chmod 775 /install &&
chmod +x /install/install.sh &&
/install/install.sh &&
rm -rf /install

# Disable SSH
Expand Down
54 changes: 54 additions & 0 deletions root/ripper/abcde.conf
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ OUTPUTDIR=/out/Ripper/CD

# The default actions that abcde will take.
ACTIONS=cddb,playlist,read,encode,tag,move,clean
# Replace previous settings with this one in case album art should be embedded
# ACTIONS=cddb,playlist,read,getalbumart,encode,tag,move,clean

# Decide here how you want the tracks labelled for a standard 'single-artist',
# multi-track encode and also for a multi-track, 'various-artist' encode:
Expand All @@ -89,6 +91,58 @@ mungefilename ()
echo "$@" | sed -e 's/^\.*//' | tr -d ":><|*/\"'?[:cntrl:]"
}

# If possible this function will embedd covers into the files
# Function was taken from
# https://gist.github.com/slawekzachcial/73b45c9d624fb5b6cdd07e187553d565
post_encode ()
{
ARTISTFILE="$(mungefilename "$TRACKARTIST")"
ALBUMFILE="$(mungefilename "$DALBUM")"
YEAR=${CDYEAR:-$CDYEAR}

#------ Find multiple output formats -----#
for OUTPUT in $(echo $OUTPUTTYPE | tr , \ )
do

#-------- Find the output directory ------#
if [ "$VARIOUSARTISTS" = "y" ] ; then
FINDPATH="$(eval echo "$VAOUTPUTFORMAT")"
else
FINDPATH="$(eval echo "$OUTPUTFORMAT")"
fi

FINALDIR="$(dirname "$OUTPUTDIR/$FINDPATH")"
cd "$FINALDIR"

#----- Instructions for each format ------#
if [ -e "cover.jpg" ] ; then
case "$OUTPUT" in
mp3)
for i in *.mp3
do
eyeD3 --add-image cover.jpg:FRONT_COVER "$i"
done
;;
flac)
for i in *.flac
do
metaflac --import-picture-from=cover.jpg "$i"
done
;;
*) vecho "Sorry, no matching output formats here..." >&2
return 1
esac
else
vecho "Cover image not found..." >&2
return 1
fi

vecho "Your "$OUTPUT" files have had the album art embedded..." >&2

#------ Complete the initial loop -----#
done
}

# What extra options?
MAXPROCS=2 # Run a few encoders simultaneously
PADTRACKS=y # Makes tracks 01 02 not 1 2
Expand Down
Loading