From 0e023473810b529563e308a0df1925667ad16e42 Mon Sep 17 00:00:00 2001 From: geoffrey45 Date: Fri, 19 Aug 2022 23:40:26 +0300 Subject: [PATCH] remove playlist description from playlist model --- README.md | 2 +- src/assets/scss/Global/basic.scss | 2 +- src/components/AlbumView/Header.vue | 29 ++++++++++++---- src/components/PlaylistView/Header.vue | 12 +++---- src/components/modals/NewPlaylist.vue | 35 +++++++++++--------- src/components/modals/updatePlaylist.vue | 42 +++++++++--------------- src/interfaces.ts | 2 +- src/stores/pages/playlist.ts | 2 ++ 8 files changed, 65 insertions(+), 61 deletions(-) diff --git a/README.md b/README.md index d876565b..6bed4f1a 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ This page lists all the playlists you have created. More features will be added ### 4. The Playlist page ![](./images/2.png) -This page shows the details of the playlist. It includes the playlist name, description, and the songs in the playlist. You can update your playlist details from this page. +This page shows the details of the playlist. It includes the playlist name, and the songs in the playlist. You can update your playlist details from this page. ### A little narration diff --git a/src/assets/scss/Global/basic.scss b/src/assets/scss/Global/basic.scss index 4ab06b81..df503e76 100644 --- a/src/assets/scss/Global/basic.scss +++ b/src/assets/scss/Global/basic.scss @@ -36,7 +36,7 @@ } .circular { - border-radius: 20px; + border-radius: 50%; } .flex { diff --git a/src/components/AlbumView/Header.vue b/src/components/AlbumView/Header.vue index e202706e..235bb2d5 100644 --- a/src/components/AlbumView/Header.vue +++ b/src/components/AlbumView/Header.vue @@ -10,9 +10,9 @@ >
@@ -30,9 +30,8 @@
- {{ album.artist }} • - {{ album.date }} • - {{ album.count }} Tracks • {{ formatSeconds(album.duration, true) }} + {{ album.artist }} • {{ album.date }} • {{ album.count }} Tracks • + {{ formatSeconds(album.duration, true) }}
+
+ +
@@ -67,7 +69,7 @@ const emit = defineEmits<{ }>(); const albumheaderthing = ref(null); -const imguri = paths.images.thumb; +const imguri = paths.images; const nav = useNavStore(); /** @@ -90,14 +92,26 @@ useVisibility(albumheaderthing, handleVisibilityState); diff --git a/src/components/modals/updatePlaylist.vue b/src/components/modals/updatePlaylist.vue index ec88d77d..885dea50 100644 --- a/src/components/modals/updatePlaylist.vue +++ b/src/components/modals/updatePlaylist.vue @@ -8,19 +8,11 @@
- -
-
-
-
Click to upload image
+
+
Click to upload cover image
-
- -
+ @@ -89,7 +73,9 @@ function handleUpload() { "update-pl-image-upload" ) as HTMLInputElement; - handleFile(input.files[0]); + if (input.files) { + handleFile(input.files[0]); + } } function handleFile(file: File) { @@ -99,7 +85,10 @@ function handleFile(file: File) { const preview = document.getElementById("update-pl-img-preview"); const obj_url = URL.createObjectURL(file); - preview.style.backgroundImage = `url(${obj_url})`; + + if (preview) { + preview.style.backgroundImage = `url(${obj_url})`; + } image = file; } @@ -113,8 +102,8 @@ function update_playlist(e: Event) { clicked = true; const elem = document.getElementById( "updateplaylistsubmit" - ) as HTMLFormElement; - elem.value = "Updating"; + ) as HTMLButtonElement; + elem.innerText = "Updating"; } else { return; } @@ -159,15 +148,14 @@ function update_playlist(e: Event) { max-width: 28rem; max-height: 5rem; color: $white; - background-color: transparent; - border: solid 2px $gray3; + background-color: $gray2; + border: none; font-family: inherit; padding: $small; outline: none; margin: $small 0; &:focus { - border: 2px solid transparent; outline: solid 2px $gray1; } } diff --git a/src/interfaces.ts b/src/interfaces.ts index de262240..27eaa356 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -36,6 +36,7 @@ export interface AlbumInfo { duration: number; date: string; image: string; + artistimg: string; is_compilation: boolean; is_soundtrack: boolean; is_single: boolean; @@ -61,7 +62,6 @@ export interface Option { export interface Playlist { playlistid: string; name: string; - description?: string; image: string | FormData; tracks: Track[]; count: number; diff --git a/src/stores/pages/playlist.ts b/src/stores/pages/playlist.ts index 47d83789..ead55a0f 100644 --- a/src/stores/pages/playlist.ts +++ b/src/stores/pages/playlist.ts @@ -33,7 +33,9 @@ export default defineStore("playlist-tracks", { * @param info Playlist info */ updatePInfo(info: Playlist) { + const duration = this.info.duration; this.info = info; + this.info.duration = duration; }, resetArtists() { this.artists = [];