Commit 830cca5d authored by Henrik Hüttemann's avatar Henrik Hüttemann 🤔

Update album management

parent 59dbb967
Pipeline #728 passed with stage
in 1 minute and 1 second
......@@ -39,7 +39,7 @@
<Album
class="albums"
v-for="album in albums"
v-bind:key="album.releaseGroupId"
v-bind:key="album.releaseId"
v-bind:album="album"
v-bind:search="search"
></Album>
......@@ -48,19 +48,37 @@
<v-tab title="Extras">
<div class="settings">
<h2>Download other albums</h2>
<ul>
<li
<table>
<tr>
<th>Artist</th>
<th>Album</th>
<th>in DB?</th>
<th>downloading?</th>
<th>actions</th>
</tr>
<tr
v-for="dl in downloads"
v-bind:key="dl.releaseId"
>
{{ dl.artist }} - {{ dl.album }}:
<a v-on:click.stop="getRelease(dl)">
{{ dl.status || '&#x25b6;' }}
</a>
</li>
</ul>
<h2>Delete Albums</h2>
<button v-on:click="deleteAlbum('ad3117d1-fcc2-3089-ad8f-47d139f7c18f')">DELETE Avel Glas</button>
<td>
{{ dl.artist }}
</td>
<td>
<a v-bind:href="`https://musicbrainz.org/release/${dl.releaseId}`" v-bind:title="dl.releaseId">{{ dl.album }}</a>
</td>
<td title="in DB?">
{{ getAlbumById(dl.releaseId) !== undefined ? '&#x2714;' : '&#x2718;' }}
</td>
<td title="download-status">
{{ dl.status || 'not in queue' }}
</td>
<td>
<button v-on:click.stop="getRelease(dl)" title="download">&#x25bc;</button>
<button v-on:click="deleteAlbum(dl.releaseId)" v-bind:disabled="getAlbumById(dl.releaseId) === undefined" title="delete">&#x2716;</button>
</td>
</tr>
</table>
</div>
</v-tab>
</vue-tabs>
......@@ -97,8 +115,8 @@ export default {
checkString: 'Hello from IPFS Gateway Checker'
},
db: 'https://db.beef.h3n.eu/autolib/',
// backend: 'https://backend.beef.h3n.eu/'
backend: 'http://localhost:3000/'
backend: 'https://backend.beef.h3n.eu/'
// backend: 'http://localhost:3000/'
},
checks: {
db: false,
......@@ -156,6 +174,34 @@ export default {
releaseId: '1394a579-338e-495b-b659-b1707f55422e',
status: null,
intervalId: 0
},
{
artist: 'zero-project',
album: 'Celtic dream',
releaseId: 'ad64bb1a-b658-4819-bed6-62ba19d3c6ed',
status: null,
intervalId: 0
},
{
artist: 'Sky Effect',
album: 'Freedom Eye',
releaseId: 'c260cdb0-92a4-403a-a83c-7d88ec792af9',
status: null,
intervalId: 0
},
{
artist: 'Anitek',
album: 'Mind Express',
releaseId: 'ad31478d-ce81-45c6-a93a-e42ee78ecac6',
status: null,
intervalId: 0
},
{
artist: 'Obsidian Shell',
album: 'Angelic Asylum',
releaseId: '5700874c-c2eb-44d6-9814-3dbff3ac4be0',
status: null,
intervalId: 0
}
]
}
......@@ -167,10 +213,10 @@ export default {
albums: function () {
let albums = []
this.filteredSongs.map(song => {
let album = albums.find(a => a.releaseGroupId === song.metadata.musicbrainz_releasegroupid)
let album = albums.find(a => a.releaseId === song.metadata.musicbrainz_albumid)
if (album === undefined) {
album = {
releaseGroupId: song.metadata.musicbrainz_releasegroupid,
releaseId: song.metadata.musicbrainz_albumid,
cover: this.getCoverUrl(song.cover),
artist: song.metadata.albumartist,
title: song.metadata.album,
......@@ -187,6 +233,9 @@ export default {
}
},
methods: {
getAlbumById (releaseId) {
return this.albums.find(a => a.releaseId === releaseId)
},
getSongs () {
axios.get(`${this.config.db}_design/songs/_view/overview?include_docs=true`)
.then(response => {
......@@ -235,8 +284,8 @@ export default {
})
}, 1000)
},
deleteAlbum (releaseGroupId) {
const album = this.albums.find(album => album.releaseGroupId === releaseGroupId)
deleteAlbum (releaseId) {
const album = this.albums.find(album => album.releaseId === releaseId)
console.log(
'Debug:',
`${this.config.backend}delete`
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment