add more device options

This commit is contained in:
Luke Pulverenti
2014-10-11 21:46:02 -04:00
parent f3539686bd
commit 314a51dff3
28 changed files with 162 additions and 82 deletions

View File

@@ -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;
}

View File

@@ -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;
}
}

View File

@@ -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))

View File

@@ -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);
}

View File

@@ -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."
}

View File

@@ -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);
}
}