I use a script between transmission and beets. Firstly, transmission is running (on debian) as debian-transmission, which doesn't have write access to either my library file or the directory where I want my music to go. I have some logic in my script that calls whatmp3 if it detects a flac download in order to convert it to mp3 before importing. It emails me whenever it tries to import an album, letting me know if it thinks it failed. I run beets as user installation in my own user account on this particular host, so in sudoers I have this line:
#!/bin/bash -x
#
# beetsimport.sh - a script to be called by transmission-daemon to attempt to
# auto-import newly downloaded torrents into beets
#
IMPORT_USER="mikemacleod"
TMPLOG="/tmp/beetsimport.${TR_TORRENT_ID}.log"
LOG="/var/log/beetsimport.log"
cd $TR_TORRENT_DIR
echo "NEWTORRENT: $TR_TORRENT_NAME" > $TMPLOG
FLAC=`ls -l "$TR_TORRENT_NAME" | grep -i flac | wc -l`
IMPORT_DIR="$TR_TORRENT_NAME"
# Check if the torrent directory exists
if [ -d "$TR_TORRENT_NAME" ]; then
# If FLAC then convert to MP3
if [ "$FLAC" != "0" ]; then
/usr/local/bin/whatmp3 --V0 --threads=4 "$IMPORT_DIR" > $TMPLOG.V0
/usr/local/bin/whatmp3 --V2 --threads=4 "$IMPORT_DIR" > $TMPLOG.V2
/usr/local/bin/whatmp3 --320 --threads=4 "$IMPORT_DIR" > $TMPLOG.320
IMPORT_DIR=`/bin/cat $TMPLOG.V0 | grep WHAT_MP3_DIR | cut -f4 -d '/'`
echo "CONVERTEDTORRENT: $IMPORT_DIR" >> $TMPLOG
fi
# Import into Beets
/usr/bin/sudo -u $IMPORT_USER /home/mikemacleod/.local/bin/beet import -q "$IMPORT_DIR" >> $TMPLOG
# Check for success
grep -q Skipping $TMPLOG
IMPORT=$?
# If we converted copy over the logs
if [ "$FLAC" != "0" ]; then
/bin/cat $TMPLOG.V0 >> $TMPLOG
/bin/cat $TMPLOG.V2 >> $TMPLOG
/bin/cat $TMPLOG.320 >> $TMPLOG
/bin/rm $TMPLOG.V0
/bin/rm $TMPLOG.V2
/bin/rm $TMPLOG.320
fi
# Email the results
if [ "$IMPORT" == "0" ]; then
/usr/bin/mail -s "Beets Import Failed" "$EMAIL" < $TMPLOG
else
/usr/bin/mail -s "Beets Import Successful" "$EMAIL" < $TMPLOG
fi
else
# Email if the directory doesn't exist
echo "Could not find the torrent \"$TR_TORRENT_NAME\" in the completed torrents folder" >> $TMPLOG
/usr/bin/mail -s "Beets Could Not Import" "$EMAIL" < $TMPLOG
fi
/bin/cat $TMPLOG >> $LOG
/bin/rm $TMPLOG
That should get you started, at least.