[+] Update playlist option

This commit is contained in:
2025-11-23 10:32:09 +08:00
parent 3bb4ff8e9a
commit 44d99dc8c1
7 changed files with 23 additions and 13 deletions
+3 -1
View File
@@ -37,6 +37,7 @@ export default {
tip: 'Go to NetEase Music App, find a Japanese playlist you like, click share, copy link, and paste it here to start importing!',
inputLabel: 'NetEase Playlist Link / ID',
btnStart: 'Start Import',
btnUpdate: 'Update Playlist',
btnView: 'View Playlist'
}
},
@@ -47,7 +48,8 @@ export default {
count: 'Songs: ',
startPractice: 'Start Practice',
songList: 'Song List',
songs: 'songs'
songs: 'songs',
updateFromNetease: 'Update from NetEase'
},
list: {
mine: 'My Playlists',
+3 -1
View File
@@ -37,6 +37,7 @@ export default {
tip: 'NetEase Musicアプリでお気に入りの日本語プレイリストを見つけ、共有をクリックし、リンクをコピーしてここに貼り付けると、インポートを開始できます!',
inputLabel: 'NetEaseプレイリストリンク / ID',
btnStart: 'インポート開始',
btnUpdate: 'プレイリストを更新',
btnView: 'プレイリストを表示'
}
},
@@ -47,7 +48,8 @@ export default {
count: '曲数: ',
startPractice: '練習開始',
songList: '曲リスト',
songs: '曲'
songs: '曲',
updateFromNetease: 'NetEaseから更新'
},
list: {
mine: 'マイプレイリスト',
+3 -1
View File
@@ -37,6 +37,7 @@ export default {
tip: '去网易云 APP 找一个你喜欢的日本语歌单,点击分享,再点击复制链接,然后把链接粘贴到这里就可以开始导入了!',
inputLabel: '网易云歌单链接 / ID',
btnStart: '开始导入',
btnUpdate: '更新歌单',
btnView: '查看歌单'
}
},
@@ -47,7 +48,8 @@ export default {
count: '歌曲数: ',
startPractice: '开始练习',
songList: '歌曲列表',
songs: '首歌曲'
songs: '首歌曲',
updateFromNetease: '从网易云更新歌单'
},
list: {
mine: '我的歌单',
+1 -1
View File
@@ -226,7 +226,7 @@ export const getSession = (id: string) => sessions.get(id)
* @returns Import session
*/
export async function startImport(link: string, userId?: number): Promise<ImportSession> {
const meta = await getPlaylistRaw(parsePlaylistRef(link))
const meta = await getPlaylistRaw(parsePlaylistRef(link), true)
const importId = crypto.randomUUID()
const session: ImportSession = {
+4 -4
View File
@@ -27,14 +27,14 @@
<LinearProgress percent={percentage ?? 0}/>
<div class="vbox p-content scroll-here gap-8px">
<div class="vbox p-content scroll-here gap-8px overflow-x-hidden">
{#each items as item}
<div class="hbox gap-12px items-center h-40px">
<span class="{item.icon} text-xl"></span>
<div class="vbox">
<span class="m3-font-title-medium">{item.title}</span>
<div class="vbox min-w-0 flex-1">
<span class="m3-font-title-medium truncate">{item.title}</span>
{#if item.subtitle}
<span class="m3-font-body-small mfg-on-surface-variant">{item.subtitle}</span>
<span class="m3-font-body-small mfg-on-surface-variant truncate">{item.subtitle}</span>
{/if}
</div>
</div>
+4 -2
View File
@@ -7,10 +7,12 @@
import ErrorDialog from "$lib/ui/status/ErrorDialog.svelte"
import ProgressList from "$lib/ui/ProgressList.svelte"
import { getI18n } from "$lib/i18n"
import { page } from '$app/state'
const t = getI18n().import.netease
let link = $state('')
let link = $state(page.url.searchParams.get('id') ?? '')
let isUpdate = $derived(!!page.url.searchParams.get('id'))
interface SongImportStatus {
song: NeteaseSong
@@ -91,7 +93,7 @@
<div class="py-16px p-content">
{#if status === 'idle'}
<Button big icon="i-material-symbols:download" onclick={startImport}>{t.btnStart}</Button>
<Button big icon={isUpdate ? "i-material-symbols:sync" : "i-material-symbols:download"} onclick={startImport}>{isUpdate ? t.btnUpdate : t.btnStart}</Button>
{:else if status === 'success'}
<a href="/playlist/{id}">
<Button big icon="i-material-symbols:right-arrow">{t.btnView}</Button>
+5 -3
View File
@@ -6,6 +6,7 @@
import SongInfo from "$lib/ui/listitem/SongInfo.svelte"
import { API } from "$lib/client"
import { getI18n } from "$lib/i18n"
import MenuItem from "$lib/ui/material3/MenuItem.svelte";
const t = getI18n().playlist.detail
@@ -49,9 +50,10 @@
{
icon: isFavorite ? "i-material-symbols:bookmark-rounded" : "i-material-symbols:bookmark-add-outline-rounded",
onclick: toggleFavorite
},
{icon: "i-material-symbols:more-vert", onclick: () => alert('More clicked')}
]} />
}
]}>
<MenuItem icon="i-material-symbols:update" onclick={() => goto(`/import/netease?id=${meta.id}`)}>{t.updateFromNetease}</MenuItem>
</AppBar>
<div class="hbox px-16px py-8px gap-24px">
<img src="{meta.coverImgUrl}" alt="" class="size-128px rounded-16px">