Convert and delete source file(s)

Hello,

Is there a way to achieve this? Would defining the convert command and adding “&& rm $source” work? Any other/better ways?

Thanks

Sure! You can imagine defining something simple in your shell:

function convertAndDelete () { beet convert $@ && beet remove $@ }

Then convertAndDelete <query> would probably do what you want.

I like that, but I should expand a bit more. I’m running the import over my /music directory on a schedule to tag any new music. Sometimes flac files end up next to the converted mp3 files.

I’ve got beets running in a container with the cron job scheduled at the host so I figure tying it to the import process is ‘safer’

convert:
    command: ffmpeg -i $source -y -vn -aq 2 $dest && $dest
    extension: mp3

I see! If you want to convert at the same time as importing, have you tried the auto option? This thread seems relevant:

Here is my current import and convert config,

import:
    copy: false
    move: true
    write: true
    resume: yes
    art: true
    incremental: true
    quiet_fallback: skip
    timid: false
    log: beetslog.txt
convert:
    auto: true
    embed: true
    never_convert_lossy_files: true
    ffmpeg: /usr/bin/ffmpeg
    opts: -ab 320k -ac 2 -ar 48000
    max_bitrate: 320

That thread is very relevant! Must have been operating under the same assumption as the OP in it. Please consider a +1 to the request :slight_smile: