Skip Menu |

This queue is for tickets about the Audio-MPD CPAN distribution.

Report information
The Basics
Id: 31051
Status: resolved
Priority: 0/
Queue: Audio-MPD

People
Owner: Nobody in particular
Requestors: jan [...] guposa.de
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.18.1
Fixed in: (no value)



Subject: songid doesn't get reset when clearing the playlist
Hi, when I start mpd, add 5 songs and running the attached script, the IDs are from 0-4. When I clear the playlist, add 5 new songs and running the script again, the first ID is 5. When I restart mpd, the first ID is 0 again. I'm using: Audio-MPD-0.18.3 perl v5.8.8 built for x86_64-linux-thread-multi
Subject: mpd-plids.pl
#!/usr/bin/perl use strict; use warnings; use Audio::MPD; my $mpd = Audio::MPD->new('127.0.0.1'); foreach ($mpd->playlist->as_items()) { print $_->id, "\n"; }
well, that's the way mpd works... don't mix up id and pos: - id is incremented by mpd every time it inserts a song. - pos reflects the actual position of the song in the playlist. that's why there are 2 methods song() and songid(): song is working with position, while songid works on ids. and when mpd restarts, its internal counter is resetted - which explains the behaviour you're seeing. so, it's not an audio::mpd bug (not even a mpd bug) ==> rejecting it. do you agree?
From: jan [...] guposa.de
I agree. Sorry for wasting your time.
not a problem. thanks for your interest in audio::mpd.