mirror of
https://github.com/LanZhan-Harmony/WindowsMusicPlayer-TheUntamedMusicPlayer.git
synced 2026-05-07 03:25:48 +08:00
修复不扫描的bug
This commit is contained in:
@@ -83,6 +83,7 @@ public sealed partial class EditAlbumInfoDialog
|
||||
await Task.Run(async () =>
|
||||
{
|
||||
ATL.Settings.ID3v2_tagSubVersion = 3;
|
||||
var hasChanges = false;
|
||||
foreach (var tempSong in _tempSongs)
|
||||
{
|
||||
try
|
||||
@@ -108,12 +109,20 @@ public sealed partial class EditAlbumInfoDialog
|
||||
{
|
||||
_logger.EditingSongInfoIO(tempSong.Title);
|
||||
}
|
||||
else
|
||||
{
|
||||
hasChanges = true;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.EditingSongInfoOther(tempSong.Title, ex);
|
||||
}
|
||||
}
|
||||
if (hasChanges)
|
||||
{
|
||||
_ = Data.MusicLibrary.LoadLibraryAgainAsync();
|
||||
}
|
||||
});
|
||||
|
||||
Data.IsMusicProcessing = false;
|
||||
|
||||
@@ -155,14 +155,18 @@ public sealed partial class EditSongInfoDialog
|
||||
{
|
||||
_logger.EditingSongInfoIO(_title);
|
||||
}
|
||||
else
|
||||
{
|
||||
_ = Data.MusicLibrary.LoadLibraryAgainAsync();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.EditingSongInfoOther(_title, ex);
|
||||
}
|
||||
|
||||
Data.IsMusicProcessing = false;
|
||||
});
|
||||
|
||||
Data.IsMusicProcessing = false;
|
||||
}
|
||||
|
||||
private void OpenFileLocationButton_Click(object sender, RoutedEventArgs e)
|
||||
|
||||
@@ -4,16 +4,24 @@ public static class NetworkHelper
|
||||
{
|
||||
public static async Task<bool> IsInternetAvailableAsync()
|
||||
{
|
||||
try
|
||||
for (var i = 0; i < 3; i++)
|
||||
{
|
||||
using var client = new HttpClient();
|
||||
client.Timeout = TimeSpan.FromSeconds(5);
|
||||
var response = await client.GetAsync("https://music.163.com");
|
||||
return response.IsSuccessStatusCode;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
try
|
||||
{
|
||||
using var client = new HttpClient();
|
||||
client.Timeout = TimeSpan.FromSeconds(5);
|
||||
var response = await client.GetAsync("https://music.163.com");
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
if (i < 2)
|
||||
{
|
||||
await Task.Delay(300);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user