Remove more unused code

pull/2970/head
Patrick Barron 5 years ago
parent 511d20a100
commit 1e9b2613c6

@ -20,7 +20,6 @@ using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Events; using MediaBrowser.Model.Events;
using MediaBrowser.Model.Globalization; using MediaBrowser.Model.Globalization;
using MediaBrowser.Model.IO; using MediaBrowser.Model.IO;
using MediaBrowser.Model.Net;
using MediaBrowser.Model.Querying; using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Session; using MediaBrowser.Model.Session;
@ -220,41 +219,6 @@ namespace Emby.Server.Implementations.Devices
return _libraryManager.AddVirtualFolder(name, CollectionType.HomeVideos, libraryOptions, true); return _libraryManager.AddVirtualFolder(name, CollectionType.HomeVideos, libraryOptions, true);
} }
private Tuple<string, string, string> GetUploadPath(DeviceInfo device)
{
var config = _config.GetUploadOptions();
var path = config.CameraUploadPath;
if (string.IsNullOrWhiteSpace(path))
{
path = DefaultCameraUploadsPath;
}
var topLibraryPath = path;
if (config.EnableCameraUploadSubfolders)
{
path = Path.Combine(path, _fileSystem.GetValidFilename(device.Name));
}
return new Tuple<string, string, string>(path, topLibraryPath, null);
}
internal string GetUploadsPath()
{
var config = _config.GetUploadOptions();
var path = config.CameraUploadPath;
if (string.IsNullOrWhiteSpace(path))
{
path = DefaultCameraUploadsPath;
}
return path;
}
private string DefaultCameraUploadsPath => Path.Combine(_config.CommonApplicationPaths.DataPath, "camerauploads");
public bool CanAccessDevice(User user, string deviceId) public bool CanAccessDevice(User user, string deviceId)
{ {
if (user == null) if (user == null)
@ -311,27 +275,9 @@ namespace Emby.Server.Implementations.Devices
_logger = logger; _logger = logger;
} }
public async Task RunAsync() public Task RunAsync()
{ {
if (!_config.Configuration.CameraUploadUpgraded && _config.Configuration.IsStartupWizardCompleted) return Task.CompletedTask;
{
var path = _deviceManager.GetUploadsPath();
if (Directory.Exists(path))
{
try
{
await _deviceManager.EnsureLibraryFolder(path, null).ConfigureAwait(false);
}
catch (Exception ex)
{
_logger.LogError(ex, "Error creating camera uploads library");
}
_config.Configuration.CameraUploadUpgraded = true;
_config.SaveConfiguration();
}
}
} }
#region IDisposable Support #region IDisposable Support

@ -1,6 +1,4 @@
using System; using System;
using System.IO;
using System.Threading.Tasks;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Devices; using MediaBrowser.Model.Devices;
using MediaBrowser.Model.Events; using MediaBrowser.Model.Events;

Loading…
Cancel
Save