add image -> readme

This commit is contained in:
geoffrey45 2022-03-08 09:56:58 +03:00
parent c3059d502c
commit 39fba364d3
6 changed files with 21 additions and 29 deletions

View File

@ -1,24 +1,5 @@
# musicx-v ### Alice Music
## Project setup ![](./images/1.png)
```
yarn install
```
### Compiles and hot-reloads for development `installation instructions coming soon ...`
```
yarn serve
```
### Compiles and minifies for production
```
yarn build
```
### Lints and fixes files
```
yarn lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

BIN
images/1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 553 KiB

View File

@ -57,9 +57,7 @@ def search():
artist_obj = { artist_obj = {
"name": artist, "name": artist,
"image": "http://0.0.0.0:8900/images/artists/" "image": helpers.check_artist_image(artist),
+ artist.replace("/", "::")
+ ".webp",
} }
if artist_obj not in artists_dicts: if artist_obj not in artists_dicts:
@ -141,9 +139,7 @@ def get_albumartists():
for artist in artists: for artist in artists:
artist_obj = { artist_obj = {
"name": artist, "name": artist,
"image": "http://0.0.0.0:8900/images/artists/" "image": helpers.check_artist_image(artist),
+ artist.replace("/", "::")
+ ".webp",
} }
final_artists.append(artist_obj) final_artists.append(artist_obj)

View File

@ -116,3 +116,14 @@ def extract_image_colors(image) -> list:
formatted_colors.append(color) formatted_colors.append(color)
return formatted_colors return formatted_colors
def check_artist_image(image: str) -> str:
"""
Checks if the artist image is valid.
"""
img_name = image.replace("/", "::")+ ".webp"
if not os.path.exists(os.path.join(app_dir, "images", "artists", img_name)):
return "http://0.0.0.0:8900/images/artists/0.webp"
else:
return "http://0.0.0.0:8900/images/artists/" + img_name,

View File

@ -97,6 +97,10 @@ button {
.tabs { .tabs {
grid-area: tabs; grid-area: tabs;
@include tablet-landscape {
display: none;
}
} }
.topnav { .topnav {

View File

@ -32,7 +32,7 @@ const isPlaying = playAudio.playing;
} }
.play-pause { .play-pause {
background-image: url(../../assets/icons/play.svg) !important; background-image: url(../../assets/icons/play.svg);
} }
.isPlaying { .isPlaying {