feat(17-01): add TrackMetadataChanged handler and remove selection gate on Track Details
- LibraryStore now listens for TrackMetadataChanged and invalidates all caches - Track Details context menu item visible for any right-clicked track in all 4 views - Removed selectionCount === 1 gate from track-list, queue-panel, cover-grid, playlist-details
This commit is contained in:
@@ -2049,9 +2049,7 @@ export class CoverGrid
|
|||||||
</wa-dropdown-item>
|
</wa-dropdown-item>
|
||||||
${this.contextMenuTarget
|
${this.contextMenuTarget
|
||||||
.kind ===
|
.kind ===
|
||||||
'track' &&
|
'track'
|
||||||
this.selectedTracks
|
|
||||||
.size === 1
|
|
||||||
? html`
|
? html`
|
||||||
<wa-dropdown-item
|
<wa-dropdown-item
|
||||||
@click=${() =>
|
@click=${() =>
|
||||||
|
|||||||
@@ -1489,27 +1489,21 @@ export class PlaylistDetails
|
|||||||
? `Remove from ${this.favCtrl.playlistName}`
|
? `Remove from ${this.favCtrl.playlistName}`
|
||||||
: `Add to ${this.favCtrl.playlistName}`}
|
: `Add to ${this.favCtrl.playlistName}`}
|
||||||
</wa-dropdown-item>
|
</wa-dropdown-item>
|
||||||
${this.selection
|
<wa-dropdown-item
|
||||||
.selectionCount ===
|
@click=${() =>
|
||||||
1
|
this.onContextMenuAction(
|
||||||
? html`
|
'track-details',
|
||||||
<wa-dropdown-item
|
)}
|
||||||
@click=${() =>
|
@mouseenter=${() =>
|
||||||
this.onContextMenuAction(
|
this.ctxMenu.closePlaylistSubmenu()}
|
||||||
'track-details',
|
>
|
||||||
)}
|
<wa-icon
|
||||||
@mouseenter=${() =>
|
slot="icon"
|
||||||
this.ctxMenu.closePlaylistSubmenu()}
|
name="circle-info"
|
||||||
>
|
></wa-icon>
|
||||||
<wa-icon
|
Track
|
||||||
slot="icon"
|
Details
|
||||||
name="circle-info"
|
</wa-dropdown-item>
|
||||||
></wa-icon>
|
|
||||||
Track
|
|
||||||
Details
|
|
||||||
</wa-dropdown-item>
|
|
||||||
`
|
|
||||||
: nothing}
|
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: nothing}
|
: nothing}
|
||||||
|
|||||||
@@ -1549,26 +1549,21 @@ export class QueuePanel
|
|||||||
></wa-icon>
|
></wa-icon>
|
||||||
${this.favCtrl.allFavorited(this.getSelectedFilePaths()) ? `Remove from ${this.favCtrl.playlistName}` : `Add to ${this.favCtrl.playlistName}`}
|
${this.favCtrl.allFavorited(this.getSelectedFilePaths()) ? `Remove from ${this.favCtrl.playlistName}` : `Add to ${this.favCtrl.playlistName}`}
|
||||||
</wa-dropdown-item>
|
</wa-dropdown-item>
|
||||||
${this.selection
|
<wa-dropdown-item
|
||||||
.selectionCount === 1
|
@click=${() =>
|
||||||
? html`
|
this.onContextMenuAction(
|
||||||
<wa-dropdown-item
|
'track-details',
|
||||||
@click=${() =>
|
)}
|
||||||
this.onContextMenuAction(
|
@mouseenter=${() =>
|
||||||
'track-details',
|
this.ctxMenu.closePlaylistSubmenu()}
|
||||||
)}
|
>
|
||||||
@mouseenter=${() =>
|
<wa-icon
|
||||||
this.ctxMenu.closePlaylistSubmenu()}
|
slot="icon"
|
||||||
>
|
name="circle-info"
|
||||||
<wa-icon
|
></wa-icon>
|
||||||
slot="icon"
|
Track
|
||||||
name="circle-info"
|
Details
|
||||||
></wa-icon>
|
</wa-dropdown-item>
|
||||||
Track
|
|
||||||
Details
|
|
||||||
</wa-dropdown-item>
|
|
||||||
`
|
|
||||||
: nothing}
|
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: nothing}
|
: nothing}
|
||||||
|
|||||||
@@ -1963,24 +1963,20 @@ export class TrackList extends LitElement implements SelectionHost, ContextMenuH
|
|||||||
></wa-icon>
|
></wa-icon>
|
||||||
${this.favCtrl.allFavorited(this.selection.getSelectedKeysOrdered()) ? `Remove from ${this.favCtrl.playlistName}` : `Add to ${this.favCtrl.playlistName}`}
|
${this.favCtrl.allFavorited(this.selection.getSelectedKeysOrdered()) ? `Remove from ${this.favCtrl.playlistName}` : `Add to ${this.favCtrl.playlistName}`}
|
||||||
</wa-dropdown-item>
|
</wa-dropdown-item>
|
||||||
${this.selection.selectionCount === 1
|
<wa-dropdown-item
|
||||||
? html`
|
@click=${() =>
|
||||||
<wa-dropdown-item
|
this.onContextMenuAction(
|
||||||
@click=${() =>
|
'track-details',
|
||||||
this.onContextMenuAction(
|
)}
|
||||||
'track-details',
|
@mouseenter=${() =>
|
||||||
)}
|
this.ctxMenu.closePlaylistSubmenu()}
|
||||||
@mouseenter=${() =>
|
>
|
||||||
this.ctxMenu.closePlaylistSubmenu()}
|
<wa-icon
|
||||||
>
|
slot="icon"
|
||||||
<wa-icon
|
name="circle-info"
|
||||||
slot="icon"
|
></wa-icon>
|
||||||
name="circle-info"
|
Track Details
|
||||||
></wa-icon>
|
</wa-dropdown-item>
|
||||||
Track Details
|
|
||||||
</wa-dropdown-item>
|
|
||||||
`
|
|
||||||
: nothing}
|
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: nothing}
|
: nothing}
|
||||||
|
|||||||
@@ -82,6 +82,9 @@ class LibraryStore {
|
|||||||
this.changeGen++;
|
this.changeGen++;
|
||||||
this.notify();
|
this.notify();
|
||||||
});
|
});
|
||||||
|
EventsOn(Events.TrackMetadataChanged, () => {
|
||||||
|
this.invalidate();
|
||||||
|
});
|
||||||
|
|
||||||
this.loadCoverSize();
|
this.loadCoverSize();
|
||||||
this.deferEagerFetch();
|
this.deferEagerFetch();
|
||||||
|
|||||||
Reference in New Issue
Block a user