feat: Apple Music source#636
Draft
Exerra wants to merge 14 commits into
Draft
Conversation
Implement Apple Music source, including configuration types, environment variable handling, and source initialization logic. Refactored SourceType definitions to improve maintainability.
Removed the unused `getBackloggedPlays` method and cleaned up the `getRecentlyDiscoveredPlays` logic in `AppleMusicSource` to streamline track processing.
…ng type Removed local AppleMusicTrack interface and updated formatPlayObj to utilize the shared Song type for improved type consistency.
Refactored AppleMusicSource to use defined types for history consistency, updated the getRecentlyPlayedTracks limit type, and renamed variable for clarity.
Introduced constants for history limits and track polling constraints to improve maintainability and readability within AppleMusicSource.
Cleaned up the type casting in the AppleMusicSource fetch logic by removing unnecessary unknown assertion.
Moved the reduceRight logic for calculating play timestamps into a dedicated private method 'applyCalculatedTimestamps' to improve code readability and maintainability.
Updated comments in applyCalculatedTimestamps to reflect that Apple Music lacks track timestamps, necessitating a hacky estimation method.
Update parseRecentAgainstResponse return type signature to use the HistoryConsistencyResult alias instead of an inline object definition.
Introduced a `headers` configuration option to allow setting custom request headers, such as 'Origin', for Apple Music API requests. Updated configuration schema and source implementation to apply these headers.
Switched node-musickit-api dependency from a local path to version 3.1.0-next.4 from the registry.
✅ Deploy Preview for multi-scrobbler ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Author
|
Okay, Netlify reveals peer dep issues with Typescript for node-musickit-api (ts v6 here, ts v5 for the package). Will have to investigate. edit: Fixed with v3.1.0-next.5 |
Updated node-musickit-api dependency to the latest next version.
Add Apple Music to the sources overview table and the main documentation index.
Bump node-musickit-api to 3.1.0-next.5
Contributor
📦 A new release has been made for this pull request.To play around with this PR, pull an image:
Images are available for x86_64 and ARM64.
|
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.
Checklist before requesting a review
Type of change
Please delete options that are not relevant.
Describe your changes
Adds an Apple Music source.
Authentication methods include:
This is a draft PR while I add more QOL features like re-auth when using a key, etc. Documentation will also need to be updated to reflect both the auth methods as well as the downsides of both.
TODO:
Issue number and link, if applicable
#9