Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mpdstats: using playlist to get current song may be a performance issue #2752

Closed
ray66 opened this issue Dec 5, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@ray66
Copy link
Contributor

commented Dec 5, 2017

Problem

MPDStats fails to update stats for all songs on a low performance system when a large playlist is active. In this case, getting the playlist in on_play may take longer than the current song is playing and stats are not updated for the next song because status['songid'] is still pointing to the previous song when the playlist is finally received.

The playlist is just used to get the url of the current song. It would be more efficient do this with the currentsong command which is faster and does create less load on the server.

Setup

  • HW: Raspberry Pi B+
  • OS: Raspbian Stretch
  • Python version: 2.7.13
  • beets version: 1.4.5
  • Turning off plugins made problem go away (yes/no): n/a

My configuration (output of beet config) is:

mpd:
    host: 127.0.0.1
    port: 6600
    rating: yes
    rating_mix: 0.75
    music_directory: /media/Medien/Musik
    password: REDACTED
smartplaylist:
    auto: no
    relative_to: /media/Medien/Musik/
    playlist_dir: /var/lib/mpd/playlists
    playlists: [{name: rating.m3u, query: 'rating:0.4..1.0'}, {name: not_played.m3u, query: '-play_count: artist:'}, {name: dylan.m3u, query: 'artist:Dylan'}]
mpdstats:
    host: 127.0.0.1
    port: 6600
    music_directory: /media/Medien/Musik
    rating: yes
    rating_mix: 0.75
library: ~/beets/musiclibrary.db

plugins: mpdstats smartplaylist lastgenre random
directory: /media/Medien/Musik/

import:
    copy: no
    write: no

@sampsyo sampsyo added the feature label Dec 5, 2017

@sampsyo

This comment has been minimized.

Copy link
Member

commented Dec 5, 2017

Good point! If a currentsong command will work, let's try switching to that. Would you be willing to try making a PR and testing out the change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.