From 021910bce38ceeb040b8e1d5e25df1d08ff54af0 Mon Sep 17 00:00:00 2001 From: Yoshi Askharoun Date: Fri, 28 Apr 2023 19:07:04 -0500 Subject: [PATCH] Always wait for library scan to finish before continuing initialization --- ZuneShell/Microsoft/Zune/Shell/ZuneApplication.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ZuneShell/Microsoft/Zune/Shell/ZuneApplication.cs b/ZuneShell/Microsoft/Zune/Shell/ZuneApplication.cs index d3ffc8b..9a51c78 100644 --- a/ZuneShell/Microsoft/Zune/Shell/ZuneApplication.cs +++ b/ZuneShell/Microsoft/Zune/Shell/ZuneApplication.cs @@ -174,7 +174,10 @@ namespace Microsoft.Zune.Shell }; var localCore = new StrixMusic.Cores.LocalFiles.LocalFilesCore( - id, settings, fileService, null, null); + id, settings, fileService, null, null) + { + ScannerWaitBehavior = StrixMusic.Cores.Files.ScannerWaitBehavior.AlwaysWait + }; var prefs = new MergedCollectionConfig { @@ -222,7 +225,7 @@ namespace Microsoft.Zune.Shell { library.TracksChanged -= LibraryTracksChanged; - ITrack firstTrack = addedItems[0].Data; + ITrack firstTrack = addedItems[1].Data; await firstTrack.PlayArtistCollectionAsync(); } @@ -230,6 +233,7 @@ namespace Microsoft.Zune.Shell private static async void LibraryTracksAdded(object sender, int count) { + return; if (sender is ILibrary library && count > 0) { library.TracksCountChanged -= LibraryTracksAdded;