Return discogs IDs from beets library

So I’m just getting started with Beets. Still testing things and am not yet ready to run the full import. But I can already see it’s super powerful and what I’ve been looking for for a long time to sort out my messy music collection.

One of the queries I want to write is a way to check if I have a digital version of every record I have in my vinyl collection (I have my vinyl collection all logged in Discogs). And the inverse - which ones am I missing.

I’ve installed the Discogs plugin. I’ve manually entered a discogs URL as ID on a a test import. So far so good.
When printing out a list from beets collection, can I return Discogs IDs that are associated? I saw at the bottom of this list - - mention of paths from various plugins. But I can’t see anything specific to Discogs though.

n.b. not looking for beets to solve my end-to-end problem. Just to return some Discogs unique IDs that I can then manipulate further.

Yes! But only in the latest (unreleased) source, as of this pull request:

The plugin now puts the album ID in the $discogs_albumid field.

My timing is great then! So ill need to wait for the next release and then upgrade?

Yeah, or you can run from source! (There are instructions in the FAQ.)

Yes got it working with beet ls -f ‘$artist - $title - $discogs_albumid’

Now to write the full script to match with my collection :slight_smile:

This field doesn’t seem to output anything for me, even though I have entered many releases into my collection via the discogs plugin. Any ideas why that might be?

Interestingly, beet fields does not display this discogs_albumid field.

Here’s my beet config:

beet config
directory: /Volumes/2TB Iomega Data/Users/patrick/Music/beets/collection
library: /Volumes/2TB Iomega Data/Users/patrick/Music/beets/library/musiclibrary.blb

- fetchart
- chroma
- discogs
- fromfilename
- convert
- alternatives
- info
- types
- web
- lastgenre

    move: yes
    log: /Volumes/2TB Iomega Data/Users/patrick/Music/beets/log/beets.log

format_item: '$added - $artist - $album - d:$disc/$disctotal--t:$track/$tracktotal - $title - $length - $genre - $format - $bitrate - $import_source - discogs: $discogs_albumid - dj: $dj'
sort_item: albumartist+ album+ disc+ track+
    apikey: REDACTED
    dest: ~/Music/beets-convert-test
    format: alac
    pretend: no
    threads: 2
    id3v23: inherit
            command: ffmpeg -i $source -y -vn -acodec aac -aq 1 $dest
            extension: m4a
            command: ffmpeg -i $source -y -vn -acodec alac $dest
            extension: m4a
        flac: ffmpeg -i $source -y -vn -acodec flac $dest
        mp3: ffmpeg -i $source -y -vn -aq 2 $dest
        opus: ffmpeg -i $source -y -vn -acodec libopus -ab 96k $dest
        ogg: ffmpeg -i $source -y -vn -acodec libvorbis -aq 3 $dest
        wma: ffmpeg -i $source -y -vn -acodec wmav2 -vn $dest
    max_bitrate: 500
    auto: no
    quiet: no
    embed: yes

    paths: {}
    no_convert: ''
    never_convert_lossy_files: no
    copy_album_art: no
    album_art_maxwidth: 0
        directory: /Volumes/live/Music/beets
        formats: alac mp3
        query: dj:True
        removable: yes
        directory: /Volumes/airlive/Music/beets
        formats: alac mp3
        query: dj:True
        removable: yes
        directory: /Volumes/2TB Iomega Data/Users/patrick/Music/plex
        formats: flac aac alac mp3
        query: ''
        removable: yes
        directory: /Volumes/2TB Iomega Data/Users/patrick/Music/rekordbox
        formats: flac aac alac mp3
        query: dj:True
        removable: yes
    dj: bool
    source: track
    count: 5
    whitelist: yes
    min_weight: 10
    canonical: no
    force: yes
    auto: yes
    separator: ', '
    prefer_specific: no
    auto: yes
    port: 8337
    cors: ''
    cors_supports_credentials: no
    reverse_proxy: no
    include_paths: no
    auto: yes
    minwidth: 0
    maxwidth: 0
    enforce_ratio: no
    cautious: no
    - cover
    - front
    - art
    - album
    - folder
    - filesystem
    - coverart
    - itunes
    - amazon
    - albumart
    google_key: REDACTED
    google_engine: 001442825323518660753:hrh5ch1gjzm
    fanarttv_key: REDACTED
    store_source: no
    apikey: REDACTED
    apisecret: REDACTED
    tokenfile: discogs_token.json
    source_weight: 0.5
    user_token: REDACTED