aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-10-11 21:46:02 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-10-11 21:46:02 -0400
commit314a51dff3f070be75bcaf00be244977fdd3ceb5 (patch)
tree9fd0588448932f9f829f314521f6f2ba340da9a6 /MediaBrowser.Server.Implementations
parentf3539686bd7ff6c748a0a9441086538081fa8903 (diff)
add more device options
Diffstat (limited to 'MediaBrowser.Server.Implementations')
-rw-r--r--MediaBrowser.Server.Implementations/Channels/ChannelDownloadScheduledTask.cs7
-rw-r--r--MediaBrowser.Server.Implementations/Devices/DeviceManager.cs14
-rw-r--r--MediaBrowser.Server.Implementations/Library/LibraryManager.cs2
-rw-r--r--MediaBrowser.Server.Implementations/Library/Resolvers/PhotoResolver.cs15
-rw-r--r--MediaBrowser.Server.Implementations/Localization/Server/server.json8
-rw-r--r--MediaBrowser.Server.Implementations/Session/SessionManager.cs2
6 files changed, 32 insertions, 16 deletions
diff --git a/MediaBrowser.Server.Implementations/Channels/ChannelDownloadScheduledTask.cs b/MediaBrowser.Server.Implementations/Channels/ChannelDownloadScheduledTask.cs
index af5248608..e38aef810 100644
--- a/MediaBrowser.Server.Implementations/Channels/ChannelDownloadScheduledTask.cs
+++ b/MediaBrowser.Server.Implementations/Channels/ChannelDownloadScheduledTask.cs
@@ -186,13 +186,6 @@ namespace MediaBrowser.Server.Implementations.Channels
private double? GetDownloadLimit(ChannelOptions channelOptions)
{
- if (!_security.IsMBSupporter)
- {
- const double limit = .5;
-
- return Math.Min(channelOptions.DownloadSizeLimit ?? limit, limit);
- }
-
return channelOptions.DownloadSizeLimit;
}
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;
}
}
diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
index 839fb3d57..71e1b1087 100644
--- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
@@ -1501,7 +1501,7 @@ namespace MediaBrowser.Server.Implementations.Library
.Select(i => i.RootFolder)
.Distinct()
.SelectMany(i => i.Children)
- .OfType<CollectionFolder>()
+ .OfType<ICollectionFolder>()
.Where(i => string.Equals(i.Path, item.Path, StringComparison.OrdinalIgnoreCase) || i.PhysicalLocations.Contains(item.Path))
.Select(i => i.CollectionType)
.Where(i => !string.IsNullOrEmpty(i))
diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/PhotoResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/PhotoResolver.cs
index 60e7edfdd..e3fe37be8 100644
--- a/MediaBrowser.Server.Implementations/Library/Resolvers/PhotoResolver.cs
+++ b/MediaBrowser.Server.Implementations/Library/Resolvers/PhotoResolver.cs
@@ -29,11 +29,22 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers
}
protected static string[] ImageExtensions = { ".tiff", ".jpeg", ".jpg", ".png", ".aiff" };
+
+ private static readonly string[] IgnoreFiles =
+ {
+ "folder",
+ "thumb",
+ "landscape",
+ "fanart",
+ "backdrop",
+ "poster"
+ };
+
internal static bool IsImageFile(string path)
{
- var filename = Path.GetFileName(path);
+ var filename = Path.GetFileNameWithoutExtension(path) ?? string.Empty;
- return !string.Equals(filename, "folder.jpg", StringComparison.OrdinalIgnoreCase)
+ return !IgnoreFiles.Contains(filename, StringComparer.OrdinalIgnoreCase)
&& ImageExtensions.Contains(Path.GetExtension(path) ?? string.Empty, StringComparer.OrdinalIgnoreCase);
}
diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json
index fe1f84ef3..efe50f45a 100644
--- a/MediaBrowser.Server.Implementations/Localization/Server/server.json
+++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json
@@ -1047,7 +1047,7 @@
"AppDeviceValues": "App: {0}, Device: {1}",
"ProviderValue": "Provider: {0}",
"LabelChannelDownloadSizeLimit": "Download size limit (GB):",
- "LabelChannelDownloadSizeLimitHelp": "Limit the size of the channel download folder. Downloading beyond 500MB requires an active supporter membership.",
+ "LabelChannelDownloadSizeLimitHelpText": "Limit the size of the channel download folder.",
"HeaderRecentActivity": "Recent Activity",
"HeaderPeople": "People",
"HeaderDownloadPeopleMetadataFor": "Download biography and images for:",
@@ -1222,6 +1222,8 @@
"TitleDevices": "Devices",
"HeaderCameraUploadHelp": "Automatically upload photos and videos taken from your mobile devices into Media Browser.",
"MessageNoDevicesSupportCameraUpload": "You currently don't have any devices that support camera upload.",
- "LabelUploadPath": "Upload path:",
- "LabelUploadPathHelp": "Select a custom upload path, if desired. If unspecified an internal data folder will be used."
+ "LabelCameraUploadPath": "Camera upload path:",
+ "LabelCameraUploadPathHelp": "Select a custom upload path, if desired. If unspecified a default folder will be used.",
+ "LabelCreateCameraUploadSubfolder": "Create a sub-folder for each device",
+ "LabelCreateCameraUploadSubfolderHelp": "Specific folders can be assigned to devices by clicking on the device on the Devices page."
}
diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs
index 10c89c613..8d640bf1e 100644
--- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs
+++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs
@@ -422,7 +422,7 @@ namespace MediaBrowser.Server.Implementations.Session
if (!string.IsNullOrEmpty(deviceId))
{
var userIdString = userId.HasValue ? userId.Value.ToString("N") : null;
- await _deviceManager.RegisterDevice(deviceId, deviceName, userIdString).ConfigureAwait(false);
+ await _deviceManager.RegisterDevice(deviceId, deviceName, clientType, userIdString).ConfigureAwait(false);
}
}