[F] Fix imports
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { artistAndAlbum } from "../../shared/tools.ts";
|
import { artistAndAlbum } from "$lib/utils"
|
||||||
import type { NeteaseSong } from "$lib/types.ts";
|
import type { NeteaseSong } from "$lib/types"
|
||||||
import ImageListItem from "./ImageListItem.svelte";
|
import ImageListItem from "./ImageListItem.svelte"
|
||||||
|
|
||||||
let { info }: { info: NeteaseSong } = $props();
|
let { info }: { info: NeteaseSong } = $props()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ImageListItem photoUrl={info.al.picUrl} title={info.name} text={artistAndAlbum(info)} />
|
<ImageListItem photoUrl={info.al.picUrl} title={info.name} text={artistAndAlbum(info)} />
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import AppBar from "../components/appbar/AppBar.svelte";
|
import AppBar from "$lib/ui/appbar/AppBar.svelte";
|
||||||
import TitleHeader from "../components/TitleHeader.svelte";
|
import TitleHeader from "$lib/ui/TitleHeader.svelte";
|
||||||
import SongInfo from "../components/listitem/SongInfo.svelte";
|
import SongInfo from "$lib/ui/listitem/SongInfo.svelte";
|
||||||
import type { PageProps } from "./$types";
|
import type { PageProps } from "./$types";
|
||||||
import Button from "../components/Button.svelte";
|
import Button from "$lib/ui/Button.svelte";
|
||||||
import { Layer } from "m3-svelte";
|
import { Layer } from "m3-svelte";
|
||||||
import { goto } from "$app/navigation";
|
import { goto } from "$app/navigation";
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { TextFieldOutlined } from "m3-svelte"
|
import { TextFieldOutlined } from "m3-svelte"
|
||||||
import AppBar from "$lib/ui/appbar/AppBar.svelte"
|
import AppBar from "$lib/ui/appbar/AppBar.svelte"
|
||||||
import Button from "$lib/ui/button/Button.svelte"
|
import Button from "$lib/ui/Button.svelte"
|
||||||
import type { NeteaseSong } from "$lib/types"
|
import type { NeteaseSong } from "$lib/types"
|
||||||
import { API } from "$lib/client"
|
import { API } from "$lib/client"
|
||||||
import ErrorDialog from "$lib/ui/status/ErrorDialog.svelte";
|
import ErrorDialog from "$lib/ui/status/ErrorDialog.svelte"
|
||||||
import ProgressList from "./ProgressList.svelte";
|
import ProgressList from "./ProgressList.svelte"
|
||||||
|
|
||||||
let link = $state('')
|
let link = $state('')
|
||||||
|
|
||||||
@@ -34,14 +34,14 @@
|
|||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
let listTitle = $derived(status === 'idle' ? '' : (status === 'importing' ? '正在导入' : (status === 'success' ? '导入完成' : '导入出错')));
|
let listTitle = $derived(status === 'idle' ? '' : (status === 'importing' ? '正在导入' : (status === 'success' ? '导入完成' : '导入出错')))
|
||||||
let listSubtitle = $derived(`${progress.done} / ${progress.total} 首歌曲`);
|
let listSubtitle = $derived(`${progress.done} / ${progress.total} 首歌曲`)
|
||||||
let listPercent = $derived(progress.total ? progress.done / progress.total * 100 : 0);
|
let listPercent = $derived(progress.total ? progress.done / progress.total * 100 : 0)
|
||||||
let listItems = $derived(songs.map(song => ({
|
let listItems = $derived(songs.map(song => ({
|
||||||
title: song.song.name,
|
title: song.song.name,
|
||||||
subtitle: song.song.ar.map(a => a.name).join(', '),
|
subtitle: song.song.ar.map(a => a.name).join(', '),
|
||||||
icon: statusToIcon(song.status)
|
icon: statusToIcon(song.status)
|
||||||
})));
|
})))
|
||||||
|
|
||||||
async function startImport() {
|
async function startImport() {
|
||||||
if (!link) return
|
if (!link) return
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { PageProps } from "./$types"
|
import type { PageProps } from "./$types"
|
||||||
import { goto } from "$app/navigation";
|
import { goto } from "$app/navigation"
|
||||||
import AppBar from "$lib/ui/appbar/AppBar.svelte";
|
import AppBar from "$lib/ui/appbar/AppBar.svelte"
|
||||||
import Button from "$lib/ui/button/Button.svelte";
|
import Button from "$lib/ui/Button.svelte"
|
||||||
import SongInfo from "$lib/ui/listitem/SongInfo.svelte";
|
import SongInfo from "$lib/ui/listitem/SongInfo.svelte"
|
||||||
import { API } from "$lib/client";
|
import { API } from "$lib/client"
|
||||||
|
|
||||||
let { data }: PageProps = $props()
|
let { data }: PageProps = $props()
|
||||||
|
|
||||||
@@ -23,10 +23,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function startPractice() {
|
async function startPractice() {
|
||||||
if (songs.length === 0) return;
|
if (songs.length === 0) return
|
||||||
|
|
||||||
const firstIndex = 0;
|
const firstIndex = 0
|
||||||
const firstSong = songs[firstIndex];
|
const firstSong = songs[firstIndex]
|
||||||
|
|
||||||
data.user.data.loc = {
|
data.user.data.loc = {
|
||||||
currentPlaylistId: meta.id,
|
currentPlaylistId: meta.id,
|
||||||
@@ -35,10 +35,10 @@
|
|||||||
playMode: 'sequential',
|
playMode: 'sequential',
|
||||||
isFinished: false,
|
isFinished: false,
|
||||||
lastResultId: null
|
lastResultId: null
|
||||||
};
|
}
|
||||||
|
|
||||||
await API.saveUserData({ loc: data.user.data.loc });
|
await API.saveUserData({ loc: data.user.data.loc })
|
||||||
goto(`/song/${firstSong.id}`);
|
goto(`/song/${firstSong.id}`)
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user