From 736fa01161b07801665a96f3cf58ba558ea987a5 Mon Sep 17 00:00:00 2001 From: exttex Date: Sun, 30 Aug 2020 20:07:04 +0200 Subject: [PATCH] Artist page changes, explicit marking, bug fixes --- .gitignore | 8 ++++ app/client/.gitignore | 23 +++++++++ app/client/src/components/AlbumTile.vue | 4 +- app/client/src/components/TrackTile.vue | 2 +- app/client/src/views/ArtistPage.vue | 64 +++++++++++++++++++++---- app/package.json | 2 +- app/src/definitions.js | 14 ++++++ 7 files changed, 106 insertions(+), 11 deletions(-) create mode 100644 .gitignore create mode 100644 app/client/.gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..93a9806 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +dist/ +node_modules/ +app/node_modules/ +app/dist/ +app/client/dist/ +app/client/node_modules/ +electron_dist/ +freezer-*.tgz diff --git a/app/client/.gitignore b/app/client/.gitignore new file mode 100644 index 0000000..403adbc --- /dev/null +++ b/app/client/.gitignore @@ -0,0 +1,23 @@ +.DS_Store +node_modules +/dist + + +# local env files +.env.local +.env.*.local + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/app/client/src/components/AlbumTile.vue b/app/client/src/components/AlbumTile.vue index c8ba52e..b705894 100644 --- a/app/client/src/components/AlbumTile.vue +++ b/app/client/src/components/AlbumTile.vue @@ -13,7 +13,9 @@ - {{album.title}} + + {{album.title}}E + {{album.artistString}} diff --git a/app/client/src/components/TrackTile.vue b/app/client/src/components/TrackTile.vue index 965a40d..5299460 100644 --- a/app/client/src/components/TrackTile.vue +++ b/app/client/src/components/TrackTile.vue @@ -6,7 +6,7 @@ {{track.title}} + >{{track.title}}E {{track.artistString}} diff --git a/app/client/src/views/ArtistPage.vue b/app/client/src/views/ArtistPage.vue index 853d287..36b3f97 100644 --- a/app/client/src/views/ArtistPage.vue +++ b/app/client/src/views/ArtistPage.vue @@ -53,19 +53,56 @@ +

Albums

- - + +
-
+ + + + + Show all albums + + +
+ +
+ +

Singles

+ +
+ + + + + + Show all singles + + +
+ +
+ +
+
+ + +
@@ -85,7 +122,9 @@ export default { loading: false, libraryLoading: false, allTopTracks: false, - loadingMore: false + loadingMore: false, + allAlbums: false, + allSingles: false } }, props: { @@ -120,6 +159,9 @@ export default { } this.loading = false; } + + //Load page on background + this.loadMoreAlbums(); }, async loadMoreAlbums() { if (this.artist.albumCount <= this.artist.albums.length) return; @@ -133,8 +175,14 @@ export default { this.loadingMore = false; }, + showAllSingles() { + this.allSingles = true; + this.loadMoreAlbums(); + }, //On scroll load more albums scroll(event) { + if (!this.allAlbums && !this.allSingles) return; + let loadOffset = event.target.scrollHeight - event.target.offsetHeight - 150; if (event.target.scrollTop > loadOffset) { if (!this.loadingMore && !this.loading) this.loadMoreAlbums(); diff --git a/app/package.json b/app/package.json index b729253..32e7f2e 100644 --- a/app/package.json +++ b/app/package.json @@ -1,7 +1,7 @@ { "name": "freezer", "private": true, - "version": "1.0.0", + "version": "1.0.1", "description": "", "main": "background.js", "scripts": { diff --git a/app/src/definitions.js b/app/src/definitions.js index 6160cf7..7e6f8c0 100644 --- a/app/src/definitions.js +++ b/app/src/definitions.js @@ -51,6 +51,20 @@ class Album { this.tracks = tracksJson.data.map((t) => new Track(t)); this.artists = (json.ARTISTS ? json.ARTISTS : [json]).map((a) => new Artist(a)); this.releaseDate = json.DIGITAL_RELEASE_DATE; + + //Explicit + this.explicit = false; + if (json.EXPLICIT_LYRICS && json.EXPLICIT_LYRICS.toString() == "1") this.explicit = true; + if (json.EXPLICIT_ALBUM_CONTENT) { + if (json.EXPLICIT_ALBUM_CONTENT.EXPLICIT_LYRICS_STATUS == 4) this.explicit = true; + if (json.EXPLICIT_ALBUM_CONTENT.EXPLICIT_LYRICS_STATUS == 1) this.explicit = true; + } + + //Type + this.type = 'album'; + if (json.TYPE && json.TYPE.toString() == "0") this.type = 'single'; + if (!json.ARTISTS_ALBUMS_IS_OFFICIAL) this.type = 'featured'; + //Helpers this.artistString = this.artists.map((a) => a.name).join(', '); }