Repository navigation
feat(player): mirror likes onto YouTube Music - #318
Merged
Merged
Conversation
The player's like was local-only: it wrote Liked Songs and mirrored to Last.fm, while the connected YouTube Music account never learned about it. Liking (or unliking) now mirrors through the same authenticated WEB_REMIX channel the playlist writes already use. - InnerTubeMusicApi.likeVideo / removeVideoLike POST the rate endpoints (like/like, like/removelike) with the shared `target.videoId` body; both guards on connection and videoId and return false instead of throwing. - YtMusicLibraryManager.mirrorLikeToYouTube owns the "is there anything to mirror" decision and returns true — explicitly not a failure — with no account or for an imported local file, so those cases never read as errors or toast the user. - PlayerViewModel mirrors after the local write from both entry points (the heart toggle and the double-tap). The local like stays the source of truth: a failed mirror is reported with a toast and left for the next toggle, never used to undo a successful local like. Tests: YtMusicLikeTest pins the rate endpoints and the target payload.
|
@ajisth69 Bhai yaar abhi vi slow as fuck hai page loading |
|
@rx6500M Lol |
The endpoints sat in the class's private companion, which hides them even from same-module tests. Moved to file-level internal consts.
In-flight search/login work: repository, view model, search screen and the YouTube login flow + its view model.
DChitale
pushed a commit
to DChitale/LastWave-Native
that referenced
this pull request
Oct 14, 2026
The guard rethrows CancellationException from the catch block, which never had the import, so :app:compileDebugKotlin failed on main after Clash-Projects#318 merged. One import, no behaviour change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Likes in the player now also land on the connected YouTube Music account.
What
InnerTubeMusicApi.likeVideo/removeVideoLike— POST the rate endpoints (like/like,like/removelike) with the sharedtarget.videoIdbody, through the same authenticated WEB_REMIX channel the playlist writes already use. Both guard on connection + videoId and returnfalseinstead of throwing, matching the other mutation helpers in the file.YtMusicLibraryManager.mirrorLikeToYouTube(track, loved)— owns the "is there anything to mirror?" decision and returnstrue, explicitly not a failure, when there's no account connected or the track has no YouTube videoId (imported local files). Those cases can never toast the user as an error.toggleLiked) and the double-tap (like). Unliking mirrors aslike/removelike, so the YT like state follows the player.The local Like stays the source of truth: the mirror runs after a successful local write, and a failed mirror only toasts ("Couldn't like this song on YouTube Music") — it never undoes a local like.
Tests
YtMusicLikeTestpins the wire contract: the two rate endpoints, thetargetpayload shape (videoId only), and its JSON round-trip.Note
CI is watched to green before merge — last two PRs taught us that.