Re: Listenbrainz: no permanent storage of items

"Fran Burstall (Gmail)" <[email protected]> Sun, 23 Nov 2025 22:36:07 +0000
Newsgroups gmane.emacs.emms.user
Message-ID <CADxS8iifsycNXnky2qYLnpSPi6O6T9knBTSTbT_VXZH5zF-bLQ@mail.gmail.com>
--000000000000f8c12806444aacdf
Content-Type: text/plain; charset="UTF-8"

>
>  (why is this necessary?)


The api places these restrictions on the submission (at least, I think it
does---cannot find a reference right now).

Now we know how things are failing, let us try to understand why.

1.  While a track is playing, what is the value of emms-playing-time?
2. What does (emms-track-get (emms-playlist-current-selected-track)
'info-playing-time) return?

I am going off the air now but will get back on this tomorrow in about 20
hours.

---Fran



On Sun, 23 Nov 2025 at 22:13, Igor Sosa Mayor <[email protected]>
wrote:

> I think I found the problem (or the source of the problem...). I made a
> simplified version of your code:
>
> (defun emms-listenbrainz-scrobbler-stop-hook ()
>    "Submit the track to listenbrainz if we have listened long enough.
>
> That is, if it has been played for 240 seconds or half the length of the
> track."
>    (let ((current-track (emms-playlist-current-selected-track)))
>      (emms-listenbrainz-scrobbler-make-async-submission-call
>            current-track)))
>
> Removing the code about the length (why is this necessary?) and now it
> is working. But still I do not understand why this is happening. Maybe
> because of this?
>
>        (when (and track-length
>                  ;; only submit files
>                  (eq (emms-track-type current-track) 'file))
>
> --- Igor
>
>
> On 11/23/25 23:04, Fran Burstall (Gmail) wrote:
> > I wonder if there is something else in the finished hook that fails
> > ahead the call to the scrobbler?  What is the value of emms-player-
> > finished-hook?
> >
> > However, that would not explain the empty failed process buffers: does
> > one of these appear after every scrobble attempt?
> >
> > To see if it is the hook that fails, execute
> >
> > (emms-listenbrainz-scrobbler-make-async-submission-call (emms-playlist-
> > current-selected-track))
> >
> > and see if that records a scrobble.  For me, it does most of the time
> > but, during testing today, it has failed 4 times leaving a failed
> > process buffer.
> >
> > ---Fran
> >
> >
> >
> > On Sun, 23 Nov 2025 at 21:37, Igor Sosa Mayor
> > <[email protected] <mailto:[email protected]>> wrote:
> >
> >
> >      > and let me know what appears in the message buffer when you try
> >     to scrobble.
> >
> >     Exactly the same.
> >
> >     I have the impression the finished-hook is not called...
> >
> >     In the buffer URl-Debug I get the following (token removed
> obviously),
> >     but only after starting the track.
> >
> >     https://paste.rs/8Vl5n.txt <https://paste.rs/8Vl5n.txt>
> >
> >     After finishing there are no new messages logged.
> >
> >     But why should a hook not be triggered?
> >
> >     Thanks again.
> >
> >     --- Igor
> >
>
>

--000000000000f8c12806444aacdf
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><blockquote style=3D"margin:0px 0px 0px 0.8ex;border-left:=
1px solid rgb(204,204,204);padding-left:1ex" class=3D"gmail_quote">=C2=A0(w=
hy is this necessary?)=C2=A0</blockquote><div><br></div><div class=3D"gmail=
_default" style=3D"font-family:arial,helvetica,sans-serif">The api places t=
hese restrictions on the submission (at least, I think it does---cannot fin=
d a reference right now).</div><div class=3D"gmail_default" style=3D"font-f=
amily:arial,helvetica,sans-serif"><br></div><div class=3D"gmail_default" st=
yle=3D"font-family:arial,helvetica,sans-serif">Now we know how things are f=
ailing, let us try to understand why.</div><div class=3D"gmail_default" sty=
le=3D"font-family:arial,helvetica,sans-serif"><br></div><div class=3D"gmail=
_default" style=3D"font-family:arial,helvetica,sans-serif">1.=C2=A0 While a=
 track is playing, what is the value of emms-playing-time?</div><div class=
=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif">2. What=
 does (emms-track-get (emms-playlist-current-selected-track) &#39;info-play=
ing-time) return?</div><div class=3D"gmail_default" style=3D"font-family:ar=
ial,helvetica,sans-serif"><br></div><div class=3D"gmail_default" style=3D"f=
ont-family:arial,helvetica,sans-serif">I am going off the air now but will =
get back on this tomorrow in about 20 hours.</div><div class=3D"gmail_defau=
lt" style=3D"font-family:arial,helvetica,sans-serif"><br></div><div class=
=3D"gmail_default" style=3D"font-family:arial,helvetica,sans-serif">---Fran=
</div><div class=3D"gmail_default" style=3D"font-family:arial,helvetica,san=
s-serif"><br></div><div class=3D"gmail_default" style=3D"font-family:arial,=
helvetica,sans-serif"><br></div></div><br><div class=3D"gmail_quote gmail_q=
uote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Sun, 23 Nov 2025 a=
t 22:13, Igor Sosa Mayor &lt;<a href=3D"mailto:[email protected]">=
[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gma=
il_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,2=
04,204);padding-left:1ex">I think I found the problem (or the source of the=
 problem...). I made a <br>
simplified version of your code:<br>
<br>
(defun emms-listenbrainz-scrobbler-stop-hook ()<br>
=C2=A0 =C2=A0&quot;Submit the track to listenbrainz if we have listened lon=
g enough.<br>
<br>
That is, if it has been played for 240 seconds or half the length of the <b=
r>
track.&quot;<br>
=C2=A0 =C2=A0(let ((current-track (emms-playlist-current-selected-track)))<=
br>
=C2=A0 =C2=A0 =C2=A0(emms-listenbrainz-scrobbler-make-async-submission-call=
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0current-track)))<br>
<br>
Removing the code about the length (why is this necessary?) and now it <br>
is working. But still I do not understand why this is happening. Maybe <br>
because of this?<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0(when (and track-length<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; only submi=
t files<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(eq (emms-tra=
ck-type current-track) &#39;file))<br>
<br>
--- Igor<br>
<br>
<br>
On 11/23/25 23:04, Fran Burstall (Gmail) wrote:<br>
&gt; I wonder if there is something else in the finished hook that fails <b=
r>
&gt; ahead the call to the scrobbler?=C2=A0 What is the value of=C2=A0emms-=
player- <br>
&gt; finished-hook?<br>
&gt; <br>
&gt; However, that would not explain the empty failed process buffers: does=
 <br>
&gt; one of these appear after every scrobble attempt?<br>
&gt; <br>
&gt; To see if it is the hook that fails, execute<br>
&gt; <br>
&gt; (emms-listenbrainz-scrobbler-make-async-submission-call=C2=A0(emms-pla=
ylist- <br>
&gt; current-selected-track))<br>
&gt; <br>
&gt; and see if that records a scrobble.=C2=A0 For me, it does most of the =
time <br>
&gt; but, during testing today, it has failed 4 times leaving a failed <br>
&gt; process buffer.<br>
&gt; <br>
&gt; ---Fran<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; On Sun, 23 Nov 2025 at 21:37, Igor Sosa Mayor <br>
&gt; &lt;<a href=3D"mailto:[email protected]" target=3D"_blank">jo=
[email protected]</a> &lt;mailto:<a href=3D"mailto:joseleopoldo1792@=
gmail.com" target=3D"_blank">[email protected]</a>&gt;&gt; wrote:<=
br>
&gt; <br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0 &gt; and let me know what appears in the message b=
uffer when you try<br>
&gt;=C2=A0 =C2=A0 =C2=A0to scrobble.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0Exactly the same.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0I have the impression the finished-hook is not call=
ed...<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0In the buffer URl-Debug I get the following (token =
removed obviously),<br>
&gt;=C2=A0 =C2=A0 =C2=A0but only after starting the track.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0<a href=3D"https://paste.rs/8Vl5n.txt" rel=3D"noref=
errer" target=3D"_blank">https://paste.rs/8Vl5n.txt</a> &lt;<a href=3D"http=
s://paste.rs/8Vl5n.txt" rel=3D"noreferrer" target=3D"_blank">https://paste.=
rs/8Vl5n.txt</a>&gt;<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0After finishing there are no new messages logged.<b=
r>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0But why should a hook not be triggered?<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0Thanks again.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 =C2=A0--- Igor<br>
&gt; <br>
<br>
</blockquote></div>

--000000000000f8c12806444aacdf--