aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api')
-rw-r--r--MediaBrowser.Api/ApiEntryPoint.cs13
-rw-r--r--MediaBrowser.Api/ConnectService.cs8
-rw-r--r--MediaBrowser.Api/Library/LibraryHelpers.cs2
-rw-r--r--MediaBrowser.Api/Library/LibraryStructureService.cs2
-rw-r--r--MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs4
-rw-r--r--MediaBrowser.Api/Playback/Hls/MpegDashService.cs2
-rw-r--r--MediaBrowser.Api/Session/SessionsService.cs5
-rw-r--r--MediaBrowser.Api/StartupWizardService.cs2
8 files changed, 24 insertions, 14 deletions
diff --git a/MediaBrowser.Api/ApiEntryPoint.cs b/MediaBrowser.Api/ApiEntryPoint.cs
index 0eb92d5a7..a9b43090a 100644
--- a/MediaBrowser.Api/ApiEntryPoint.cs
+++ b/MediaBrowser.Api/ApiEntryPoint.cs
@@ -1,5 +1,6 @@
using MediaBrowser.Api.Playback;
using MediaBrowser.Common.Configuration;
+using MediaBrowser.Common.IO;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Controller.Session;
@@ -39,6 +40,7 @@ namespace MediaBrowser.Api
private readonly IServerConfigurationManager _config;
private readonly ISessionManager _sessionManager;
+ private readonly IFileSystem _fileSystem;
public readonly SemaphoreSlim TranscodingStartLock = new SemaphoreSlim(1, 1);
@@ -48,11 +50,12 @@ namespace MediaBrowser.Api
/// <param name="logger">The logger.</param>
/// <param name="sessionManager">The session manager.</param>
/// <param name="config">The configuration.</param>
- public ApiEntryPoint(ILogger logger, ISessionManager sessionManager, IServerConfigurationManager config)
+ public ApiEntryPoint(ILogger logger, ISessionManager sessionManager, IServerConfigurationManager config, IFileSystem fileSystem)
{
Logger = logger;
_sessionManager = sessionManager;
_config = config;
+ _fileSystem = fileSystem;
Instance = this;
}
@@ -91,7 +94,7 @@ namespace MediaBrowser.Api
foreach (var file in Directory.EnumerateFiles(path, "*", SearchOption.AllDirectories)
.ToList())
{
- File.Delete(file);
+ _fileSystem.DeleteFile(file);
}
}
@@ -462,7 +465,7 @@ namespace MediaBrowser.Api
/// <param name="outputFilePath">The output file path.</param>
private void DeleteProgressivePartialStreamFiles(string outputFilePath)
{
- File.Delete(outputFilePath);
+ _fileSystem.DeleteFile(outputFilePath);
}
/// <summary>
@@ -479,13 +482,13 @@ namespace MediaBrowser.Api
.ToList();
Exception e = null;
-
+
foreach (var file in filesToDelete)
{
try
{
Logger.Info("Deleting HLS file {0}", file);
- File.Delete(file);
+ _fileSystem.DeleteFile(file);
}
catch (DirectoryNotFoundException)
{
diff --git a/MediaBrowser.Api/ConnectService.cs b/MediaBrowser.Api/ConnectService.cs
index 102e2d45e..a5ddcb6f1 100644
--- a/MediaBrowser.Api/ConnectService.cs
+++ b/MediaBrowser.Api/ConnectService.cs
@@ -42,8 +42,8 @@ namespace MediaBrowser.Api
[ApiMember(Name = "ExcludeLibraries", Description = "ExcludeLibraries", IsRequired = true, DataType = "string", ParameterType = "body", Verb = "POST")]
public string ExcludedLibraries { get; set; }
- [ApiMember(Name = "ExcludedChannels", Description = "ExcludedChannels", IsRequired = true, DataType = "string", ParameterType = "body", Verb = "POST")]
- public string ExcludedChannels { get; set; }
+ [ApiMember(Name = "EnabledChannels", Description = "EnabledChannels", IsRequired = true, DataType = "string", ParameterType = "body", Verb = "POST")]
+ public string EnabledChannels { get; set; }
[ApiMember(Name = "EnableLiveTv", Description = "EnableLiveTv", IsRequired = true, DataType = "string", ParameterType = "body", Verb = "POST")]
public bool EnableLiveTv { get; set; }
@@ -96,7 +96,7 @@ namespace MediaBrowser.Api
.Where(i => !string.IsNullOrWhiteSpace(i))
.ToArray();
- var excludedChannels = (request.ExcludedChannels ?? string.Empty)
+ var enabledChannels = (request.EnabledChannels ?? string.Empty)
.Split(',')
.Where(i => !string.IsNullOrWhiteSpace(i))
.ToArray();
@@ -106,7 +106,7 @@ namespace MediaBrowser.Api
ConnectUserName = request.ConnectUsername,
SendingUserId = request.SendingUserId,
ExcludedLibraries = excludeLibraries,
- ExcludedChannels = excludedChannels,
+ EnabledChannels = enabledChannels,
EnableLiveTv = request.EnableLiveTv
});
}
diff --git a/MediaBrowser.Api/Library/LibraryHelpers.cs b/MediaBrowser.Api/Library/LibraryHelpers.cs
index e21dc4a73..0ee28d6fe 100644
--- a/MediaBrowser.Api/Library/LibraryHelpers.cs
+++ b/MediaBrowser.Api/Library/LibraryHelpers.cs
@@ -42,7 +42,7 @@ namespace MediaBrowser.Api.Library
if (!string.IsNullOrEmpty(shortcut))
{
- File.Delete(shortcut);
+ fileSystem.DeleteFile(shortcut);
}
}
diff --git a/MediaBrowser.Api/Library/LibraryStructureService.cs b/MediaBrowser.Api/Library/LibraryStructureService.cs
index ee80d4b73..23f4e4e5c 100644
--- a/MediaBrowser.Api/Library/LibraryStructureService.cs
+++ b/MediaBrowser.Api/Library/LibraryStructureService.cs
@@ -348,7 +348,7 @@ namespace MediaBrowser.Api.Library
try
{
- Directory.Delete(path, true);
+ _fileSystem.DeleteDirectory(path, true);
// Need to add a delay here or directory watchers may still pick up the changes
var delayTask = Task.Delay(1000);
diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
index 86866bdf5..53229f031 100644
--- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
@@ -210,10 +210,10 @@ namespace MediaBrowser.Api.Playback.Hls
{
return;
}
-
+
try
{
- File.Delete(file.FullName);
+ FileSystem.DeleteFile(file.FullName);
}
catch (IOException ex)
{
diff --git a/MediaBrowser.Api/Playback/Hls/MpegDashService.cs b/MediaBrowser.Api/Playback/Hls/MpegDashService.cs
index 87e2eedcf..514597c3e 100644
--- a/MediaBrowser.Api/Playback/Hls/MpegDashService.cs
+++ b/MediaBrowser.Api/Playback/Hls/MpegDashService.cs
@@ -489,7 +489,7 @@ namespace MediaBrowser.Api.Playback.Hls
{
try
{
- File.Delete(file.FullName);
+ FileSystem.DeleteFile(file.FullName);
}
catch (IOException ex)
{
diff --git a/MediaBrowser.Api/Session/SessionsService.cs b/MediaBrowser.Api/Session/SessionsService.cs
index 59b8e85c2..e5fe69b62 100644
--- a/MediaBrowser.Api/Session/SessionsService.cs
+++ b/MediaBrowser.Api/Session/SessionsService.cs
@@ -245,6 +245,11 @@ namespace MediaBrowser.Api.Session
[ApiMember(Name = "SupportsUniqueIdentifier", Description = "Determines whether the device supports a unique identifier.", IsRequired = false, DataType = "bool", ParameterType = "query", Verb = "POST")]
public bool SupportsUniqueIdentifier { get; set; }
+
+ public PostCapabilities()
+ {
+ SupportsUniqueIdentifier = true;
+ }
}
[Route("/Sessions/Capabilities/Full", "POST", Summary = "Updates capabilities for a device")]
diff --git a/MediaBrowser.Api/StartupWizardService.cs b/MediaBrowser.Api/StartupWizardService.cs
index 4443b2a2b..97401bbf8 100644
--- a/MediaBrowser.Api/StartupWizardService.cs
+++ b/MediaBrowser.Api/StartupWizardService.cs
@@ -62,6 +62,8 @@ namespace MediaBrowser.Api
{
_config.Configuration.IsStartupWizardCompleted = true;
_config.Configuration.EnableLocalizedGuids = true;
+ _config.Configuration.StoreArtistsInMetadata = true;
+ _config.Configuration.EnableLibraryMetadataSubFolder = true;
_config.SaveConfiguration();
}