mirror of
https://github.com/real-zony/ZonyLrcToolsX.git
synced 2026-11-24 03:37:47 +08:00
feat(desktop): 歌词页支持三种来源,加网易云扫码登录
歌词页原先只能扫本地目录。CLI 有三种来源 —— 本地、CSV、网易云歌单 —— 而 网易云那条路在界面上完全走不通。 现在页面有一个来源下拉,以及三行互斥的输入: 本地文件夹 —— 沿用目录选择器 CSV 文件 —— 选一个"歌名,歌手"两列的 .csv 网易云 —— 粘贴一个或多个歌单 ID,用分号分隔 因为网易云那条路需要已登录的会话,这个提交同时加上二维码登录对话框: - QrCodeLoginViewModel 用 QRCoder 把二维码内容渲染成真正的 PNG(CLI 是往日志里 画 ASCII 艺术,在窗口里没法用),下方显示登录状态:等待扫码、已扫码待确认、 成功。 - 关闭对话框即取消登录,而这次能真的停下来,因为扫描器已经接受 CancellationToken(上一个提交)。 - cookie 持久化到 netease.session.json,重启不必重新扫码。页面显示当前是否 已登录:未登录给"登录…"按钮,已登录给"退出登录",退出会同时清掉内存里的 cookie 和文件,下次解析歌单重新扫码。 - 非本地来源还需要指定 .lrc 的落盘目录,因此多一行输出目录,默认 <音乐>/DownloadedLrc。 扫描与下载拆成两步:"解析"把来源返回的歌曲填进表格,"开始下载"才写文件。 进度、逐行状态与取消按钮对三种来源一视同仁。
This commit is contained in:
1 parent
c614315601
commit
c303705ab6
6 files changed
+880
-91
No files matched your search
@@ -24,71 +24,181 @@
|
||||
BoxShadow="0 2 8 0 #0D000000"
|
||||
Padding="24,20"
|
||||
Margin="0,0,0,16">
|
||||
<Grid RowDefinitions="Auto,Auto,Auto,Auto" ColumnDefinitions="Auto,*,Auto"
|
||||
>
|
||||
<!-- Row 0: Folder Selection -->
|
||||
<TextBlock Grid.Row="0" Grid.Column="0"
|
||||
Text="{Binding LyricsFolderLabel}"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="13"
|
||||
FontWeight="Medium" />
|
||||
<TextBox Grid.Row="0" Grid.Column="1"
|
||||
Text="{Binding SelectedFolderPath}"
|
||||
Watermark="{Binding LyricsSelectFolder}"
|
||||
IsReadOnly="True"
|
||||
Margin="16,0" />
|
||||
<Button Grid.Row="0" Grid.Column="2"
|
||||
Content="{Binding LyricsBrowse}"
|
||||
Command="{Binding SelectFolderCommand}"
|
||||
MinWidth="80"
|
||||
HorizontalAlignment="Stretch" />
|
||||
<StackPanel Spacing="0">
|
||||
|
||||
<!-- Separator -->
|
||||
<Border Grid.Row="1" Grid.ColumnSpan="3"
|
||||
Height="1"
|
||||
<!-- Source selector -->
|
||||
<Grid ColumnDefinitions="Auto,*,Auto">
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="{Binding LyricsScannerLabel}"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="13"
|
||||
FontWeight="Medium" />
|
||||
<ComboBox Grid.Column="1"
|
||||
ItemsSource="{Binding ScannerNames}"
|
||||
SelectedIndex="{Binding SelectedScannerIndex}"
|
||||
MinWidth="200"
|
||||
HorizontalAlignment="Left"
|
||||
Margin="16,0" />
|
||||
<Button Grid.Column="2"
|
||||
Content="{Binding LyricsScan}"
|
||||
Command="{Binding StartScanCommand}"
|
||||
IsEnabled="{Binding CanScan}"
|
||||
MinWidth="88" />
|
||||
</Grid>
|
||||
|
||||
<Border Height="1"
|
||||
Background="{DynamicResource SeparatorBrush}"
|
||||
Opacity="0.5"
|
||||
Margin="0,16" />
|
||||
|
||||
<!-- Row 2: Parallel Count + Download Button -->
|
||||
<TextBlock Grid.Row="2" Grid.Column="0"
|
||||
Text="{Binding LyricsParallel}"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="13"
|
||||
FontWeight="Medium" />
|
||||
<NumericUpDown Grid.Row="2" Grid.Column="1"
|
||||
Value="{Binding ParallelCount}"
|
||||
Minimum="1"
|
||||
Maximum="32"
|
||||
Increment="1"
|
||||
Width="100"
|
||||
FormatString="0"
|
||||
HorizontalAlignment="Left"
|
||||
<!-- Input row: switches with the selected scanner -->
|
||||
<Grid ColumnDefinitions="Auto,*,Auto" IsVisible="{Binding IsLocalScanner}">
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="{Binding LyricsFolderLabel}"
|
||||
VerticalAlignment="Center"
|
||||
Margin="16,0" />
|
||||
<StackPanel Grid.Row="2" Grid.Column="2"
|
||||
Orientation="Horizontal" Spacing="8">
|
||||
<Button Command="{Binding StartDownloadCommand}"
|
||||
IsVisible="{Binding !IsDownloading}"
|
||||
IsEnabled="{Binding CanStartDownload}"
|
||||
Classes="accent"
|
||||
MinWidth="120">
|
||||
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||
<PathIcon Data="{StaticResource DownloadIcon}"
|
||||
Width="14" Height="14" />
|
||||
<TextBlock Text="{Binding LyricsStartDownload}"
|
||||
VerticalAlignment="Center" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button Command="{Binding CancelDownloadCommand}"
|
||||
Content="{Binding LyricsStopDownload}"
|
||||
IsVisible="{Binding IsDownloading}"
|
||||
MinWidth="100" />
|
||||
FontSize="13"
|
||||
FontWeight="Medium" />
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding SelectedFolderPath}"
|
||||
Watermark="{Binding LyricsSelectFolder}"
|
||||
IsReadOnly="True"
|
||||
Margin="16,0" />
|
||||
<Button Grid.Column="2"
|
||||
Content="{Binding LyricsBrowse}"
|
||||
Command="{Binding SelectFolderCommand}"
|
||||
MinWidth="88"
|
||||
HorizontalAlignment="Stretch" />
|
||||
</Grid>
|
||||
|
||||
<Grid ColumnDefinitions="Auto,*,Auto" IsVisible="{Binding IsCsvScanner}">
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="{Binding LyricsCsvLabel}"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="13"
|
||||
FontWeight="Medium" />
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding SelectedCsvFilePath}"
|
||||
Watermark="{Binding LyricsCsvSelect}"
|
||||
IsReadOnly="True"
|
||||
Margin="16,0" />
|
||||
<Button Grid.Column="2"
|
||||
Content="{Binding LyricsCsvBrowse}"
|
||||
Command="{Binding SelectCsvFileCommand}"
|
||||
MinWidth="88"
|
||||
HorizontalAlignment="Stretch" />
|
||||
</Grid>
|
||||
|
||||
<StackPanel Spacing="8" IsVisible="{Binding IsNetEaseScanner}">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto">
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="{Binding LyricsSongListLabel}"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="13"
|
||||
FontWeight="Medium" />
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding SongListIds}"
|
||||
Watermark="{Binding LyricsSongListWatermark}"
|
||||
Margin="16,0" />
|
||||
<Button Grid.Column="2"
|
||||
Classes="accent"
|
||||
Content="{Binding NetEaseSignIn}"
|
||||
Command="{Binding SignInNetEaseCommand}"
|
||||
ToolTip.Tip="{Binding NetEaseSignInHint}"
|
||||
IsVisible="{Binding !IsNetEaseLoggedIn}"
|
||||
MinWidth="88" />
|
||||
<Button Grid.Column="2"
|
||||
Content="{Binding NetEaseSignOut}"
|
||||
Command="{Binding SignOutNetEaseCommand}"
|
||||
ToolTip.Tip="{Binding NetEaseSignOutHint}"
|
||||
IsVisible="{Binding IsNetEaseLoggedIn}"
|
||||
MinWidth="88" />
|
||||
</Grid>
|
||||
|
||||
<!-- Account state stays visible even when this scanner is not selected, so the
|
||||
sign-out entry is no longer hidden behind one dropdown value. -->
|
||||
<Grid ColumnDefinitions="Auto,*,Auto">
|
||||
<PathIcon Grid.Column="0"
|
||||
Data="{StaticResource AccountIcon}"
|
||||
Width="13"
|
||||
Height="13"
|
||||
VerticalAlignment="Center"
|
||||
Opacity="0.55" />
|
||||
<TextBlock Grid.Column="1"
|
||||
Text="{Binding NetEaseAccountStatus}"
|
||||
Margin="8,0,0,0"
|
||||
FontSize="12"
|
||||
Opacity="0.6"
|
||||
TextWrapping="Wrap"
|
||||
VerticalAlignment="Center" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Row 3: Progress (spans all columns) -->
|
||||
<StackPanel Grid.Row="3" Grid.ColumnSpan="3"
|
||||
IsVisible="{Binding IsScanning}"
|
||||
<!-- Output directory (only meaningful for csv / netease, but harmless for local) -->
|
||||
<Grid ColumnDefinitions="Auto,*,Auto"
|
||||
Margin="0,12,0,0"
|
||||
IsVisible="{Binding !IsLocalScanner}">
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="{Binding LyricsOutputLabel}"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="13"
|
||||
FontWeight="Medium" />
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding OutputDirectory}"
|
||||
Watermark="{Binding LyricsOutputSelect}"
|
||||
IsReadOnly="True"
|
||||
Margin="16,0" />
|
||||
<Button Grid.Column="2"
|
||||
Content="{Binding LyricsOutputBrowse}"
|
||||
Command="{Binding SelectOutputFolderCommand}"
|
||||
MinWidth="88"
|
||||
HorizontalAlignment="Stretch" />
|
||||
</Grid>
|
||||
|
||||
<Border Height="1"
|
||||
Background="{DynamicResource SeparatorBrush}"
|
||||
Opacity="0.5"
|
||||
Margin="0,16" />
|
||||
|
||||
<!-- Parallel count + download button -->
|
||||
<Grid ColumnDefinitions="Auto,*,Auto">
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="{Binding LyricsParallel}"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="13"
|
||||
FontWeight="Medium" />
|
||||
<NumericUpDown Grid.Column="1"
|
||||
Value="{Binding ParallelCount}"
|
||||
Minimum="1"
|
||||
Maximum="32"
|
||||
Increment="1"
|
||||
Width="100"
|
||||
FormatString="0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Margin="16,0" />
|
||||
<StackPanel Grid.Column="2"
|
||||
Orientation="Horizontal" Spacing="8">
|
||||
<Button Command="{Binding StartDownloadCommand}"
|
||||
IsVisible="{Binding !IsDownloading}"
|
||||
IsEnabled="{Binding CanStartDownload}"
|
||||
Classes="accent"
|
||||
MinWidth="132">
|
||||
<StackPanel Orientation="Horizontal" Spacing="6">
|
||||
<PathIcon Data="{StaticResource DownloadIcon}"
|
||||
Width="14" Height="14" />
|
||||
<TextBlock Text="{Binding LyricsStartDownload}"
|
||||
VerticalAlignment="Center" />
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button Command="{Binding CancelDownloadCommand}"
|
||||
Content="{Binding LyricsStopDownload}"
|
||||
IsVisible="{Binding IsDownloading}"
|
||||
MinWidth="108" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Scan progress -->
|
||||
<StackPanel IsVisible="{Binding IsScanning}"
|
||||
Spacing="8" Margin="0,16,0,0">
|
||||
<ProgressBar Value="{Binding ScanProgressPercentage}"
|
||||
Maximum="100" Height="6" />
|
||||
@@ -100,8 +210,9 @@
|
||||
<Run Text="{Binding ScanTotalCount}" />
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="3" Grid.ColumnSpan="3"
|
||||
IsVisible="{Binding IsDownloading}"
|
||||
|
||||
<!-- Download progress -->
|
||||
<StackPanel IsVisible="{Binding IsDownloading}"
|
||||
Spacing="8" Margin="0,16,0,0">
|
||||
<ProgressBar Value="{Binding ProgressPercentage}"
|
||||
Maximum="100" Height="6" />
|
||||
@@ -111,7 +222,7 @@
|
||||
<Run Text="{Binding TotalCount}" />
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Card 2: File List with Empty State -->
|
||||
|
||||
Reference in new issue
Block a user