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(Youtube Music): timestamp fix #8369

Merged
merged 10 commits into from
May 16, 2024
Merged

fix(Youtube Music): timestamp fix #8369

merged 10 commits into from
May 16, 2024

Conversation

ION606
Copy link
Contributor

@ION606 ION606 commented May 11, 2024

Description

  • Fixed the issue where the start timestamp would malfunction when changing from use time left mode.

This issue was caused due to the getTimestamps function, which for SOME REASON completely ignores the first parameter in favor of using Date.now()

possibly resolves #8131

Acknowledgements

Screenshots

image

image

Proof showing the creation/modification is working as expected

@veryCrunchy
Copy link
Member

Fixed in alpha/beta

@ION606
Copy link
Contributor Author

ION606 commented May 11, 2024

this PR deals with when the timestamp is updated (i.e. on seek), check the code on the first commit pls

@veryCrunchy
Copy link
Member

Please try the alpha/beta, this doesn't seem to be an actual issue

@veryCrunchy
Copy link
Member

I think you're better off removing the useTimeLeft toggle fully.
You're introducing more bugs for elapsed right now than that you are fixing.
Having the time left is the preferred behaviour anyway.

@ION606
Copy link
Contributor Author

ION606 commented May 12, 2024

I suppose, but also, check this pull and the corresponding issue #8324

@ION606
Copy link
Contributor Author

ION606 commented May 12, 2024

odd, I thought I removed that part, my fix was the toggle and the additional call on seek

image

Co-authored-by: veryCrunchy <[email protected]>
Signed-off-by: ION606 <[email protected]>
@veryCrunchy
Copy link
Member

veryCrunchy commented May 12, 2024

If you want to have the actual elapsed time of the song you'll have to calculate the songs timestamps.
The Date.now() isn't doing much now.
Also please remove and don't set the event listeners if privacy mode is enabled.
And move all updateSongTimestamps calls behind the privacy mode statement.

@ION606
Copy link
Contributor Author

ION606 commented May 12, 2024

If you want to have the actual elapsed time of the song you'll have to calculate the songs timestamps. The Date.now() isn't doing much now. Also please remove and don't set the event listeners if privacy mode is enabled. And move all updateSongTimestamps calls behind the privacy mode statement.

wait where do I set event listeners, like

if (useTimeLeftChanged !== useTimeLeft && !privacyMode) {
		useTimeLeftChanged = useTimeLeft;
		updateSongTimestamps(useTimeLeft);
	}

websites/Y/YouTube Music/presence.ts Outdated Show resolved Hide resolved
@ION606 ION606 requested a review from veryCrunchy May 16, 2024 00:09
websites/Y/YouTube Music/presence.ts Outdated Show resolved Hide resolved
ION606 and others added 2 commits May 15, 2024 17:30
I was reusing it but decided that wouldn't really work

Co-authored-by: veryCrunchy <[email protected]>
Signed-off-by: ION606 <[email protected]>
@veryCrunchy
Copy link
Member

Is useTimeLeftChanged really necessary?

@ION606
Copy link
Contributor Author

ION606 commented May 16, 2024

Is useTimeLeftChanged really necessary?

yes, it helps avoid redundant calls

@veryCrunchy
Copy link
Member

Looks good then
@theusaf (I can't request reviews ;-;)

@Bas950 Bas950 requested a review from theusaf May 16, 2024 07:15
@Bas950 Bas950 enabled auto-merge (squash) May 16, 2024 07:16
@Bas950 Bas950 merged commit 6cf90db into PreMiD:main May 16, 2024
3 checks passed
@ION606 ION606 deleted the youtubemusic branch May 16, 2024 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

YouTube Music | music.youtube.com - Correct Timestamps after resuming playback
4 participants