From 314a51dff3f070be75bcaf00be244977fdd3ceb5 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 11 Oct 2014 21:46:02 -0400 Subject: add more device options --- .../Devices/DeviceManager.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Devices') diff --git a/MediaBrowser.Server.Implementations/Devices/DeviceManager.cs b/MediaBrowser.Server.Implementations/Devices/DeviceManager.cs index 55425ad7e..6d4238bdf 100644 --- a/MediaBrowser.Server.Implementations/Devices/DeviceManager.cs +++ b/MediaBrowser.Server.Implementations/Devices/DeviceManager.cs @@ -29,7 +29,7 @@ namespace MediaBrowser.Server.Implementations.Devices _config = config; } - public Task RegisterDevice(string reportedId, string name, string usedByUserId) + public Task RegisterDevice(string reportedId, string name, string appName, string usedByUserId) { var device = GetDevice(reportedId) ?? new DeviceInfo { @@ -37,6 +37,7 @@ namespace MediaBrowser.Server.Implementations.Devices }; device.Name = name; + device.AppName = appName; if (!string.IsNullOrWhiteSpace(usedByUserId)) { @@ -115,12 +116,21 @@ namespace MediaBrowser.Server.Implementations.Devices { var config = _config.GetUploadOptions(); + var device = GetDevice(deviceId); + if (!string.IsNullOrWhiteSpace(config.CameraUploadPath)) { return config.CameraUploadPath; } - return Path.Combine(_config.CommonApplicationPaths.DataPath, "camerauploads"); + var path = Path.Combine(_config.CommonApplicationPaths.DataPath, "camerauploads"); + + if (config.EnableCameraUploadSubfolders) + { + path = Path.Combine(path, _fileSystem.GetValidFilename(device.Name)); + } + + return path; } } -- cgit v1.2.3