mirror of
https://github.com/QL-Win/QuickLook.git
synced 2025-09-12 02:09:05 +00:00
handle TagLib exception
This commit is contained in:
@@ -146,9 +146,11 @@ namespace QuickLook.Plugin.VideoViewer
|
||||
if (ShowVideo)
|
||||
return;
|
||||
|
||||
try
|
||||
{
|
||||
using (var h = File.Create(path))
|
||||
{
|
||||
metaTitle.Text = h.Tag.Title;
|
||||
metaTitle.Text = !string.IsNullOrWhiteSpace(h.Tag.Title) ? h.Tag.Title : Path.GetFileName(path);
|
||||
metaArtists.Text = h.Tag.FirstPerformer;
|
||||
metaAlbum.Text = h.Tag.Album;
|
||||
|
||||
@@ -161,6 +163,13 @@ namespace QuickLook.Plugin.VideoViewer
|
||||
DetermineTheme();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
metaTitle.Text = Path.GetFileName(path);
|
||||
metaArtists.Text = metaAlbum.Text = string.Empty;
|
||||
}
|
||||
|
||||
metaArtists.Visibility = string.IsNullOrEmpty(metaArtists.Text)
|
||||
? Visibility.Collapsed
|
||||
: Visibility.Visible;
|
||||
|
Reference in New Issue
Block a user