credit encore 1
This commit is contained in:
@@ -40,7 +40,6 @@
|
|||||||
<div class="results-grid">
|
<div class="results-grid">
|
||||||
<div class="card" each="{item in searchs.items}">
|
<div class="card" each="{item in searchs.items}">
|
||||||
<!-- Afficher l'étoile avec la musique immédiatement -->
|
<!-- Afficher l'étoile avec la musique immédiatement -->
|
||||||
{console.log(item.isFavorite)}
|
|
||||||
<a if={authUser && this.searchs.type !== "artist"} onclick={() => item.isFavorite ? this.removeFavoris(item.id, item.type) : this.addFavoris(item.id, item.type)}>
|
<a if={authUser && this.searchs.type !== "artist"} onclick={() => item.isFavorite ? this.removeFavoris(item.id, item.type) : this.addFavoris(item.id, item.type)}>
|
||||||
<button><i class={item.isFavorite ? "fa-solid fa-star" : "fa-regular fa-star"}></i></button>
|
<button><i class={item.isFavorite ? "fa-solid fa-star" : "fa-regular fa-star"}></i></button>
|
||||||
</a>
|
</a>
|
||||||
@@ -92,7 +91,6 @@
|
|||||||
const query = e?.target?.query?.value || this.searchs.query;
|
const query = e?.target?.query?.value || this.searchs.query;
|
||||||
|
|
||||||
const result = await window.discogsearch(query, type, page);
|
const result = await window.discogsearch(query, type, page);
|
||||||
console.log(result);
|
|
||||||
|
|
||||||
const favoritePromises = result.results.map(item => window.isFavorite(item.id, item.type));
|
const favoritePromises = result.results.map(item => window.isFavorite(item.id, item.type));
|
||||||
const favoritesResults = await Promise.all(favoritePromises);
|
const favoritesResults = await Promise.all(favoritePromises);
|
||||||
|
|||||||
@@ -50,18 +50,18 @@
|
|||||||
async onMounted() {
|
async onMounted() {
|
||||||
const id = this.props.Id
|
const id = this.props.Id
|
||||||
if(this.props.Type === "release"){
|
if(this.props.Type === "release"){
|
||||||
this.state.release = await window.getReleaseDetails(id)
|
this.state.release = await window.getReleaseDetails(id);
|
||||||
|
|
||||||
|
// Récupérer les extra-artists depuis leur URL
|
||||||
|
const response = await fetch(artist.resource_url);
|
||||||
|
this.state.resource = response.json();
|
||||||
|
this.update();
|
||||||
}
|
}
|
||||||
else if (this.props.Type === "master"){
|
else if (this.props.Type === "master"){
|
||||||
this.state.release = await window.getMasterDetails(id)
|
this.state.release = await window.getMasterDetails(id)
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
this.state.release = await window.getArtistDetails(id)
|
this.state.release = await window.getArtistDetails(id)
|
||||||
|
|
||||||
// Récupérer les extra-artists depuis leur URL
|
|
||||||
const response = await fetch(artist.resource_url);
|
|
||||||
this.state.resource = response.json();
|
|
||||||
this.update();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.update()
|
this.update()
|
||||||
|
|||||||
Reference in New Issue
Block a user