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