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

vuiet-info-playing-track-album works once #73

Open
kpanic opened this issue Dec 26, 2023 · 19 comments
Open

vuiet-info-playing-track-album works once #73

kpanic opened this issue Dec 26, 2023 · 19 comments

Comments

@kpanic
Copy link

kpanic commented Dec 26, 2023

Hello @mihaiolteanu 👋🏾
First of all thank you for this wonderful program, I am really enjoying it!

if I invoke vuiet-info-playing-track-album to see the current playing track vuiet initially opens the correct buffer.
After another track is played, I see in the *Messages* buffer these error messages:

error in process filter: s-split: Wrong type argument: stringp, nil
error in process filter: Wrong type argument: stringp, nil

And if I re-invoke vuiet-info-playing-track-album it brings me to the previous track. Always that one.

I installed the package via MELPA, should I point to the git version?

Thanks in advance!

@kpanic
Copy link
Author

kpanic commented Dec 26, 2023

I am also getting

[error] request--callback: peculiar error: 400
[error] request-default-error-callback: http://ws.audioscrobbler.com/2.0/ error
Error running timer ‘vuiet--scrobble-track’: (wrong-type-argument stringp t)

I am not sure if this is relevant.

@mihaiolteanu
Copy link
Owner

Hello Marco,

Does it happen on all albums or on a specific one?

@kpanic
Copy link
Author

kpanic commented Dec 27, 2023

not 100% sure, but It looks like it's happening on all the albums

@mihaiolteanu
Copy link
Owner

mihaiolteanu commented Dec 31, 2023

I do get a similar error for scrobbling, regardless of how I play the song,

[error] request--callback: peculiar error: 403
[error] request-default-error-callback: http://ws.audioscrobbler.com/2.0/ error
Error running timer ‘vuiet--scrobble-track’: (wrong-type-argument stringp t)

Scrobbling is just the process of saving what you've listened to last.fm (for history purposes). It does not affect the player, though.
The data sent to last.fm seems correct from my local debugging.
I did get issues in the past with scrobbling from last.fm.

Just to be sure we're not confusing things, the vuiet-info-playing-track-album command opens a buffer displaying the album of the currently playing song. It's purpose is to choose another song from the album, if you so wish. Nothing more, nothing less. Maybe you are looking for vuiet-play-album command, instead, to play all the songs from a given album?

@kpanic
Copy link
Author

kpanic commented Jan 1, 2024

Hello and happy new year @mihaiolteanu ! 🎉
Yup, vuiet-info-playing-track-album opens a buffer with the song that is played, however if the song changes and I redo vuiet-info-playing-track-album that buffer of the song playing does not change. The same, as far as I remember happens when checking the playing album. So the buffer looks like it's not refreshed when the song change.

A more significant "scenario" can be:

  • vuiet-play-loved-tracks
  • vuiet-playing-artist-info to get info about the artist that is playing
  • Wait for the song to finish
  • Redo vuiet-playing-artist-info during the next song
  • The buffer about artist information is not updated

Hope that clears it up.

Thanks!

@mihaiolteanu
Copy link
Owner

Hello Marco,

Unfortunately I cannot reproduce this issue. Both vuiet-info-playing-track-album and vuiet-playing-artist-info open up buffers with the correct info for me, both when I let the song finish or when I skip the song with vuiet-next.

Does (vuiet--playing-track) return the correct info for you? That is, the currently playing track?

Mihai

@kpanic
Copy link
Author

kpanic commented Jan 1, 2024

@mihaiolteanu it does for a short time.
i.e.

  • play a song
  • vuiet-next
  • (vuiet--playing-track) it shows the track name
  • vuiet-next
  • (vuiet--playing-track) It show the track name
  • vuiet-next

And after this error occurs:

error in process filter: s-split: Wrong type argument: stringp, nil
error in process filter: Wrong type argument: stringp, nil

and then (vuiet--playing-track) returns not correct information.

@kpanic
Copy link
Author

kpanic commented Jan 1, 2024

And then, sometimes. (vuiet--playing-track) It prints again correctly the track. Can I enable some backtrace thing? It might help to diagnose the issue?

Thanks a lot man for the support

@mihaiolteanu
Copy link
Owner

mihaiolteanu commented Jan 1, 2024

Do copy/paste the return info from (vuiet--playing-track) (maybe we're getting some special characters from last.fm that vuiet doesn't know how to parse?!).

Yes, you could use edebug (you eval the function with C-u C-M-x to enable debugging, C-x C-e to disable it) on vuiet--play and see if it sets the track correctly.
Or you could check the vuiet-info-playing-track-album function with edebug and check if all the parameters are set correctly.

Edit: updated the command to enable debugging on a particular function

@kpanic
Copy link
Author

kpanic commented Jan 1, 2024

