-
Notifications
You must be signed in to change notification settings - Fork 18
feat: Soundcloud Support #156
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
Open
Lioncat6
wants to merge
28
commits into
kellnerd:main
Choose a base branch
from
Lioncat6:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
12bbba7
start soundcloud
Lioncat6 353a0bb
progress
Lioncat6 01641e1
sc changes
Lioncat6 187d4d1
Sc progres
Lioncat6 99d450d
God I hate deno
Lioncat6 d9c97e7
Finalize soundcloud support
Lioncat6 a4701ca
Added soundcloud icon & color
Lioncat6 bdc0f04
Increase resolution of thumb cover art
Lioncat6 943a02b
Implement most suggestions
Lioncat6 c8ae12d
Add test file
Lioncat6 f339b38
Soundcloud relationship type handling
Lioncat6 df02363
Added souncloud config
Lioncat6 1ac64fa
Fixed deno formatting
Lioncat6 4dd484d
Ran test in download mode and generated snapshot `deno test --allow-n…
Lioncat6 bf0554b
Revert resolution change
Lioncat6 f1684f4
Remove time and timezone from parseSoundcloudTimestamp
Lioncat6 33e8047
Update snapshot
Lioncat6 6aa35c7
Simplified date logic
Lioncat6 a6c1ddc
Fixed unions
Lioncat6 5b604aa
Fix deno formatting
Lioncat6 ee4b8f0
test(SoundCloud): Stub token retrieval
kellnerd 953182f
fix(SoundCloud): Standardize the used entity type names
kellnerd 29ef636
refactor(SoundCloud): Combine URL patterns for supported releases
kellnerd 4c646d5
fix(SoundCloud): Treat artist subpage URLs as artists and not as tracks
kellnerd 6396fb9
refactor(SoundCloud): Dry & Format code
kellnerd 9020d05
refactor(SoundCloud): Make timestamp parser more robust
kellnerd 2c284c8
fix(SoundCloud): Warn about missing tracks
kellnerd 5d2413f
fix(SoundCloud): Preserve credited track artist & Ignore preview lengths
kellnerd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| export const snapshot = {}; | ||
|
|
||
| snapshot[`SoundCloud provider > release lookup > track release with downloads enabled 1`] = ` | ||
| { | ||
| artists: [ | ||
| { | ||
| creditedName: "League of Legends", | ||
| externalIds: [ | ||
| { | ||
| id: "leagueoflegends", | ||
| provider: "soundcloud", | ||
| type: "artist", | ||
| }, | ||
| ], | ||
| name: "League of Legends", | ||
| }, | ||
| ], | ||
| availableIn: undefined, | ||
| externalLinks: [ | ||
| { | ||
| types: [ | ||
| "free streaming", | ||
| "free download", | ||
| ], | ||
| url: "https://soundcloud.com/leagueoflegends/piercing-light-mako-remix", | ||
| }, | ||
| ], | ||
| images: [ | ||
| { | ||
| provider: "SoundCloud", | ||
| thumbUrl: "https://i1.sndcdn.com/artworks-000142912000-f05col-t300x300.jpg", | ||
| types: [ | ||
| "front", | ||
| ], | ||
| url: "https://i1.sndcdn.com/artworks-000142912000-f05col-t500x500.jpg", | ||
| }, | ||
| ], | ||
| info: { | ||
| messages: [], | ||
| providers: [ | ||
| { | ||
| apiUrl: "https://api.soundcloud.com/resolve?url=https%3A%2F%2Fsoundcloud.com%2Fleagueoflegends%2Fpiercing-light-mako-remix", | ||
| id: "leagueoflegends/track/piercing-light-mako-remix", | ||
| internalName: "soundcloud", | ||
| lookup: { | ||
| method: "id", | ||
| value: "leagueoflegends/track/piercing-light-mako-remix", | ||
| }, | ||
| name: "SoundCloud", | ||
| url: "https://soundcloud.com/leagueoflegends/piercing-light-mako-remix", | ||
| }, | ||
| ], | ||
| }, | ||
| labels: undefined, | ||
| media: [ | ||
| { | ||
| format: "Digital Media", | ||
| tracklist: [ | ||
| { | ||
| artists: [ | ||
| { | ||
| creditedName: "League of Legends", | ||
| externalIds: [ | ||
| { | ||
| id: "leagueoflegends", | ||
| provider: "soundcloud", | ||
| type: "artist", | ||
| }, | ||
| ], | ||
| name: "League of Legends", | ||
| }, | ||
| ], | ||
| availableIn: undefined, | ||
| isrc: undefined, | ||
| length: 291422, | ||
| number: 1, | ||
| recording: { | ||
| externalIds: [ | ||
| { | ||
| id: "leagueoflegends/piercing-light-mako-remix", | ||
| provider: "soundcloud", | ||
| type: "track", | ||
| }, | ||
| ], | ||
| }, | ||
| title: "Piercing Light (Mako Remix)", | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| packaging: "None", | ||
| releaseDate: { | ||
| day: 12, | ||
kellnerd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| month: 1, | ||
| year: 2016, | ||
| }, | ||
| title: "Piercing Light (Mako Remix)", | ||
| types: [ | ||
| "Single", | ||
| ], | ||
| } | ||
| `; | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,203 @@ | ||
| // Type definitions from https://github.com/Moebytes/soundcloud.ts | ||
| // Copyright (c) 2020 Moebytes. MIT License. | ||
|
|
||
| export type SoundcloudImageFormats = | ||
| | 't500x500' | ||
| | 'crop' | ||
| | 't300x300' | ||
| | 'large' | ||
| | 't67x67' | ||
| | 'badge' | ||
| | 'small' | ||
| | 'tiny' | ||
| | 'mini'; | ||
|
|
||
| export type SoundcloudLicense = | ||
| | 'no-rights-reserved' | ||
| | 'all-rights-reserved' | ||
| | 'cc-by' | ||
| | 'cc-by-nc' | ||
| | 'cc-by-nd' | ||
| | 'cc-by-sa' | ||
| | 'cc-by-nc-nd' | ||
| | 'cc-by-nc-sa'; | ||
|
|
||
| export type SoundcloudTrackType = | ||
| | 'original' | ||
| | 'remix' | ||
| | 'live' | ||
| | 'recording' | ||
| | 'spoken' | ||
| | 'podcast' | ||
| | 'demo' | ||
| | 'in progress' | ||
| | 'stem' | ||
| | 'loop' | ||
| | 'sound effect' | ||
| | 'sample' | ||
| | 'other'; | ||
|
|
||
| export interface SoundcloudTrack { | ||
| artwork_url: string; | ||
| comment_count: number; | ||
| commentable: boolean; | ||
| created_at: string; | ||
| description: string; | ||
| display_date: string; | ||
| download_count: number; | ||
| downloadable: boolean; | ||
| duration: number; | ||
| embeddable_by: 'all' | 'me' | 'none'; | ||
| full_duration: number; | ||
| genre: string; | ||
| has_downloads_left: boolean; | ||
| id: number; | ||
| kind: 'track'; | ||
| label_name: string; | ||
| last_modified: string; | ||
| license: SoundcloudLicense; | ||
| likes_count: number; | ||
| monetization_model: string; | ||
| permalink: string; | ||
| permalink_url: string; | ||
| playback_count: number; | ||
| policy: string; | ||
| public: boolean; | ||
| purchase_title: string; | ||
| purchase_url: string; | ||
| reposts_count: number; | ||
| secret_token: string; | ||
| sharing: 'private' | 'public'; | ||
| state: 'processing' | 'failed' | 'finished'; | ||
| streamable: boolean; | ||
| tag_list: string; | ||
| title: string; | ||
| uri: string; | ||
| urn: string; | ||
| user: SoundcloudUser; | ||
| user_id: number; | ||
| visuals: string; | ||
| waveform_url: string; | ||
| release: string | null; | ||
| key_signature: string | null; | ||
| isrc: string | null; | ||
| bpm: number | null; | ||
| release_year: number | null; | ||
| release_month: number | null; | ||
| release_day: number | null; | ||
| stream_url: string | null; | ||
| download_url: string | null; | ||
| available_country_codes: string[] | null; | ||
| secret_uri: string | null; | ||
| user_favorite: boolean | null; | ||
| user_playback_count: number | null; | ||
| favoritings_count: number; | ||
| access: 'playable' | 'preview' | 'blocked' | string; | ||
| /** Artist credit, may contain featured artists. */ | ||
| metadata_artist: string; | ||
| } | ||
|
|
||
| export interface SoundcloudPlaylist { | ||
| duration: number; | ||
| permalink_url: string; | ||
| reposts_count: number; | ||
| genre: string | null; | ||
| permalink: string; | ||
| purchase_url: string | null; | ||
| description: string | null; | ||
| uri: string; | ||
| urn: string; | ||
| label_name: string | null; | ||
| tag_list: string; | ||
| set_type: string; | ||
| public: boolean; | ||
| track_count: number; | ||
| user_id: number; | ||
| last_modified: string; | ||
| license: SoundcloudLicense; | ||
| tracks: SoundcloudTrack[]; | ||
| /** API URL for the tracklist. */ | ||
| tracks_uri: string; | ||
| id: number; | ||
| display_date: string; | ||
| sharing: 'public' | 'private'; | ||
| secret_token: string | null; | ||
| created_at: string; | ||
| likes_count: number; | ||
| kind: 'playlist'; | ||
| title: string; | ||
| purchase_title: string | null; | ||
| managed_by_feeds: boolean; | ||
| artwork_url: string | null; | ||
| is_album: boolean; | ||
| user: SoundcloudUser; | ||
| published_at: string | null; | ||
| embeddable_by: 'all' | 'me' | 'none'; | ||
| release_year: number | null; | ||
| release_month: number | null; | ||
| release_day: number | null; | ||
| type: string | null; | ||
| playlist_type: string | null; | ||
| } | ||
|
|
||
| export interface SoundcloudUser { | ||
| avatar_url: string; | ||
| city: string; | ||
| comments_count: number; | ||
| country_code: number | null; | ||
| created_at: string; | ||
| creator_subscriptions: SoundcloudCreatorSubscription[]; | ||
| creator_subscription: SoundcloudCreatorSubscription; | ||
| description: string; | ||
| followers_count: number; | ||
| followings_count: number; | ||
| first_name: string; | ||
| full_name: string; | ||
| groups_count: number; | ||
| id: number; | ||
| kind: string; | ||
| last_modified: string; | ||
| last_name: string; | ||
| likes_count: number; | ||
| playlist_likes_count: number; | ||
| permalink: string; | ||
| permalink_url: string; | ||
| playlist_count: number; | ||
| reposts_count: number | null; | ||
| track_count: number; | ||
| uri: string; | ||
| urn: string; | ||
| username: string; | ||
| verified: boolean; | ||
| visuals: { | ||
| urn: string; | ||
| enabled: boolean; | ||
| visuals: SoundcloudVisual[]; | ||
| tracking: null; | ||
| }; | ||
| } | ||
|
|
||
| export interface SoundcloudVisual { | ||
| urn: string; | ||
| entry_time: number; | ||
| visual_url: string; | ||
| } | ||
|
|
||
| export interface SoundcloudCreatorSubscription { | ||
| product: { | ||
| id: string; | ||
| }; | ||
| } | ||
|
|
||
| // Custom type definitions. | ||
|
|
||
| export type ApiError = { | ||
| code: number; | ||
| message: string; | ||
| link: string; | ||
| status: string; | ||
| errors: string[]; | ||
| error: string | null; | ||
| }; | ||
|
|
||
| export type RawRelease = SoundcloudTrack | SoundcloudPlaylist; |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do the URLs ever have a www subdomain? The provider implementation doesn't accept it at least.