Fix external audio tracks not shown correctly in tracks context menu

This commit is contained in:
stax76
2022-07-30 11:26:45 +02:00
parent f2dd6205b5
commit 1ad819fa9d
2 changed files with 4 additions and 2 deletions

View File

@@ -7,6 +7,7 @@
- Support of shortcuts (.lnk files) with media file target. - Support of shortcuts (.lnk files) with media file target.
- playlist-random command jumps to a random playlist entry, default key binding is F9. - playlist-random command jumps to a random playlist entry, default key binding is F9.
- Fix OSC hide behavior on mouse move. - Fix OSC hide behavior on mouse move.
- Fix external audio tracks not shown correctly in tracks context menu.
- New binding to show the current file in File Explorer. - New binding to show the current file in File Explorer.
- Shift key enables `process-instance=multi`. - Shift key enables `process-instance=multi`.
- Command line syntax (preceding double hyphen) is supported in mpv.conf for options implemented by mpv.net. - Command line syntax (preceding double hyphen) is supported in mpv.conf for options implemented by mpv.net.

View File

@@ -1524,12 +1524,13 @@ namespace mpvnet
public void UpdateExternalTracks() public void UpdateExternalTracks()
{ {
int trackCount = GetPropertyInt("track-list/count"); int trackListTrackCount = GetPropertyInt("track-list/count");
int editionCount = GetPropertyInt("edition-list/count"); int editionCount = GetPropertyInt("edition-list/count");
int count = MediaTracks.Where(i => i.Type != "g").Count();
lock (MediaTracksLock) lock (MediaTracksLock)
{ {
if (MediaTracks.Count != (trackCount + editionCount)) if (count != (trackListTrackCount + editionCount))
{ {
MediaTracks = MediaTracks.Where(i => !i.External).ToList(); MediaTracks = MediaTracks.Where(i => !i.External).ToList();
MediaTracks.AddRange(GetTracks(false)); MediaTracks.AddRange(GetTracks(false));