MusicPlayerDaemon / MPD

Music Player Daemon
https://www.musicpd.org/
GNU General Public License v2.0
2.18k stars 351 forks source link

Wrong CUE metadata when added by `addid` command #1123

Closed imi415 closed 3 years ago

imi415 commented 3 years ago

Bug report

Describe the bug

This issue has exactly the same behavior as #1070 , request re-open here.

Expected Behavior

Metadata correctly displayed like

$ mpc -h ~/.mpd.socket        
YELL - 彼女がフラグを立てる理由
[playing] #2/2   0:51/3:50 (22%)
volume:100%   repeat: on    random: off   single: off   consume: off

Actual Behavior

Metadata not displayed correctly if added by 3rdparty client using addid command

$ mpc -h ~/.mpd.socket
<CUE_FILE_PATH_IN_LIBRARY>.cue/track0001
[playing] #1/1   0:04/3:50 (1%)
volume:100%   repeat: on    random: off   single: off   consume: off

Version

Music Player Daemon 0.22.6 (0.22.6)
Copyright 2003-2007 Warren Dukes <warren.dukes@gmail.com>
Copyright 2008-2018 Max Kellermann <max.kellermann@gmail.com>
This is free software; see the source for copying conditions.  There is NO
warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Database plugins:
 simple proxy upnp

Storage plugins:
 local udisks nfs curl

Neighbor plugins:
 upnp udisks

Decoders plugins:
 [mad] mp3 mp2
 [mpg123] mp3
 [vorbis] ogg oga
 [oggflac] ogg oga
 [flac] flac
 [opus] opus ogg oga
 [sndfile] wav aiff aif au snd paf iff svx sf voc w64 pvf xi htk caf sd2
 [audiofile] wav au aiff aif
 [dsdiff] dff
 [dsf] dsf
 [hybrid_dsd] m4a
 [faad] aac
 [mpcdec] mpc
 [wavpack] wv
 [modplug] 669 amf ams dbm dfm dsm far it med mdl mod mtm mt2 okt s3m stm ult umx xm
 [mikmod] amf dsm far gdm imf it med mod mtm s3m stm stx ult uni xm
 [sidplay] sid mus str prg P00
 [wildmidi] mid
 [fluidsynth] mid
 [ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 adx afc aif aifc aiff al alaw amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv cpk daud dct divx dts dv dvd dxa eac3 film flac flc fli fll flx flv g726 gsm gxf iss m1v m2v m2t m2ts m4a m4b m4v mad mj2 mjpeg mjpg mka mkv mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve mvi mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg opus psp pva qcp qt r3d ra ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tak tgi tgq tgv thp ts tsp tta xa xvid uv uv2 vb vid vob voc vp6 vmd wav webm wma wmv wsaud wsvga wv wve rtp:// rtsp:// rtsps://
 [gme] ay gbs gym hes kss nsf nsfe sap spc vgm vgz
 [pcm]

Filters:
 libsamplerate soxr

Tag plugins:
 id3tag

Output plugins:
 shout null fifo pipe alsa ao oss openal solaris pulse jack httpd recorder

Encoder plugins:
 null vorbis opus lame twolame wave flac

Archive plugins:
 [bz2] bz2
 [zzip] zip
 [iso] iso

Input plugins:
 file io_uring archive alsa tidal qobuz curl ffmpeg nfs mms cdio_paranoia

Playlist plugins:
 extm3u m3u pls xspf asx rss soundcloud flac cue embcue

Protocols:
 file:// alsa:// cdda:// ftp:// ftps:// gopher:// hls+http:// hls+https:// http:// https:// mms:// mmsh:// mmst:// mmsu:// nfs:// qobuz:// rtmp:// rtmpe:// rtmps:// rtmpt:// rtmpte:// rtmpts:// rtp:// rtsp:// rtsps:// scp:// sftp:// smb:// srtp:// tidal://

Other features:
 avahi dbus udisks epoll icu inotify ipv6 systemd tcp un

Log

From 3rdparty client(ncmpcpp) which can reproduce this issue:

mpd[2184420]: client: [5] process command "addid "<CUE_FILE_PATH_IN_LIBRARY>.cue/track0001""
mpd[2184420]: client: [5] command returned 0
mpd[2184420]: client: [5] process command "playid "4""
mpd[2184420]: playlist: play 0:"<CUE_FILE_PATH_IN_LIBRARY>.cue/track0001"
mpd[2184420]: client: [5] command returned 0
mpd[2184420]: playlist: queue song 0:"<CUE_FILE_PATH_IN_LIBRARY>.cue/track0001"
mpd[2184420]: client: [5] process command "idle"
mpd[2184420]: client: [5] command returned 1

From mpc which using add instead of addid:

mpd[2184420]: client: [9] opened from local
mpd[2184420]: client: [9] process command list
mpd[2184420]: client: process command "add "<CUE_FILE_PATH_IN_LIBRARY>.cue/track0001""
mpd[2184420]: playlist: queue song 1:"<CUE_FILE_PATH_IN_LIBRARY>.cue/track0001"
mpd[2184420]: client: command returned 0
mpd[2184420]: client: [9] process command list returned 0
mpd[2184420]: client: [9] closed
MaxKellermann commented 3 years ago

This was fixed by 5355335f190016e2611a2029a982755c0cfa817b (which I didn't know when I wrote this commit)