Beets: MPDStats play count inconsistencies

Created on 13 Apr 2016  路  5Comments  路  Source: beetbox/beets

Problem

MPDStats is attributing 2 play counts and 1 skip to each track played. The play counts are both registered at the beginning of the track and the skip at the end.

Running this command in verbose (-vv) mode:

$ beet -vv mpdstats

Led to this problem:

mpdstats: playing /net/nfs4/server/mediacentre/Music/Library_test/Calexico/The Black Light (1998)/08 Missing.mp3
Sending event: database_change
mpdstats: updated: last_played = 1460521768 [/net/nfs4/server/mediacentre/Music/Library_test/Calexico/The Black Light (1998)/08 Missing.mp3]
mpdstats: playing /net/nfs4/server/mediacentre/Music/Library_test/Calexico/The Black Light (1998)/08 Missing.mp3
Sending event: database_change
mpdstats: updated: last_played = 1460521769 [/net/nfs4/server/mediacentre/Music/Library_test/Calexico/The Black Light (1998)/08 Missing.mp3]
Sending event: database_change
mpdstats: updated: skip_count = 1 [/net/nfs4/server/mediacentre/Music/Library_test/Calexico/The Black Light (1998)/08 Missing.mp3]
mpdstats: skipped /net/nfs4/server/mediacentre/Music/Library_test/Calexico/The Black Light (1998)/08 Missing.mp3
Sending event: database_change
mpdstats: updated: rating = 0.5625 [/net/nfs4/server/mediacentre/Music/Library_test/Calexico/The Black Light (1998)/08 Missing.mp3]
mpdstats: playing /net/nfs4/server/mediacentre/Music/Library_test/Iron & Wine/Our Endless Numbered Days (2004)/03 Cinder and Smoke.mp3
Sending event: database_change
mpdstats: updated: last_played = 1460522211 [/net/nfs4/server/mediacentre/Music/Library_test/Iron & Wine/Our Endless Numbered Days (2004)/03 Cinder and Smoke.mp3]
mpdstats: playing /net/nfs4/server/mediacentre/Music/Library_test/Iron & Wine/Our Endless Numbered Days (2004)/03 Cinder and Smoke.mp3
Sending event: database_change
mpdstats: updated: last_played = 1460522211 [/net/nfs4/server/mediacentre/Music/Library_test/Iron & Wine/Our Endless Numbered Days (2004)/03 Cinder and Smoke.mp3]
Sending event: database_change
mpdstats: updated: skip_count = 1 [/net/nfs4/server/mediacentre/Music/Library_test/Iron & Wine/Our Endless Numbered Days (2004)/03 Cinder and Smoke.mp3]
mpdstats: skipped /net/nfs4/server/mediacentre/Music/Library_test/Iron & Wine/Our Endless Numbered Days (2004)/03 Cinder and Smoke.mp3
Sending event: database_change
mpdstats: updated: rating = 0.5125 [/net/nfs4/server/mediacentre/Music/Library_test/Iron & Wine/Our Endless Numbered Days (2004)/03 Cinder and Smoke.mp3]

Setup

  • OS: Arch Linux
  • Python version: 2.7.11
  • beets version: 1.3.17
  • Turning off plugins made problem go away (yes/no): no

My configuration (output of beet config) is:

directory: /net/nfs4/server/mediacentre/Music/Library_test
library: /net/nfs4/server/mediacentre/Music/Catalogs/beets_test.blb
plugins: fromfilename inline edit fetchart embedart zero rewrite importfeeds thumbnails fuzzy info missing random types wlg replaygain mpdstats smartplaylist mpdupdate duplicates badfiles smartplaylist play
pluginpath: /usr/local/bin/wlg
per_disc_numbering: yes
threaded: no  #disable for debugging
import:
    resume: yes
    quiet_fallback: skip
    none_rec_action: ask
    log: ~/.config/beets/beetslog.txt
    detail: yes
    write: yes
    copy: yes
    move: no
    autotag: yes
    link: no
    resume: ask
    incremental: no
    timid: no
paths:
    default: $albumartist/$album%aunique{albumartist album year,albumtype label catalognum albumdisambig} ($year)/%if{$multidisc,$disc}$track $title
    singleton: $artist/-Misc-/$track $title
    comp: Various Artists/$album%aunique{albumartist album year,albumtype label catalognum albumdisambig} ($year)/%if{$multidisc,$disc}$track $title
item_fields:
    multidisc: 1 if disctotal > 1 else 0
replace:
    '[\\/]': _
    '^\.': _
    '[\x00-\x1f]': _
    '\.$': ''
    '\s+$': ''
    '^\s+': ''
art_filename: folder
fetchart:
    auto: yes
    cautious: yes
    remote_priority: no
    minwidth: 300
    maxwidth: 500
    enforce_ratio: no
    sources: albumart amazon wikipedia coverart itunes #google
embedart:
    auto: yes
    maxwidth: 300
thumbnails:
    auto: yes
lyrics:
    auto: yes
    fallback: 'No lyrics found.'
    sources: musixmatch lyricwiki lyrics.com genius #google
replaygain:
    auto: yes
    backend: gstreamer
    overwrite: no
wlg:
    auto: yes
    force: yes
    count: 3
mpdstats:
    rating_mix: 0.75
ui:
    color: yes
musicbrainz:
    searchlimit: 5
match:
    strong_rec_thresh: 0.04
    medium_rec_thresh: 0.25
    rec_gap_thresh: 0.25
    max_rec:
        missing_tracks: medium
        unmatched_tracks: medium
    preferred:
        countries: ['US', 'GB|UK', 'AU', 'AR', 'ES']
zero:
    fields: genre
    update_database: true
importfeeds:
    formats: m3u_multi
    dir: /net/nfs4/server/mediacentre/Music/Playlists/
    relative_to: /net/nfs4/server/mediacentre/Music/Library_test/
smartplaylist:
    relative_to: /net/nfs4/server/mediacentre/Music/Library_test/
    playlist_dir: /net/nfs4/server/mediacentre/Music/Playlists/
    playlists:
        - name: 'loved_beets.m3u'
          query: 'loved:1'
types:
    loved: int
    play_count: int
bug

All 5 comments

Thanks! This does look like a bug.

One of the people who has worked on the mpdstats plugin, such as @kljohann or @zacharydenton, would you mind taking a look at this?

I ran into this bug with Beets 1.4.3 on macOS 10.12.5. After poking around, I discovered a fix was merged via #2412 that resolves the spurious play count and skip count.

@sampsyo: Any chance you'd consider issuing a new release containing that fix? As it stands now, the current PyPI release version of this plugin is recording very inaccurate data and thus isn't really usable in its current form.

Yes! Sorry this new release is so late in coming; I plan to push out the new version very soon.

And thanks for the reminder to close this issue!

No worries. Thanks for getting a new release out soon. As the maintainer of Pelican, I know that can sometimes be a time-consuming process! 馃槈

Was this page helpful?
0 / 5 - 0 ratings