|
@@ -1,16 +1,14 @@
|
|
-using Microsoft.VisualBasic.FileIO;
|
|
|
|
|
|
+using FNZCM.Core;
|
|
|
|
+using Microsoft.VisualBasic.FileIO;
|
|
using System;
|
|
using System;
|
|
using System.Collections.Concurrent;
|
|
using System.Collections.Concurrent;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
-using System.Dynamic;
|
|
|
|
using System.IO;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Net;
|
|
-using System.Reflection.Emit;
|
|
|
|
using System.Text;
|
|
using System.Text;
|
|
using System.Threading;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using System.Threading.Tasks;
|
|
-using FNZCM.Core;
|
|
|
|
using SearchOption = Microsoft.VisualBasic.FileIO.SearchOption;
|
|
using SearchOption = Microsoft.VisualBasic.FileIO.SearchOption;
|
|
|
|
|
|
namespace FNZCM.ConHost.Ver2
|
|
namespace FNZCM.ConHost.Ver2
|
|
@@ -103,7 +101,7 @@ namespace FNZCM.ConHost.Ver2
|
|
|
|
|
|
PathMapping[$"/media/{libPath}/{discPath}/{trackPath}"] = mainTrackFile;
|
|
PathMapping[$"/media/{libPath}/{discPath}/{trackPath}"] = mainTrackFile;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if (Directory.Exists(bkDir))
|
|
if (Directory.Exists(bkDir))
|
|
{
|
|
{
|
|
var bkFiles = FileSystem.GetFiles(bkDir, SearchOption.SearchTopLevelOnly, ConfigFile.Instance.BkFilePattern);
|
|
var bkFiles = FileSystem.GetFiles(bkDir, SearchOption.SearchTopLevelOnly, ConfigFile.Instance.BkFilePattern);
|
|
@@ -822,13 +820,21 @@ namespace FNZCM.ConHost.Ver2
|
|
{
|
|
{
|
|
if (false == MediaTags.TryGetValue(internalPath, out var mediaTag) && PathMapping.TryGetValue(internalPath, out var mediaFilePath))
|
|
if (false == MediaTags.TryGetValue(internalPath, out var mediaTag) && PathMapping.TryGetValue(internalPath, out var mediaFilePath))
|
|
{
|
|
{
|
|
- var fi = new FileInfo(mediaFilePath);
|
|
|
|
- using var tagLib = TagLib.File.Create(mediaFilePath);
|
|
|
|
- mediaTag = MediaTags[internalPath] = new MediaTag2(
|
|
|
|
- $"{string.Join(";", tagLib.Tag.Performers)} - {tagLib.Tag.Title}",
|
|
|
|
- (int)tagLib.Properties.Duration.TotalSeconds,
|
|
|
|
- fi.Length
|
|
|
|
- );
|
|
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ var fi = new FileInfo(mediaFilePath);
|
|
|
|
+ using var tagLib = TagLib.File.Create(mediaFilePath);
|
|
|
|
+ mediaTag = MediaTags[internalPath] = new MediaTag2(
|
|
|
|
+ $"{string.Join(";", tagLib.Tag.Performers)} - {tagLib.Tag.Title}",
|
|
|
|
+ (int)tagLib.Properties.Duration.TotalSeconds,
|
|
|
|
+ fi.Length
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ catch (Exception e)
|
|
|
|
+ {
|
|
|
|
+ Console.WriteLine($"ERROR on lookup tags: {mediaFilePath}{Environment.NewLine} {e.Message}");
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
return mediaTag;
|
|
return mediaTag;
|