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

fix notifications showing thumbnail of last song #537

Merged
merged 1 commit into from
Jan 7, 2022

Conversation

Araxeus
Copy link
Collaborator

@Araxeus Araxeus commented Jan 3, 2022

because of the delay in await getImage() in songInfo.js, if the video sends a pause/play event before getImage() finishes, it will send callbacks with the new songInfo - but with the old songInfo.image + everything that comes after that await in the code

and thats because handleData() function updates some of the songInfo, then tries to download the image which takes a few miliseconds. so if the callbacks from playPause are triggered meanwhile, it will have new data from before the await getImage() but not the rest since it wasn't updated yet.

I hope this explanation was clear enough. if not then I can try explaining more clearly

@Araxeus Araxeus force-pushed the fix-song-info-bugs branch from 2b06f50 to 5a18424 Compare January 3, 2022 15:46
@Araxeus
Copy link
Collaborator Author

Araxeus commented Jan 3, 2022

On another note, this commit 4d4ac56 breaks stuff for me for some reason
image

deleting the NODE_OPTIONS= part in package.json fixes this (which I had to do to test this PR, tho I didn't commit that change here yet)

fix notifications showing thumbnail of last song
@Araxeus Araxeus force-pushed the fix-song-info-bugs branch from 81ef270 to 98f990f Compare January 4, 2022 17:40
Copy link
Owner

@th-ch th-ch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for the improvement! ✅
For the NODE_OPTIONS= bug, it seems it only works on Unix systems, I'll give it a look!

@th-ch th-ch merged commit 7f3a554 into th-ch:master Jan 7, 2022
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

Successfully merging this pull request may close these issues.

2 participants