# Return discogs IDs from beets library

**URL:** <https://discourse.beets.io/t/return-discogs-ids-from-beets-library/867>\
**Category:** Help\
**Created:** [August 9, 2019, 6:43am UTC](https://discourse.beets.io/t/return-discogs-ids-from-beets-library/867 "2019-08-09T06:43:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![brightlime](https://avatars.discourse-cdn.com/v4/letter/b/45deac/32.png) [@brightlime](https://discourse.beets.io/u/brightlime)\
**Post date:** [August 9, 2019, 6:43am UTC](https://discourse.beets.io/t/return-discogs-ids-from-beets-library/867/1 "2019-08-09T06:43:15Z")

</div>

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 - [https://beets.readthedocs.io/en/v1.3.17/reference/pathformat.html](https://beets.readthedocs.io/en/v1.3.17/reference/pathformat.html) - 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.

---

<div class="post-metadata">

**Author:** ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)\
**Post date:** [August 9, 2019, 8:07am UTC](https://discourse.beets.io/t/return-discogs-ids-from-beets-library/867/2 "2019-08-09T08:07:43Z")

</div>

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

> <https://github.com/beetbox/beets/pull/3322>

The plugin now puts the album ID in the $discogs\_albumid field.

---

<div class="post-metadata">

**Author:** ![brightlime](https://avatars.discourse-cdn.com/v4/letter/b/45deac/32.png) [@brightlime](https://discourse.beets.io/u/brightlime)\
**Post date:** [August 9, 2019, 9:38am UTC](https://discourse.beets.io/t/return-discogs-ids-from-beets-library/867/3 "2019-08-09T09:38:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![adrian](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/adrian/32/4_2.png) [@adrian](https://discourse.beets.io/u/adrian)\
**Post date:** [August 9, 2019, 9:57am UTC](https://discourse.beets.io/t/return-discogs-ids-from-beets-library/867/4 "2019-08-09T09:57:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![brightlime](https://avatars.discourse-cdn.com/v4/letter/b/45deac/32.png) [@brightlime](https://discourse.beets.io/u/brightlime)\
**Post date:** [August 16, 2019, 3:21am UTC](https://discourse.beets.io/t/return-discogs-ids-from-beets-library/867/5 "2019-08-16T03:21:01Z")

</div>

Yes got it working with beet ls -f ‘$artist - $title - $discogs\_albumid’

Now to write the full script to match with my collection 🙂

---

<div class="post-metadata">

**Author:** ![discopatrick](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.beets.io/discopatrick/32/73_2.png) [@discopatrick](https://discourse.beets.io/u/discopatrick)\
**Post date:** [April 5, 2020, 1:33pm UTC](https://discourse.beets.io/t/return-discogs-ids-from-beets-library/867/6 "2020-04-05T13:33:53Z")

</div>

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:

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

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

import:
    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+
acoustid:
    apikey: REDACTED
convert:
    dest: ~/Music/beets-convert-test
    format: alac
    pretend: no
    threads: 2
    id3v23: inherit
    formats:
        aac:
            command: ffmpeg -i $source -y -vn -acodec aac -aq 1 $dest
            extension: m4a
        alac:
            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
    tmpdir:
    quiet: no
    embed: yes

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

```
