th-ch / youtube-music

YouTube Music Desktop App bundled with custom plugins (and built-in ad blocker / downloader)
https://th-ch.github.io/youtube-music/
MIT License
8.27k stars 485 forks source link

[Bug]: Song controls are not all functionning as expected #2461

Open KlaimGames opened 5 days ago

KlaimGames commented 5 days ago

Preflight Checklist

YouTube Music (Application) Version

3.5.3.0

Checklists

What operating system are you using?

Windows

Operating System Version

Microsoft Windows 11 Home Version 10.0.22621 Build 22621

What CPU architecture are you using?

x64

Last Known Working YouTube Music (Application) version

No response

Reproduction steps

Note : this is one example of the issues, there are multiple issues that are reproducible the same way

Reach the url : youtubemusic://goBack

click on the 'open link' prompt

or run the command in a command line : start youtubemusic://goBack

Expected Behavior

(url) youtubemusic://goBack?value=10 -> would expect it to go back 10 seconds

youtubemusic://goForward?value=10 -> would expect it to go ahead 10 seconds

youtubemusic://search?value=someSearch -> would expect it search for the song 'someSearch'

youtubemusic://requestQueueInformation-> Should return a json formatted information of the queue

(command) start youtubemusic://goBack --value=10 -> would expect it to go back 10 seconds

start youtubemusic://goForward --value=10 -> would expect it to go ahead10 seconds

start youtubemusic://search --value=someSearch -> would expect it to search for the song 'someSearch'

start youtubemusic://requestQueueInformation-> Should return a json formated information of the queue

Actual Behavior

First , these different functionalities should probably be documented

The commands from the song-controls ( src/providers/song-controls.ts ) do not all work as expected and there is seemingly no proper documentation as to how they are to be used.

I've found 2 ways to call those :

Via URL :

youtubemusic://playPause -> correctly toggles play or pause state

youtubemusic://goBack -> Makes the song reset to time = 0, where you would expect it to do nothing because no goback amount has been given

youtubemusic://goForward -> Does not seem to work in any way in tried it. I do not know the proper format of parameters it should be called with, since it does not seem to be documented

youtubemusic://setVolume ->Does not seem to work in any way in tried it. I do not know the proper format of parameters it should be called with, since it does not seem to be documented

youtubemusic://search -> The search has no input param from my understanding of the code, which functionally does nothing

youtubemusic://requestQueueInformation-> There is no documented way to retrieve the information that would be expected to be returned here

Via command :

Practically the same comments as above, lacking documentation for their usage or seemingly non functional

start youtubemusic://goBack --10 -> would expect it to go back 10 seconds, just resets to begin

start youtubemusic://goForward --10 -> would expect it to go ahead10 seconds, but does nothing

start youtubemusic://requestQueueInformation-> There is no documented way to retrieve the information that would be expected to be returned here

Enabled plugins

Additional Information

I've been exploring some form of implementation that could be done quickly. I have seen the rest API PR, but i wanted a very simple and basic control, and this seemed to be roughly what i need but, it lacks documentation and seemingly does not work in a general fashion.

ArjixWasTaken commented 4 days ago

They are functioning as expected. You just have different expectations :p

But yeah we should document them

ArjixWasTaken commented 4 days ago

Your via command suggestions are impossible and nonsensical.

First of, it is a url protocol, not a cli tool. You can't pass parameters using --time=10 or --time 10.

Even if we wanted to do that, we can't... It has to be part of the url.

(unless a separate terminal interface is made independent of the uri protocol)

Secondly, these controls are made to be used as shortcuts by other programs, their intended usage was not to replace the need for a terminal interface (e.g. cli)

ArjixWasTaken commented 4 days ago

The way the url protocol is implemented, to pass a parameter you have to just separate it using a url encoded space.

e.g.

youtubemusic://goForward%2015

Will go forward 15 seconds.

https://github.com/th-ch/youtube-music/blob/master/src%2Findex.ts#L702-L704

--

%20 is a url encoded space (`) So in reality it isyoutubemusic://goForward 15` but url encoded.

KlaimGames commented 4 days ago

Understood on the cli part. I was trying to find --any-- way to make it work. really.

But if you say that they do function as expected, I would like to know more, because i have not been able to make it work, hence the request for doc.

How should i make the call for for the go forward or backward by X seconds, as the code implies is possible, and can the search call be actually used for any search, and how so ( including playing a found search result, ideally ) ?

Because as of now, i still dont understand how to do any of those things, and I have not found any explanation on how to proceed

ArjixWasTaken commented 4 days ago

Edited my message before I saw urs. The answer is in my edited message.

ArjixWasTaken commented 4 days ago

Personally I believe having the params be in a url query would make more sense.

But that is sadly not the way it was implemented.

KlaimGames commented 4 days ago

Ah yes, our messages were at roughly the same time, apologies.

It seems that the

youtubemusic://goBack%2015

(and to note, start youtubemusic://goBack%2015 via command line --does-- work too )

Does work, but not the goForward :

youtubemusic://goBack%2015

I DO see the play/pause button in the player briefly flash, so it seems like it may have been interacted with, but no time change has been made.

Do you happen to know if it would be possible to search & play songs ? Or is that beyond the scope of this ?

ArjixWasTaken commented 4 days ago

As I said, this is just for shortcuts to be used in other apps.

The search shortcut interacts with the search bar, it doesn't actually do a search.

There is no way to achieve what you want :( Although this could be done in the future