ソースを参照

playlist: Minor fix

HOME 2 年 前
コミット
477b892d4a

+ 1 - 1
FNZCM/FNZCM.BlazorWasm/UI/Views/Default/Browse/DiscDialog.razor

@@ -64,7 +64,7 @@
         <div class="row w-100 text-center p-2">
             <span>
                 <div>
-                    @(PendingAddTrack?.Tag?.Title ?? PendingAddTrack?.Name)
+                    @((PendingAddTrack?.Tag?.Title).NullOrEmptyEscape(PendingAddTrack?.Name))
                 </div>
                 <small>
                     @PendingAddTrack?.Tag?.Artist

+ 39 - 20
FNZCM/FNZCM.BlazorWasm/UI/Views/Default/Playlist/PlaylistTableItem.razor

@@ -54,33 +54,52 @@
             if (item.item != null)
             {
                 var track = DataSet.AllTracks.FirstOrDefault(p => p.Path == item.item);
-                <tr>
-                    <td></td>
-                    <td><img src="@track.Disc.CoverPath" style="height:50px" /></td>
-                    <td class="align-middle w-100">@track?.Tag?.Title</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>
-                </tr>
+                if (track != null)
+                {
+
+                    <tr>
+                        <td></td>
+                        <td><img src="@track.Disc.CoverPath" style="height:50px" /></td>
+                        <td class="align-middle w-100 ">
+                            <div class="text-nowrap">@((track.Tag?.Title).NullOrEmptyEscape(track.Name))</div>
+                            <small class="text-nowrap text-muted">@track.Tag?.Duration.SecondToDur() @track.Tag?.Artist</small>
+                        </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>
+                    </tr>
+                }
+                else
+                {
+                    <tr>
+                        <td></td>
+                        <td><img src="blazor-192.png" style="height:50px" /></td>
+                        <td class="align-middle w-100"> - broken reference - </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>
+                    </tr>
+                }
             }
             else
             {
                 <tr>
                     <td></td>
-                    <td><img src="blazor-192.png" style="height:50px" /></td>
-                    <td class="align-middle w-100"> - broken reference - </td>
+                    <td></td>
+                    <td class="align-middle w-100"> - empty - </td>
+                    <td></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>
                 </tr>
             }

+ 0 - 2
FNZCM/FNZCM.BlazorWasm/UI/Views/Default/Playlist/PlaylistView.razor

@@ -17,9 +17,7 @@
             {
                 if (item.Value != null)
                 {
-
                     <PlaylistTableItem Playlist="@item" EditPlaylist="ShowPlaylistEdit" DeletePlaylist="ShowPlaylistDelete"></PlaylistTableItem>
-
                 }
                 else
                 {