mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-28 12:56:30 +01:00
continue file system rework
This commit is contained in:
@@ -99,6 +99,7 @@ using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using CommonIO;
|
||||
|
||||
namespace MediaBrowser.Server.Startup.Common
|
||||
{
|
||||
|
||||
@@ -12,6 +12,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using CommonIO;
|
||||
|
||||
namespace MediaBrowser.Server.Startup.Common.FFMpeg
|
||||
{
|
||||
|
||||
@@ -8,6 +8,7 @@ using System.IO;
|
||||
using System.Text;
|
||||
using MediaBrowser.Common.IO;
|
||||
using System.Collections.Generic;
|
||||
using CommonIO;
|
||||
|
||||
namespace MediaBrowser.Server.Startup.Common.FFMpeg
|
||||
{
|
||||
|
||||
53
MediaBrowser.Server.Startup.Common/MbLinkShortcutHandler.cs
Normal file
53
MediaBrowser.Server.Startup.Common/MbLinkShortcutHandler.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using CommonIO;
|
||||
|
||||
namespace MediaBrowser.Server.Startup.Common
|
||||
{
|
||||
public class MbLinkShortcutHandler : IShortcutHandler
|
||||
{
|
||||
private readonly IFileSystem _fileSystem;
|
||||
|
||||
public MbLinkShortcutHandler(IFileSystem fileSystem)
|
||||
{
|
||||
_fileSystem = fileSystem;
|
||||
}
|
||||
|
||||
public string Extension
|
||||
{
|
||||
get { return ".mblink"; }
|
||||
}
|
||||
|
||||
public string Resolve(string shortcutPath)
|
||||
{
|
||||
if (string.IsNullOrEmpty(shortcutPath))
|
||||
{
|
||||
throw new ArgumentNullException("filenshortcutPathame");
|
||||
}
|
||||
|
||||
if (string.Equals(Path.GetExtension(shortcutPath), ".mblink", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var path = _fileSystem.ReadAllText(shortcutPath);
|
||||
|
||||
return _fileSystem.NormalizePath(path);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void Create(string shortcutPath, string targetPath)
|
||||
{
|
||||
if (string.IsNullOrEmpty(shortcutPath))
|
||||
{
|
||||
throw new ArgumentNullException("shortcutPath");
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(targetPath))
|
||||
{
|
||||
throw new ArgumentNullException("targetPath");
|
||||
}
|
||||
|
||||
File.WriteAllText(shortcutPath, targetPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,10 +32,17 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="CommonIO">
|
||||
<HintPath>..\packages\CommonIO.1.0.0.3\lib\net45\CommonIO.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Mono.Posix, Version=4.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Mono.Posix.4.0.0.0\lib\net40\Mono.Posix.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Patterns.Logging, Version=1.0.5494.41209, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Patterns.Logging.1.0.0.2\lib\portable-net45+sl4+wp71+win8+wpa81\Patterns.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ServiceStack.Interfaces, Version=4.0.0.0, Culture=neutral, PublicKeyToken=e06fbc6124f57c43, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\ThirdParty\ServiceStack\ServiceStack.Interfaces.dll</HintPath>
|
||||
@@ -63,6 +70,7 @@
|
||||
<Compile Include="FFMpeg\FFMpegInfo.cs" />
|
||||
<Compile Include="FFMpeg\FFmpegValidator.cs" />
|
||||
<Compile Include="INativeApp.cs" />
|
||||
<Compile Include="MbLinkShortcutHandler.cs" />
|
||||
<Compile Include="Migrations\DeleteDlnaProfiles.cs" />
|
||||
<Compile Include="Migrations\DeprecatePlugins.cs" />
|
||||
<Compile Include="Migrations\IVersionMigration.cs" />
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Controller;
|
||||
using System.IO;
|
||||
using CommonIO;
|
||||
|
||||
namespace MediaBrowser.Server.Startup.Common.Migrations
|
||||
{
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Controller;
|
||||
using System.IO;
|
||||
using CommonIO;
|
||||
|
||||
namespace MediaBrowser.Server.Startup.Common.Migrations
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@ using MediaBrowser.Controller;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using CommonIO;
|
||||
|
||||
namespace MediaBrowser.Server.Startup.Common.Migrations
|
||||
{
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="CommonIO" version="1.0.0.3" targetFramework="net45" />
|
||||
<package id="Mono.Posix" version="4.0.0.0" targetFramework="net45" />
|
||||
<package id="Patterns.Logging" version="1.0.0.2" targetFramework="net45" />
|
||||
</packages>
|
||||
Reference in New Issue
Block a user