mirror of
https://codeberg.org/Hyperpipe/Hyperpipe
synced 2025-06-28 13:08:01 +02:00
Delete remote playlists
+ minor ui changes
This commit is contained in:
parent
33fc79a736
commit
fb121317ee
9 changed files with 62 additions and 16 deletions
|
@ -5,8 +5,12 @@ import Btn from './Btn.vue';
|
|||
import SongItem from './SongItem.vue';
|
||||
import AlbumItem from './AlbumItem.vue';
|
||||
|
||||
import { getJsonPiped, getPipedQuery } from '@/scripts/fetch.js';
|
||||
import { useRoute, useWrap, useShare } from '@/scripts/util.js';
|
||||
import {
|
||||
getJsonPiped,
|
||||
getPipedQuery,
|
||||
useAuthRemovePlaylist,
|
||||
} from '@/scripts/fetch.js';
|
||||
import { useVerifyAuth, useRoute, useWrap, useShare } from '@/scripts/util.js';
|
||||
import { useCreatePlaylist, useRemovePlaylist } from '@/scripts/db.js';
|
||||
|
||||
import { useResults, useArtist } from '@/stores/results.js';
|
||||
|
@ -103,6 +107,20 @@ const shuffleAdd = () => {
|
|||
});
|
||||
}
|
||||
},
|
||||
removePlaylist = async id => {
|
||||
if (!id && !prompt('Confirm?')) return;
|
||||
|
||||
if (useVerifyAuth(id)) {
|
||||
const { message } = await useAuthRemovePlaylist(id);
|
||||
if (message != 'ok') {
|
||||
alert(message);
|
||||
return;
|
||||
}
|
||||
} else useRemovePlaylist(id);
|
||||
|
||||
useRoute('/library');
|
||||
nav.state.page = 'library';
|
||||
},
|
||||
getSearch = q => {
|
||||
if (q) {
|
||||
const pq = useWrap(q);
|
||||
|
@ -252,12 +270,10 @@ onDeactivated(() => {
|
|||
@click="shuffleAdd"></button>
|
||||
|
||||
<button
|
||||
v-if="results.items?.songs?.title.startsWith('Local • ')"
|
||||
v-if="results.items?.songs?.items?.[0]?.playlistId"
|
||||
class="bi bi-trash3 clickable"
|
||||
@click="
|
||||
useRemovePlaylist(
|
||||
results.items?.songs?.title?.replace('Local • ', ''),
|
||||
)
|
||||
removePlaylist(results.items?.songs?.items?.[0]?.playlistId)
|
||||
"></button>
|
||||
</div>
|
||||
</Transition>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue