feat: Last.fm scrobbling and Now Playing integration#2563
Open
fiveclankers wants to merge 8 commits into
Open
Conversation
Implements the buildLastFmSignature function to create the api_sig parameter for Last.fm API calls.
This interface defines methods for authenticating users and notifying Last.fm of track playback. It includes methods for mobile session authentication, updating the currently playing track, and scrobbling tracks.
…laying This class manages Last.fm authentication, session key storage, and scrobbling operations. It includes methods for logging in, logging out, updating now playing, and scrobbling tracks.
…sitory Added Last.fm session management functions and flows.
…Transition Added notifyLastFmNowPlaying function to handle media item updates.
…Model Added LastFmRepository integration for Last.fm authentication and account management.
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.
adds Last.fm scrobbling + now playing to PixelPlayer
files changed:
LastFmModels.kt— data classes for the Last.fm API responses (auth, scrobble, now-playing)LastFmApiService.kt— Retrofit interface, coversauth.getMobileSession,track.updateNowPlaying,track.scrobbleLastFmAuthHelper.kt— MD5 signature generation (required by Last.fm's API signing spec)LastFmRepository.kt/LastFmRepositoryImpl.kt— handles login/logout, now playing updates and scrobbling, session persisted via DataStoreAppModule.kt— Hilt providers for the Last.fm retrofit instance, service, and repoUserPreferencesRepository.kt— addedlastfm_session_key,lastfm_username,lastfm_scrobbling_enabledkeys with get/set/clearDualPlayerEngine.kt—onLastFmTrackStarted()starts the scrobble timer (fires at min(50% of track duration, 4 min), never before 30s — following Last.fm's rules) and calls updateNowPlayingMusicService.kt— callsengine.onLastFmTrackStarted()fromonMediaItemTransitionvianotifyLastFmNowPlaying()AccountsViewModel.kt— addedLAST_FMto theExternalServiceAccountenum, wired up login/logout/result consumptionAPI calls are all signed with MD5 per the Last.fm docs: https://www.last.fm/api
not in this PR (coming next):