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,10 +1489,6 @@ 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
|
|
||||||
.selectionCount ===
|
|
||||||
1
|
|
||||||
? html`
|
|
||||||
<wa-dropdown-item
|
<wa-dropdown-item
|
||||||
@click=${() =>
|
@click=${() =>
|
||||||
this.onContextMenuAction(
|
this.onContextMenuAction(
|
||||||
@@ -1508,8 +1504,6 @@ export class PlaylistDetails
|
|||||||
Track
|
Track
|
||||||
Details
|
Details
|
||||||
</wa-dropdown-item>
|
</wa-dropdown-item>
|
||||||
`
|
|
||||||
: nothing}
|
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: nothing}
|
: nothing}
|
||||||
|
|||||||
@@ -1549,9 +1549,6 @@ 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
|
|
||||||
.selectionCount === 1
|
|
||||||
? html`
|
|
||||||
<wa-dropdown-item
|
<wa-dropdown-item
|
||||||
@click=${() =>
|
@click=${() =>
|
||||||
this.onContextMenuAction(
|
this.onContextMenuAction(
|
||||||
@@ -1567,8 +1564,6 @@ export class QueuePanel
|
|||||||
Track
|
Track
|
||||||
Details
|
Details
|
||||||
</wa-dropdown-item>
|
</wa-dropdown-item>
|
||||||
`
|
|
||||||
: nothing}
|
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: nothing}
|
: nothing}
|
||||||
|
|||||||
@@ -1963,8 +1963,6 @@ 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
|
|
||||||
? html`
|
|
||||||
<wa-dropdown-item
|
<wa-dropdown-item
|
||||||
@click=${() =>
|
@click=${() =>
|
||||||
this.onContextMenuAction(
|
this.onContextMenuAction(
|
||||||
@@ -1979,8 +1977,6 @@ export class TrackList extends LitElement implements SelectionHost, ContextMenuH
|
|||||||
></wa-icon>
|
></wa-icon>
|
||||||
Track Details
|
Track Details
|
||||||
</wa-dropdown-item>
|
</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