|
@@ -8,126 +8,128 @@
|
|
|
private bool IsExpand;
|
|
|
}
|
|
|
|
|
|
-<table class="table w-100">
|
|
|
- <tbody>
|
|
|
+<div class="table-responsive">
|
|
|
+ <table class="table w-100">
|
|
|
+ <tbody>
|
|
|
|
|
|
- @if (Playlist != null)
|
|
|
- {
|
|
|
- var arr = PlaylistHelper[Playlist.Value.Key];
|
|
|
+ @if (Playlist != null)
|
|
|
+ {
|
|
|
+ var arr = PlaylistHelper[Playlist.Value.Key];
|
|
|
|
|
|
- <tr>
|
|
|
- <td class="w-0" style="width:0" @onclick="()=>{IsExpand=!IsExpand;}">
|
|
|
- <button type="button" class="btn btn-primary p-2">
|
|
|
- @if (IsExpand)
|
|
|
- {
|
|
|
- <i class="bi bi-dash-square"></i>
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- <i class="bi bi-plus-square"></i>
|
|
|
- }
|
|
|
- </button>
|
|
|
- </td>
|
|
|
- <td class="text-left w-100 align-middle" @onclick="()=>{IsExpand=!IsExpand;}" colspan="2">
|
|
|
- <div class="text-nowrap">@Playlist.Value.Value</div>
|
|
|
- <div class="text-nowrap text-muted">
|
|
|
- (@arr.Count)
|
|
|
- @arr.Sum(p=>DataSet.AllTracks.Where(q=>q.Path==p).Select(q=>q.Tag?.Duration??0).FirstOrDefault()).SecondToDur()
|
|
|
- @arr.Sum(p=>DataSet.AllTracks.Where(q=>q.Path==p).Select(q=>q.Tag?.Length??0).FirstOrDefault()).BytesToFileSize()
|
|
|
- </div>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- <button type="button" class="btn btn-primary p-2" @onclick="()=>DownloadPlaylist(Playlist.Value.Key)">
|
|
|
- <i class="bi bi-download"></i>
|
|
|
- </button>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- <button type="button" class="btn btn-primary p-2" @onclick="()=>EditPlaylist.InvokeAsync(Playlist.Value.Key)">
|
|
|
- <i class="bi bi-pencil-square"></i>
|
|
|
- </button>
|
|
|
- </td>
|
|
|
- <td class="align-middle text-nowrap">
|
|
|
- <button type="button" class="btn btn-primary p-2" @onclick="()=>DeletePlaylist.InvokeAsync(Playlist.Value.Key)">
|
|
|
- <i class="bi bi-trash"></i>
|
|
|
- </button>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
+ <tr class="table-primary">
|
|
|
+ <td class="w-0" style="width:0" @onclick="()=>{IsExpand=!IsExpand;}">
|
|
|
+ <button type="button" class="btn btn-primary p-2">
|
|
|
+ @if (IsExpand)
|
|
|
+ {
|
|
|
+ <i class="bi bi-dash-square"></i>
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ <i class="bi bi-plus-square"></i>
|
|
|
+ }
|
|
|
+ </button>
|
|
|
+ </td>
|
|
|
+ <td class="text-left w-100 align-middle" @onclick="()=>{IsExpand=!IsExpand;}" colspan="2">
|
|
|
+ <div class="text-nowrap">@Playlist.Value.Value</div>
|
|
|
+ <div class="text-nowrap text-muted">
|
|
|
+ (@arr.Count)
|
|
|
+ @arr.Sum(p=>DataSet.AllTracks.Where(q=>q.Path==p).Select(q=>q.Tag?.Duration??0).FirstOrDefault()).SecondToDur()
|
|
|
+ @arr.Sum(p=>DataSet.AllTracks.Where(q=>q.Path==p).Select(q=>q.Tag?.Length??0).FirstOrDefault()).BytesToFileSize()
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <button type="button" class="btn btn-primary p-2" @onclick="()=>DownloadPlaylist(Playlist.Value.Key)">
|
|
|
+ <i class="bi bi-download"></i>
|
|
|
+ </button>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <button type="button" class="btn btn-primary p-2" @onclick="()=>EditPlaylist.InvokeAsync(Playlist.Value.Key)">
|
|
|
+ <i class="bi bi-pencil-square"></i>
|
|
|
+ </button>
|
|
|
+ </td>
|
|
|
+ <td class="align-middle text-nowrap">
|
|
|
+ <button type="button" class="btn btn-primary p-2" @onclick="()=>DeletePlaylist.InvokeAsync(Playlist.Value.Key)">
|
|
|
+ <i class="bi bi-trash"></i>
|
|
|
+ </button>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
|
|
|
- @if (IsExpand)
|
|
|
- {
|
|
|
- @foreach (var item in arr.KeepNoEmpty().WithIndex())
|
|
|
+ @if (IsExpand)
|
|
|
{
|
|
|
- if (item.item != null)
|
|
|
+ @foreach (var item in arr.KeepNoEmpty().WithIndex())
|
|
|
{
|
|
|
- var track = DataSet.AllTracks.FirstOrDefault(p => p.Path == item.item);
|
|
|
- if (track != null)
|
|
|
+ if (item.item != null)
|
|
|
{
|
|
|
- <tr>
|
|
|
- <td colspan="2" style="width:0">
|
|
|
- <img src="@track.Disc.CoverPath" style="height:50px" />
|
|
|
- </td>
|
|
|
- <td class="align-middle w-100">
|
|
|
- <div class="text-nowrap">
|
|
|
- <FileIcon FileName="@track.Name"></FileIcon>
|
|
|
- @track.GetTitleOrFilename()
|
|
|
- </div>
|
|
|
- <div class="text-nowrap text-muted"> @track.Tag?.Artist</div>
|
|
|
- </td>
|
|
|
- <td class="text-center" colspan="2">
|
|
|
- <div class="text-nowrap">@track.Tag?.Duration.SecondToDur()</div>
|
|
|
- <div class="text-nowrap text-muted"> @track.Tag?.Length.BytesToFileSize()</div>
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- <button type="button" class="btn btn-primary p-2" @onclick="()=>Remove(Playlist.Value.Key, item.index,item.item)">
|
|
|
- <i class="bi bi-folder-minus"></i>
|
|
|
- </button>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
+ var track = DataSet.AllTracks.FirstOrDefault(p => p.Path == item.item);
|
|
|
+ if (track != null)
|
|
|
+ {
|
|
|
+ <tr class="mouse-hilight">
|
|
|
+ <td colspan="2" style="width:0">
|
|
|
+ <img src="@track.Disc.CoverPath" style="height:50px" />
|
|
|
+ </td>
|
|
|
+ <td class="align-middle w-100">
|
|
|
+ <div class="text-nowrap">
|
|
|
+ <FileIcon FileName="@track.Name"></FileIcon>
|
|
|
+ @track.GetTitleOrFilename()
|
|
|
+ </div>
|
|
|
+ <div class="text-nowrap text-muted"> @track.Tag?.Artist</div>
|
|
|
+ </td>
|
|
|
+ <td class="text-center" colspan="2">
|
|
|
+ <div class="text-nowrap">@track.Tag?.Duration.SecondToDur()</div>
|
|
|
+ <div class="text-nowrap text-muted"> @track.Tag?.Length.BytesToFileSize()</div>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ <button type="button" class="btn btn-primary p-2" @onclick="()=>Remove(Playlist.Value.Key, item.index,item.item)">
|
|
|
+ <i class="bi bi-folder-minus"></i>
|
|
|
+ </button>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var uri = new Uri(item.item);
|
|
|
+ var paths = uri.AbsolutePath.Split('/').Skip(2).ToArray();
|
|
|
+ <tr>
|
|
|
+ <td></td>
|
|
|
+ <td><img src="blazor-192.png" style="height:50px" /></td>
|
|
|
+ <td class="align-middle w-100">
|
|
|
+ <div class="text-nowrap">- broken reference -</div>
|
|
|
+ @foreach (var p in paths)
|
|
|
+ {
|
|
|
+ <div class="text-nowrap text-muted">@Uri.UnescapeDataString(p)</div>
|
|
|
+ }
|
|
|
+ </td>
|
|
|
+ <td></td>
|
|
|
+ <td></td>
|
|
|
+ <td>
|
|
|
+ <button type="button" class="btn btn-primary p-2" @onclick="()=>Remove(Playlist.Value.Key, item.index,item.item)">
|
|
|
+ <i class="bi bi-trash"></i>
|
|
|
+ </button>
|
|
|
+ </td>
|
|
|
+ <td></td>
|
|
|
+ <td></td>
|
|
|
+ </tr>
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- var uri = new Uri(item.item);
|
|
|
- var paths = uri.AbsolutePath.Split('/').Skip(2).ToArray();
|
|
|
<tr>
|
|
|
<td></td>
|
|
|
- <td><img src="blazor-192.png" style="height:50px" /></td>
|
|
|
+ <td></td>
|
|
|
<td class="align-middle w-100">
|
|
|
- <div class="text-nowrap">- broken reference -</div>
|
|
|
- @foreach (var p in paths)
|
|
|
- {
|
|
|
- <div class="text-nowrap text-muted">@Uri.UnescapeDataString(p)</div>
|
|
|
- }
|
|
|
+ <div class="text-nowrap">- empty -</div>
|
|
|
</td>
|
|
|
<td></td>
|
|
|
<td></td>
|
|
|
- <td>
|
|
|
- <button type="button" class="btn btn-primary p-2" @onclick="()=>Remove(Playlist.Value.Key, item.index,item.item)">
|
|
|
- <i class="bi bi-trash"></i>
|
|
|
- </button>
|
|
|
- </td>
|
|
|
- <td></td>
|
|
|
<td></td>
|
|
|
</tr>
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- <tr>
|
|
|
- <td></td>
|
|
|
- <td></td>
|
|
|
- <td class="align-middle w-100">
|
|
|
- <div class="text-nowrap">- empty -</div>
|
|
|
- </td>
|
|
|
- <td></td>
|
|
|
- <td></td>
|
|
|
- <td></td>
|
|
|
- </tr>
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- </tbody>
|
|
|
-</table>
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+</div>
|
|
|
|
|
|
@code {
|
|
|
private void DownloadPlaylist(Guid playlistId)
|