add new album header

This commit is contained in:
geoffrey45 2022-02-19 18:43:17 +03:00
parent dcfb0a6ed1
commit a6bb5059b0
18 changed files with 101 additions and 189 deletions

View File

@ -197,7 +197,7 @@ def get_artist_data(artist: str):
@bp.route("/f/<folder>") @bp.route("/f/<folder>")
# @cache.cached(30) @cache.cached()
def get_folder_tree(folder: str): def get_folder_tree(folder: str):
""" """
Returns a list of all the folders and tracks in the given folder. Returns a list of all the folders and tracks in the given folder.

View File

@ -35,12 +35,11 @@ def add_track(filepath: str) -> None:
Processes the audio tags for a given file ands add them to the music dict. Processes the audio tags for a given file ands add them to the music dict.
""" """
tags = functions.get_tags(filepath) tags = functions.get_tags(filepath)
print(tags)
if tags is not None: if tags is not None:
print("🔵: tags okay") instances.songs_instance.insert_song(tags)
track_id = instances.songs_instance.insert_song(tags) track = instances.songs_instance.get_song_by_path(tags["filepath"])
track = instances.songs_instance.get_song_by_id(track_id)
print(track_id)
track_obj = functions.create_track_class(track) track_obj = functions.create_track_class(track)
api.all_the_f_music.append(track_obj) api.all_the_f_music.append(track_obj)
@ -55,7 +54,6 @@ def remove_track(filepath: str) -> None:
for track in api.all_the_f_music: for track in api.all_the_f_music:
if track.track_id == track_id: if track.track_id == track_id:
pprint(track)
api.all_the_f_music.remove(track) api.all_the_f_music.remove(track)
@ -90,8 +88,19 @@ class Handler(PatternMatchingEventHandler):
Fired when a move event occurs on a supported file. Fired when a move event occurs on a supported file.
""" """
print("🔘 moved -->") print("🔘 moved -->")
remove_track(event.src_path) tr = "share/Trash"
add_track(event.dest_path)
if tr in event.dest_path:
print("trash ++")
remove_track(event.src_path)
elif tr in event.src_path:
add_track(event.dest_path)
elif tr not in event.dest_path and tr not in event.src_path:
add_track(event.dest_path)
remove_track(event.src_path)
def on_closed(self, event): def on_closed(self, event):
""" """

View File

@ -62,12 +62,12 @@
width: 100%; width: 100%;
.durationx { .durationx {
background-color: rgba(0, 72, 131, 0.171); background-color: #97979725;
// border: solid 1px rgba(255, 255, 255, 0.253);
padding: $smaller; padding: $smaller;
border-radius: 0.4rem; border-radius: 0.75rem;
margin: 0 $small 0 $small; margin: 0 $small 0 $small;
font-size: .8rem; font-size: 0.8rem;
color: rgb(0, 119, 255);
} }
} }
} }

View File

@ -1,13 +1,13 @@
// colors // colors
$card-dark: #08090c; $card-dark: #040406;
$red: #df4646; $red: #df4646;
$blue: #055096; $blue: #055096;
$green: #439443; $green: #439443;
$separator: #ffffff46; $separator: #ffffff2f;
$pink: #c43a3a; $pink: #c43a3a;
$highlight-blue: #006eff; $highlight-blue: #006eff;
$bbb: #050608; //bottom controls background $bbb: #161616; //bottom controls background
// sizes // sizes
$small: 0.5rem; $small: 0.5rem;

View File

@ -40,6 +40,10 @@ a {
} }
.border { .border {
border: solid 2px #27262654;
}
.border-sm {
border: solid 1px #27262654; border: solid 1px #27262654;
} }

BIN
src/assets/images/abg.webp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -4,7 +4,7 @@
<div class="rect rounded"></div> <div class="rect rounded"></div>
<div class="circle"></div> <div class="circle"></div>
</div> </div>
<div class="bio rounded border" v-html="bio"></div> <div class="bio rounded" v-html="bio"></div>
</div> </div>
</template> </template>

View File

