fix(library): open track details by path, not from the whole library
Track details from the queue, a playlist or a smart playlist looked the track up in libraryStore's whole-library array, and returned silently when it had not loaded, so the menu item did nothing. That dependency is also why every track was fetched eagerly at startup (20.5 MB at 26k tracks). GetTracksByPaths answers for the paths in hand, and trackCache holds the answers: bounded, coalesced into one call per task, and forgetting what the retag, removal and scan events name. Every opener, and track-details' own refresh after a save, go through it. A source sweep pins the whole-library array to the store and the Tracks view. Closes #279
This commit is contained in:
1 parent
3cddf70c4d
commit
4a9fe1d207
14 files changed
+747
-270
No files matched your search
@@ -51,8 +51,12 @@ describe('track-details stays out of the startup chunk', () => {
|
||||
},
|
||||
);
|
||||
|
||||
// Directly, or through `utils/track-details-opener`, which awaits
|
||||
// it and is what the path-keyed openers share (#279).
|
||||
it.each(OPENERS)('%s loads it at the point of use', (_name, source) => {
|
||||
expect(source).toContain('loadTrackDetails');
|
||||
expect(source).toMatch(
|
||||
/loadTrackDetails|showTrackDetailsForPath|showBatchTrackDetailsForPaths/,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user