remove playlist description from playlist model

This commit is contained in:
geoffrey45
2022-08-19 23:40:26 +03:00
parent 79dcc61084
commit 0e02347381
8 changed files with 65 additions and 61 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ This page lists all the playlists you have created. More features will be added
### 4. The Playlist page ### 4. The Playlist page
![](./images/2.png) ![](./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 ### A little narration
+1 -1
View File
@@ -36,7 +36,7 @@
} }
.circular { .circular {
border-radius: 20px; border-radius: 50%;
} }
.flex { .flex {
+22 -7
View File
@@ -10,9 +10,9 @@
> >
<div class="art rounded"> <div class="art rounded">
<img <img
:src="imguri + album.image" :src="imguri.artist + album.artistimg"
alt="" alt=""
class="rounded shadow-lg" class="circular shadow-lg"
loading="lazy" loading="lazy"
/> />
</div> </div>
@@ -30,9 +30,8 @@
</div> </div>
<div class="bottom"> <div class="bottom">
<div class="stats"> <div class="stats">
{{ album.artist }} {{ album.artist }} {{ album.date }} {{ album.count }} Tracks
{{ album.date }} {{ formatSeconds(album.duration, true) }}
{{ album.count }} Tracks {{ formatSeconds(album.duration, true) }}
</div> </div>
<PlayBtnRect <PlayBtnRect
:source="playSources.album" :source="playSources.album"
@@ -41,6 +40,9 @@
/> />
</div> </div>
</div> </div>
<div class="bigimg">
<img class="rounded" :src="imguri.thumb + album.image" alt="" />
</div>
</div> </div>
</template> </template>
@@ -67,7 +69,7 @@ const emit = defineEmits<{
}>(); }>();
const albumheaderthing = ref<any>(null); const albumheaderthing = ref<any>(null);
const imguri = paths.images.thumb; const imguri = paths.images;
const nav = useNavStore(); const nav = useNavStore();
/** /**
@@ -90,14 +92,26 @@ useVisibility(albumheaderthing, handleVisibilityState);
<style lang="scss"> <style lang="scss">
.a-header { .a-header {
display: grid; display: grid;
grid-template-columns: 1fr; grid-template-columns: 1fr min-content;
grid-template-rows: 1fr 1fr;
grid-template-areas: "artist thumbnail" "tags thumbnail";
gap: 1rem; gap: 1rem;
padding: 1rem; padding: 1rem;
height: 100% !important; height: 100% !important;
background-color: $black; background-color: $black;
background-image: linear-gradient(37deg, $black 20%, $gray, $black 90%); background-image: linear-gradient(37deg, $black 20%, $gray, $black 90%);
.bigimg {
grid-area: thumbnail;
width: 16rem;
img {
height: 100%;
}
}
.art { .art {
grid-area: artist;
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
position: relative; position: relative;
@@ -116,6 +130,7 @@ useVisibility(albumheaderthing, handleVisibilityState);
} }
.info { .info {
grid-area: tags;
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
+4 -8
View File
@@ -26,9 +26,6 @@
<span v-else>{{ props.info.count }} Tracks</span> <span v-else>{{ props.info.count }} Tracks</span>
{{ formatSeconds(props.info.duration, true) }} {{ formatSeconds(props.info.duration, true) }}
</div> </div>
<div class="desc">
{{ props.info.description }}
</div>
<div class="title ellip">{{ props.info.name }}</div> <div class="title ellip">{{ props.info.name }}</div>
<div class="type">Playlist</div> <div class="type">Playlist</div>
</div> </div>
@@ -88,7 +85,6 @@ function showDropdown(e: any) {
position: relative; position: relative;
color: $white; color: $white;
background-color: transparent; background-color: transparent;
z-index: 0;
.gradient { .gradient {
position: absolute; position: absolute;
@@ -97,10 +93,10 @@ function showDropdown(e: any) {
width: 100%; width: 100%;
height: 100%; height: 100%;
background-image: linear-gradient( background-image: linear-gradient(
37deg, 20deg,
$black 20%, rgba(0, 0, 0, 0.25) 40%,
transparent, rgba(0, 0, 0, 0.1),
$black 90% rgba(0, 0, 0, 0.1) 70%
); );
} }
+19 -16
View File
@@ -9,9 +9,7 @@
id="modal-playlist-name-input" id="modal-playlist-name-input"
/> />
<br /> <br />
<div class="submit"> <button type="submit">Create</button>
<input type="submit" class="rounded" value="Create" />
</div>
</form> </form>
</template> </template>
@@ -94,19 +92,24 @@ function create(e: Event) {
justify-content: flex-end; justify-content: flex-end;
} }
input[type="submit"] { button {
margin: $small 0; margin: 0 auto;
background-color: rgba(40, 132, 252, 0.884) !important; width: 6rem;
color: $white;
padding: $small 1rem;
font-size: 1rem;
border: solid 2px transparent !important;
outline: none;
cursor: pointer;
&:focus {
border: 2px solid $gray1 !important;
}
} }
// input[type="submit"] {
// margin: $small 0;
// background-color: rgba(40, 132, 252, 0.884) !important;
// color: $white;
// padding: $small 1rem;
// font-size: 1rem;
// border: solid 2px transparent !important;
// outline: none;
// cursor: pointer;
// &:focus {
// border: 2px solid $gray1 !important;
// }
// }
} }
</style> </style>
+15 -27
View File
@@ -8,19 +8,11 @@
<br /> <br />
<input <input
type="text" type="text"
class="rounded" class="rounded-sm"
name="name" name="name"
id="modal-playlist-name-input" id="modal-playlist-name-input"
:value="props.playlist.name" :value="props.playlist.name"
/> />
<label for="name">Description</label>
<br />
<textarea
name="description"
id=""
class="rounded"
:value="props.playlist.description"
></textarea>
<br /> <br />
<input <input
type="file" type="file"
@@ -30,8 +22,8 @@
style="display: none" style="display: none"
@change="handleUpload" @change="handleUpload"
/> />
<div id="upload" class="rounded" @click="selectFiles"> <div id="upload" class="rounded-sm" @click="selectFiles">
<div>Click to upload image</div> <div>Click to upload cover image</div>
<div <div
id="update-pl-img-preview" id="update-pl-img-preview"
class="image" class="image"
@@ -40,15 +32,7 @@
}" }"
/> />
</div> </div>
<div class="submit"> <button type="submit" id="updateplaylistsubmit">Update</button>
<input
type="submit"
id="updateplaylistsubmit"
class="rounded"
value="Update"
@click=""
/>
</div>
</form> </form>
</template> </template>
@@ -89,7 +73,9 @@ function handleUpload() {
"update-pl-image-upload" "update-pl-image-upload"
) as HTMLInputElement; ) as HTMLInputElement;
handleFile(input.files[0]); if (input.files) {
handleFile(input.files[0]);
}
} }
function handleFile(file: File) { function handleFile(file: File) {
@@ -99,7 +85,10 @@ function handleFile(file: File) {
const preview = document.getElementById("update-pl-img-preview"); const preview = document.getElementById("update-pl-img-preview");
const obj_url = URL.createObjectURL(file); const obj_url = URL.createObjectURL(file);
preview.style.backgroundImage = `url(${obj_url})`;
if (preview) {
preview.style.backgroundImage = `url(${obj_url})`;
}
image = file; image = file;
} }
@@ -113,8 +102,8 @@ function update_playlist(e: Event) {
clicked = true; clicked = true;
const elem = document.getElementById( const elem = document.getElementById(
"updateplaylistsubmit" "updateplaylistsubmit"
) as HTMLFormElement; ) as HTMLButtonElement;
elem.value = "Updating"; elem.innerText = "Updating";
} else { } else {
return; return;
} }
@@ -159,15 +148,14 @@ function update_playlist(e: Event) {
max-width: 28rem; max-width: 28rem;
max-height: 5rem; max-height: 5rem;
color: $white; color: $white;
background-color: transparent; background-color: $gray2;
border: solid 2px $gray3; border: none;
font-family: inherit; font-family: inherit;
padding: $small; padding: $small;
outline: none; outline: none;
margin: $small 0; margin: $small 0;
&:focus { &:focus {
border: 2px solid transparent;
outline: solid 2px $gray1; outline: solid 2px $gray1;
} }
} }
+1 -1
View File
@@ -36,6 +36,7 @@ export interface AlbumInfo {
duration: number; duration: number;
date: string; date: string;
image: string; image: string;
artistimg: string;
is_compilation: boolean; is_compilation: boolean;
is_soundtrack: boolean; is_soundtrack: boolean;
is_single: boolean; is_single: boolean;
@@ -61,7 +62,6 @@ export interface Option {
export interface Playlist { export interface Playlist {
playlistid: string; playlistid: string;
name: string; name: string;
description?: string;
image: string | FormData; image: string | FormData;
tracks: Track[]; tracks: Track[];
count: number; count: number;
+2
View File
@@ -33,7 +33,9 @@ export default defineStore("playlist-tracks", {
* @param info Playlist info * @param info Playlist info
*/ */
updatePInfo(info: Playlist) { updatePInfo(info: Playlist) {
const duration = this.info.duration;
this.info = info; this.info = info;
this.info.duration = duration;
}, },
resetArtists() { resetArtists() {
this.artists = []; this.artists = [];