aboutsummaryrefslogtreecommitdiff
path: root/Emby.IsoMounting
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.IsoMounting')
-rw-r--r--Emby.IsoMounting/IsoMounter/IsoMounter.csproj4
-rw-r--r--Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs62
-rw-r--r--Emby.IsoMounting/IsoMounter/LinuxMount.cs2
-rw-r--r--Emby.IsoMounting/IsoMounter/Properties/AssemblyInfo.cs21
4 files changed, 57 insertions, 32 deletions
diff --git a/Emby.IsoMounting/IsoMounter/IsoMounter.csproj b/Emby.IsoMounting/IsoMounter/IsoMounter.csproj
index ee67a1d946..9274f9763a 100644
--- a/Emby.IsoMounting/IsoMounter/IsoMounter.csproj
+++ b/Emby.IsoMounting/IsoMounter/IsoMounter.csproj
@@ -1,6 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
+ <Compile Include="..\..\SharedVersion.cs" Link="SharedVersion.cs" />
+ </ItemGroup>
+
+ <ItemGroup>
<ProjectReference Include="..\..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
<ProjectReference Include="..\..\MediaBrowser.Common\MediaBrowser.Common.csproj" />
</ItemGroup>
diff --git a/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs b/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs
index faaed482a0..ab85cb721a 100644
--- a/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs
+++ b/Emby.IsoMounting/IsoMounter/LinuxIsoManager.cs
@@ -44,13 +44,13 @@ namespace IsoMounter
_logger.LogDebug(
"[{0}] System PATH is currently set to [{1}].",
Name,
- EnvironmentInfo.GetEnvironmentVariable("PATH") ?? ""
+ Environment.GetEnvironmentVariable("PATH") ?? ""
);
_logger.LogDebug(
"[{0}] System path separator is [{1}].",
Name,
- EnvironmentInfo.PathSeparator
+ Path.PathSeparator
);
_logger.LogDebug(
@@ -87,7 +87,7 @@ namespace IsoMounter
UmountCommand
);
- if (!String.IsNullOrEmpty(SudoCommand) && !String.IsNullOrEmpty(MountCommand) && !String.IsNullOrEmpty(UmountCommand)) {
+ if (!string.IsNullOrEmpty(SudoCommand) && !string.IsNullOrEmpty(MountCommand) && !string.IsNullOrEmpty(UmountCommand)) {
ExecutablesAvailable = true;
} else {
ExecutablesAvailable = false;
@@ -118,25 +118,27 @@ namespace IsoMounter
public bool CanMount(string path)
{
- if (EnvironmentInfo.OperatingSystem == MediaBrowser.Model.System.OperatingSystem.Linux) {
- _logger.LogInformation(
- "[{0}] Checking we can attempt to mount [{1}], Extension = [{2}], Operating System = [{3}], Executables Available = [{4}].",
- Name,
- path,
- Path.GetExtension(path),
- EnvironmentInfo.OperatingSystem,
- ExecutablesAvailable.ToString()
- );
-
- if (ExecutablesAvailable) {
- return string.Equals(Path.GetExtension(path), ".iso", StringComparison.OrdinalIgnoreCase);
- } else {
- return false;
- }
- } else {
+ if (EnvironmentInfo.OperatingSystem != MediaBrowser.Model.System.OperatingSystem.Linux)
+ {
return false;
}
+ _logger.LogInformation(
+ "[{0}] Checking we can attempt to mount [{1}], Extension = [{2}], Operating System = [{3}], Executables Available = [{4}].",
+ Name,
+ path,
+ Path.GetExtension(path),
+ EnvironmentInfo.OperatingSystem,
+ ExecutablesAvailable.ToString()
+ );
+ if (ExecutablesAvailable)
+ {
+ return string.Equals(Path.GetExtension(path), ".iso", StringComparison.OrdinalIgnoreCase);
+ }
+ else
+ {
+ return false;
+ }
}
public Task Install(CancellationToken cancellationToken)
@@ -150,7 +152,7 @@ namespace IsoMounter
return Task.FromResult<IIsoMount>(mountedISO);
}
else {
- throw new IOException(String.Format(
+ throw new IOException(string.Format(
"An error occurred trying to mount image [$0].",
isoPath
));
@@ -211,18 +213,16 @@ namespace IsoMounter
private string GetFullPathForExecutable(string name)
{
- foreach (string test in (EnvironmentInfo.GetEnvironmentVariable("PATH") ?? "").Split(EnvironmentInfo.PathSeparator)) {
-
+ foreach (string test in (Environment.GetEnvironmentVariable("PATH") ?? "").Split(Path.PathSeparator))
+ {
string path = test.Trim();
- if (!String.IsNullOrEmpty(path) && FileSystem.FileExists(path = Path.Combine(path, name))) {
+ if (!string.IsNullOrEmpty(path) && FileSystem.FileExists(path = Path.Combine(path, name))) {
return FileSystem.GetFullPath(path);
}
-
}
- return String.Empty;
-
+ return string.Empty;
}
private uint GetUID()
@@ -315,9 +315,9 @@ namespace IsoMounter
);
} else {
-
+
throw new ArgumentNullException(nameof(isoPath));
-
+
}
try
@@ -397,9 +397,9 @@ namespace IsoMounter
);
} else {
-
+
throw new ArgumentNullException(nameof(mount));
-
+
}
if (GetUID() == 0) {
@@ -444,7 +444,7 @@ namespace IsoMounter
}
#endregion
-
+
#region Internal Methods
internal void OnUnmount(LinuxMount mount)
diff --git a/Emby.IsoMounting/IsoMounter/LinuxMount.cs b/Emby.IsoMounting/IsoMounter/LinuxMount.cs
index edd26f08d4..da2eb19835 100644
--- a/Emby.IsoMounting/IsoMounter/LinuxMount.cs
+++ b/Emby.IsoMounting/IsoMounter/LinuxMount.cs
@@ -48,7 +48,7 @@ namespace IsoMounter
if (disposed) {
return;
}
-
+
if (disposing) {
//
diff --git a/Emby.IsoMounting/IsoMounter/Properties/AssemblyInfo.cs b/Emby.IsoMounting/IsoMounter/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000000..8a26b12a2a
--- /dev/null
+++ b/Emby.IsoMounting/IsoMounter/Properties/AssemblyInfo.cs
@@ -0,0 +1,21 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("IsoMounter")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Jellyfin Project")]
+[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+[assembly: NeutralResourcesLanguage("en")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]