Add compatibility with Windows in paths
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Jellyfin.Plugin.TubeArchivistMetadata.Utilities
|
||||
@@ -53,5 +55,25 @@ namespace Jellyfin.Plugin.TubeArchivistMetadata.Utilities
|
||||
|
||||
return description;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get video name from file path on the disk.
|
||||
/// </summary>
|
||||
/// <param name="path">File path on disk.</param>
|
||||
/// <returns></returns>
|
||||
public static string GetVideoNameFromPath(string path)
|
||||
{
|
||||
return path.Split(Path.DirectorySeparatorChar).Last().Split(".").First();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get channel name from directory path on the disk.
|
||||
/// </summary>
|
||||
/// <param name="path">Directory path on disk.</param>
|
||||
/// <returns></returns>
|
||||
public static string GetChannelNameFromPath(string path)
|
||||
{
|
||||
return path.Split(Path.DirectorySeparatorChar).Last();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user