@ -1,14 +1,10 @@
<template> <template>
<div class="album-h"> <div class="album-h">
<div class="a-header rounded card-dark border"> <div class="a-header rounded card-dark">
<div
:style="{
backgroundImage: `url(&quot;${album_info.image}&quot;)`,
}"
class="art rounded border"
></div>
<div class="info"> <div class="info">
<div class="top"> <div class="top">
<div class="h">Album</div>
<div class="separator no-border"></div>
<div class="title">{{ album_info.name }}</div> <div class="title">{{ album_info.name }}</div>
<div class="artist">{{ album_info.artist }}</div> <div class="artist">{{ album_info.artist }}</div>
</div> </div>
@ -17,23 +13,13 @@
<div class="stats"> <div class="stats">
{{ album_info.count }} Tracks {{ album_info.duration }} 2021 {{ album_info.count }} Tracks {{ album_info.duration }} 2021
</div> </div>
<button class="play rounded" @click="playAlbum"> <div class="play rounded" @click="playAlbum">
<div class="icon"></div> <div class="icon"></div>
<div>Play</div> <div>Play</div>
</button> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="right rounded card-dark border">
<div class="circle circular"></div>
<div class="rect rounded"></div>
<div
:style="{
backgroundImage: `url(&quot;${album_info.artist_image}&quot;)`,
}"
class="avatar image"
></div>
</div>
</div> </div>
</template> </template>
@ -57,9 +43,6 @@ export default {
<style lang="scss"> <style lang="scss">
.album-h { .album-h {
display: grid;
grid-template-columns: 1fr 1fr;
@include tablet-landscape { @include tablet-landscape {
grid-template-columns: 1fr; grid-template-columns: 1fr;
} }
@ -68,76 +51,6 @@ export default {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
height: 14rem; height: 14rem;
.right {
@include tablet-landscape {
display: none;
}
padding: $small;
position: relative;
.avatar {
height: 8rem;
width: 8rem;
border-radius: 50%;
background-image: url("../../assets/images/null.webp");
position: absolute;
left: -4.2rem;
top: 3rem;
box-shadow: 0 0 1.5rem rgb(0, 0, 0);
}
.rect {
width: 20rem;
height: 10rem;
position: absolute;
right: 0;
background-color: rgb(196, 58, 58);
transform: rotate(-45deg) translate(20%, -50%);
z-index: 1;
box-shadow: 0 0 2rem rgb(0, 0, 0);
transition: all 0.5s ease-in-out;
&:hover {
transition: all 0.5s ease-in-out;
right: 2rem;
}
}
.circle {
width: 7rem;
height: 7rem;
position: absolute;
right: 0;
background-color: $blue;
border-radius: 50%;
transform: translateX(-11rem) translateY(7rem);
box-shadow: 0 0 2rem rgba(0, 0, 0, 0.164);
transition: all 0.5s ease-in-out;
&:hover {
transition: all 0.5s ease-in-out;
right: 1rem;
}
}
&:hover {
transition: all 0.5s ease-in-out;
.circle {
border-radius: 0;
transform: translateX(-11rem) translateY(7rem) rotate(360deg);
}
.rect {
border-radius: 0;
transform: translate(20%, -50%) rotate(360deg);
}
}
}
} }
.a-header { .a-header {
@ -145,35 +58,32 @@ export default {
overflow: hidden; overflow: hidden;
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 1rem 0 14rem; padding: 1rem;
height: 100%;
.art { background-image: url("../../assets/images/abg.webp");
position: absolute; background-position: 0% 60%;
left: $small;
width: 13rem;
height: 13rem;
background: no-repeat center/cover;
margin-right: 1rem;
}
.info { .info {
width: 100%; width: 100%;
height: calc(100% - 1rem); height: calc(100%);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: flex-end; justify-content: flex-end;
.top { .top {
.h {
color: rgba(255, 255, 255, 0.795);
}
.title { .title {
font-size: 1.5rem; font-size: 2rem;
font-weight: bold; font-weight: 1000;
color: white; color: white;
} }
.artist { .artist {
margin-top: $small; margin-top: $small;
font-size: 1.5rem;
color: rgba(255, 255, 255, 0.856); color: #fffffff1;
} }
} }
@ -184,6 +94,7 @@ export default {
.bottom { .bottom {
.stats { .stats {
font-weight: bold; font-weight: bold;
display: none;
} }
.play { .play {
@ -191,9 +102,10 @@ export default {
width: 6rem; width: 6rem;
display: flex; display: flex;
align-items: center; align-items: center;
background: $blue; background: $highlight-blue;
padding: $small; padding: $small;
margin: $small 0; margin: $small 0;
cursor: pointer;
.icon { .icon {
height: 1.5rem; height: 1.5rem;

View File

@ -2,7 +2,7 @@
<div class="b-bar border card-dark"> <div class="b-bar border card-dark">
<div class="grid"> <div class="grid">
<SongCard :collapsed="props.collapsed" /> <SongCard :collapsed="props.collapsed" />
<div class="controlsx border rounded"> <div class="controlsx rounded">
<div class="controls controls-bottom"> <div class="controls controls-bottom">
<HotKeys /> <HotKeys />
</div> </div>

View File

@ -2,7 +2,7 @@
<router-link <router-link
:to="{ name: 'FolderView', params: { path: props.folder.path } }" :to="{ name: 'FolderView', params: { path: props.folder.path } }"
> >
<div class="f-item border rounded"> <div class="f-item border-sm rounded">
<div class="icon image"></div> <div class="icon image"></div>
<div class="info"> <div class="info">
<div class="f-item-text ellip">{{ props.folder.name }}</div> <div class="f-item-text ellip">{{ props.folder.name }}</div>

View File

@ -1,8 +1,8 @@
<template> <template>
<div class="f-artists border"> <div class="f-artists border">
<div class="xcontrols"> <div class="xcontrols">
<div class="prev border" @click="scrollLeft"></div> <div class="prev" @click="scrollLeft"></div>
<div class="next border" @click="scrollRight"></div> <div class="next" @click="scrollRight"></div>
</div> </div>
<div class="artists" ref="artists_dom"> <div class="artists" ref="artists_dom">
<div class="xartist border c1 image"> <div class="xartist border c1 image">
@ -91,7 +91,7 @@ export default {
border-radius: $small; border-radius: $small;
cursor: pointer; cursor: pointer;
transition: all 0.5s ease; transition: all 0.5s ease;
background-color: rgb(79, 80, 80); background-color: rgb(51, 51, 51);
} }
.next:hover, .next:hover,

View File

@ -47,7 +47,9 @@ function changeTab(tab) {
setTimeout(() => {}, 300); setTimeout(() => {}, 300);
}).then(() => { }).then(() => {
if (tab === tabs.queue) { if (tab === tabs.queue) {
perks.focusCurrent(); setTimeout(() => {
perks.focusCurrent();
}, 300);
} }
}); });
} }

View File

@ -32,7 +32,7 @@
<Progress/> <Progress/>
</div> </div>
</div> </div>
<div class="c-wrapper border rounded"> <div class="c-wrapper rounded">
<div class="controls"> <div class="controls">
<div class="shuffle"> <div class="shuffle">
<div class="image"></div> <div class="image"></div>
@ -89,7 +89,7 @@ export default {
border-radius: 0.5rem; border-radius: 0.5rem;
height: 13.5rem; height: 13.5rem;
padding: 0.5rem; padding: 0.5rem;
background: $card-dark; // background: rgba(255, 255, 255, 0.055);
display: grid; display: grid;
grid-template-rows: 3fr 1fr; grid-template-rows: 3fr 1fr;

View File

@ -19,9 +19,9 @@
</p> </p>
</div> </div>
</div> </div>
<div class="scrollable-r border rounded"> <div class="scrollable-r border rounded">
<TrackItem v-for="song in queue" :key="song.track_id" :track="song" /> <TrackItem v-for="song in queue" :key="song.track_id" :track="song" />
</div> </div>
</div> </div>
</div> </div>
</template> </template>
@ -34,30 +34,14 @@ import { watch } from "@vue/runtime-core";
import TrackItem from "../shared/TrackItem.vue"; import TrackItem from "../shared/TrackItem.vue";
export default { export default {
props: ["up_next"], setup() {
setup(props, { emit }) {
const is_expanded = toRefs(props).up_next;
const queue = ref(perks.queue); const queue = ref(perks.queue);
const next = ref(perks.next); const next = ref(perks.next);
let collapse = () => {
emit("expandQueue");
};
watch(is_expanded, (newVal) => {
if (newVal) {
setTimeout(() => {
perks.focusCurrent();
}, 1000);
}
});
const { playNext } = audio; const { playNext } = audio;
const putCommas = perks.putCommas; const putCommas = perks.putCommas;
return { return {
collapse,
is_expanded,
playNext, playNext,
putCommas, putCommas,
queue, queue,

View File

@ -30,11 +30,11 @@ export default {
}, },
{ {
title: "Artist", title: "Artist",
icon: "🙄", icon: "👤",
}, },
{ {
title: "Playlist", title: "Playlist",
icon: "😍", icon: "🎧",
}, },
{ {
title: "Folder", title: "Folder",

View File

@ -4,40 +4,41 @@ import album from "./album.js";
import state from "./state.js"; import state from "./state.js";
async function toAlbum(title, artist) { async function toAlbum(title, artist) {
state.loading.value = true; console.log("routing to album");
album state.loading.value = true;
.getAlbumTracks(title, artist) await album
.then((data) => { .getAlbumTracks(title, artist)
state.album_song_list.value = data.songs; .then((data) => {
state.album_info.value = data.info; state.album_song_list.value = data.songs;
}) state.album_info.value = data.info;
.then( })
await album.getAlbumArtists(title, artist).then((data) => { .then(
state.album_artists.value = data; await album.getAlbumArtists(title, artist).then((data) => {
}) state.album_artists.value = data;
) })
.then( )
await album.getAlbumBio(title, artist).then((data) => { .then(
if (data === "None") { album.getAlbumBio(title, artist).then((data) => {
state.album_bio.value = null; if (data === "None") {
} else { state.album_bio.value = null;
state.album_bio.value = data; } else {
} state.album_bio.value = data;
}) }
) })
.then(() => { )
Router.push({ .then(() => {
name: "AlbumView", Router.push({
params: { name: "AlbumView",
album: title, params: {
artist: artist, album: title,
}, artist: artist,
}); },
state.loading.value = false; });
}) state.loading.value = false;
.catch((error) => { })
console.log(error); .catch((error) => {
}); console.log(error);
});
} }
export default { export default {

View File

@ -4,7 +4,7 @@
<Header :album_info="album_info" /> <Header :album_info="album_info" />
</div> </div>
<div class="separator" id="av-sep"></div> <div class="separator" id="av-sep"></div>
<div class="songs rounded border"> <div class="songs rounded">
<SongList :songs="album_songs" /> <SongList :songs="album_songs" />
</div> </div>
<div class="separator" id="av-sep"></div> <div class="separator" id="av-sep"></div>