-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #162 from Superjo149/discover
Add discover
- Loading branch information
Showing
32 changed files
with
925 additions
and
57 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
"repository": "Superjo149/auryo", | ||
"homepage": "http://auryo.com", | ||
"productName": "Auryo", | ||
"version": "2.2.3", | ||
"version": "2.3.0", | ||
"author": { | ||
"name": "Jonas Snellinckx", | ||
"email": "[email protected]" | ||
|
@@ -92,7 +92,7 @@ | |
"css-loader": "^0.28.11", | ||
"devtron": "^1.4.0", | ||
"dotenv": "^6.0.0", | ||
"electron": "^3.0.10", | ||
"electron": "^3.0.11", | ||
"electron-builder": "^20.34.0", | ||
"electron-devtools-installer": "^2.2.4", | ||
"electron-download": "^4.1.1", | ||
|
@@ -152,6 +152,7 @@ | |
"bootstrap": "^4.1.3", | ||
"boxicons": "^1.7.1", | ||
"classnames": "^2.2.5", | ||
"color-hash": "^1.0.3", | ||
"connected-react-router": "^4.5.0", | ||
"electron-debug": "^2.0.0", | ||
"electron-dl": "^1.12.0", | ||
|
@@ -163,6 +164,7 @@ | |
"history": "^4.7.2", | ||
"jquery": "1.9.1", | ||
"lodash": "^4.16.6", | ||
"mac-accessibility-features-check": "^1.0.2", | ||
"moment": "^2.17.0", | ||
"normalizr": "^3.2.2", | ||
"popper.js": "^1.12.9", | ||
|
@@ -204,6 +206,7 @@ | |
"@nodert-win10/windows.media.playback": "^0.2.95", | ||
"@nodert-win10/windows.storage.streams": "^0.2.95", | ||
"electron-media-service": "^0.2.2", | ||
"mac-accessibility-features-check": "^1.0.2", | ||
"mpris-service": "GPMDP/mpris-service", | ||
"dbus": "GPMDP/node-dbus#linux-only" | ||
}, | ||
|
This file contains 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,48 @@ | ||
import { normalize, schema } from 'normalizr'; | ||
import { NormalizedEntities, NormalizedPersonalizedItem, SoundCloud } from '../../types'; | ||
import { playlistSchema } from '../schemas'; | ||
import fetchToJson from './helpers/fetchToJson'; | ||
|
||
interface JsonResponse { | ||
collection: Array<PersonalisedCollectionItem>; | ||
next_href?: string; | ||
query_urn: string; | ||
} | ||
|
||
export interface PersonalisedCollectionItem { | ||
urn: string; | ||
query_urn: string; | ||
title: string; | ||
description: string; | ||
tracking_feature_name: string; | ||
last_updated: string; | ||
style: string; | ||
social_proof: SoundCloud.CompactUser; | ||
system_playlists: Array<SoundCloud.SystemPlaylist>; | ||
} | ||
|
||
|
||
export default async function fetchPersonalised(url: string): Promise<{ | ||
json: JsonResponse, | ||
normalized: { | ||
entities: NormalizedEntities; | ||
result: Array<NormalizedPersonalizedItem>; | ||
} | ||
}> { | ||
try { | ||
const json = await fetchToJson<JsonResponse>(url); | ||
|
||
const collection = json.collection.filter((t) => t.urn.indexOf('chart') === -1); | ||
|
||
return ({ | ||
normalized: normalize(collection, new schema.Array(new schema.Object({ | ||
system_playlists: new schema.Array(playlistSchema), | ||
playlists: new schema.Array(playlistSchema) | ||
}))), | ||
json | ||
}); | ||
|
||
} catch (err) { | ||
throw err; | ||
} | ||
} |
This file contains 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 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 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 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 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 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 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 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 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 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 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 |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
} | ||
.subtitle { | ||
margin: 0; | ||
color: $blue; | ||
color: #767c89; | ||
font-weight: 600; | ||
font-size: 1rem; | ||
} | ||
|
Oops, something went wrong.