I was able to obtain

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  edebug(error (wrong-type-argument stringp nil))
  split-string(nil "=" nil)
  s-split("=" nil)
  vuiet--track-from-youtube-url(nil)
  vuiet--mpv-playing-track()
  #f(compiled-function (event) #<bytecode 0xc3c6b15c7b6d574>)(((event . "file-loaded")))
  run-hook-with-args(#f(compiled-function (event) #<bytecode 0xc3c6b15c7b6d574>) ((event . "file-loaded")))
  mpv--tq-process-buffer((nil #<process mpv-socket> . #<buffer  tq-temp-mpv-socket>))
  mpv--tq-process-buffer((nil #<process mpv-socket> . #<buffer  tq-temp-mpv-socket>))
  mpv--tq-filter((nil #<process mpv-socket> . #<buffer  tq-temp-mpv-socket>) "{\"event\":\"audio-reconfig\"}\n{\"event\":\"file-loaded\"}...")
  #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_25>(#<process mpv-socket> "{\"event\":\"audio-reconfig\"}\n{\"event\":\"file-loaded\"}...")
  edebug--recursive-edit(before)
  edebug--display-1(nil 0 before)
  edebug--display(nil 0 before)
  edebug-debugger(0 before nil)
  edebug-before(0)
  (edebug-after (edebug-before 0) 1 (vuiet-info-playing-track-album))
  (closure (t) nil (edebug-after (edebug-before 0) 1 (vuiet-info-playing-track-album)))()
  edebug-default-enter(edebug-anon14 nil (closure (t) nil (edebug-after (edebug-before 0) 1 (vuiet-info-playing-track-album))))
  edebug-default-enter(edebug-anon14 nil (closure (t) nil (edebug-after (edebug-before 0) 1 (vuiet-info-playing-track-album))))
  edebug-enter(edebug-anon14 nil (closure (t) nil (edebug-after (edebug-before 0) 1 (vuiet-info-playing-track-album))))
  (progn (edebug-enter 'edebug-anon14 nil #'(lambda nil (edebug-after (edebug-before 0) 1 (vuiet-info-playing-track-album)))))
  (let ((print-level nil) (print-length nil)) (progn (edebug-enter 'edebug-anon14 nil #'(lambda nil (edebug-after (edebug-before 0) 1 (vuiet-info-playing-track-album))))))
  (setq elisp--eval-defun-result (let ((print-level nil) (print-length nil)) (progn (edebug-enter 'edebug-anon14 nil #'(lambda nil (edebug-after (edebug-before 0) 1 (vuiet-info-playing-track-album)))))))
  elisp--eval-defun()
  #<subr eval-defun>(nil)
  edebug--eval-defun(#<subr eval-defun> (4))
  apply(edebug--eval-defun #<subr eval-defun> (4))
  #f(advice edebug--eval-defun :around #<subr eval-defun>)((4))
  ad-Advice-eval-defun(#f(advice edebug--eval-defun :around #<subr eval-defun>) (4))
  apply(ad-Advice-eval-defun #f(advice edebug--eval-defun :around #<subr eval-defun>) (4))
  eval-defun((4))
  funcall-interactively(eval-defun (4))
  command-execute(eval-defun)

while doing C-u C-M-x on vuiet-info-playing-track-album

does it help? 🤔

Edit: this is my mpv version

$ mpv --version
mpv 0.36.0 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
 built on Sun Jul 23 05:49:29 2023
libplacebo version: v5.264.1
FFmpeg version: n6.1
FFmpeg library versions:
   libavutil       58.2.100 (runtime 58.29.100)
   libavcodec      60.3.100 (runtime 60.31.102)
   libavformat     60.3.100 (runtime 60.16.100)
   libswscale      7.1.100 (runtime 7.5.100)
   libavfilter     9.3.100 (runtime 9.12.100)
   libswresample   4.10.100 (runtime 4.12.100)

@kpanic
Copy link
Author

kpanic commented Jan 1, 2024

Oh, one other note.
I am using

(setq vuiet-youtube-dl-command "yt-dlp")`

as a vuiet-youtube-dl-command. I am wondering if it might make a difference..

@mihaiolteanu
Copy link
Owner

mihaiolteanu commented Jan 2, 2024

Yes, I've officially switched to yt-dlp too with the latest commit.

Ok, either mpv integration issue or the track is not added to the list properly,

Can you eval (that is, C-x C-e) these in a scratch buffer, or directly in the vuiet.el buffer,

(mpv-get-property "filename") 

(this should return the youtube watch id, like "watch?v=gOU_zWdhAoE"

and

(vuiet--track-from-youtube-url
   (mpv-get-property "filename"))

(this should return the name of the song for that id, saved previously by vuiet)

@kpanic
Copy link
Author

kpanic commented Jan 2, 2024

This is the return value of (mpv-get-property "filename")
"watch?v=PTAacByc5wA"

and

(vuiet--track-from-youtube-url
   (mpv-get-property "filename"))
#s(vuiet-track "Tiromancino" "Come l'aria" "4:47")

Maybe it's the apostrophe? ' 🤔

If you have other debugging hints please share. I would be glad to help.

@mihaiolteanu
Copy link
Owner

The edebug output from above says the vuiet--track-from-youtube-url receives a nil argument, though (mpv-get-property "filename") doesn't return a nil argument, but a proper track.

Well...

@kpanic
Copy link
Author

kpanic commented Jan 2, 2024

I can live with it, but yes, it's weird 🤷🏾‍♂️
Thanks again for all the support 🙇🏾

@kpanic
Copy link
Author

kpanic commented Jan 5, 2024

Hey there, I was able to collect a little bit more info:

I did:

  1. vuiet-play-track-search and searched for Abitudine by Subsonica
  2. I put edebug on (vuiet-info-playing-track-album) and I had the same nil backtrace.
  3. I did vuiet--playing-track and it was nil.
  4. I did vuiet-info-playing-track-album and it was nil. Usually I get at least one successful lookup for the album but in this case it does not work.

PS: Hope you like the song!

@mihaiolteanu
Copy link
Owner

Nice, but I don't get the same results...

(vuiet--playing-track)
#s(vuiet-track "Subsonica" "Abitudine" "3:26")
(vuiet-info-playing-track-album)

Jan05-110303

The plot thickens, then... :))

@kpanic
Copy link
Author

kpanic commented Jan 5, 2024

eheh. ;)

By the way, what mpv version do you have?

@mihaiolteanu
Copy link
Owner

mpv 0.36.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants