diff --git a/MediaBrowser.Common.Implementations/BaseApplicationHost.cs b/MediaBrowser.Common.Implementations/BaseApplicationHost.cs
index 4de1adcfa..3e25bb626 100644
--- a/MediaBrowser.Common.Implementations/BaseApplicationHost.cs
+++ b/MediaBrowser.Common.Implementations/BaseApplicationHost.cs
@@ -186,7 +186,7 @@ namespace MediaBrowser.Common.Implementations
{
if (_deviceId == null)
{
- _deviceId = new DeviceId(ApplicationPaths, LogManager.GetLogger("SystemId"), NetworkManager);
+ _deviceId = new DeviceId(ApplicationPaths, LogManager.GetLogger("SystemId"));
}
return _deviceId.Value;
diff --git a/MediaBrowser.Common.Implementations/Devices/DeviceId.cs b/MediaBrowser.Common.Implementations/Devices/DeviceId.cs
index 7c0dc1e1f..2a1c8877d 100644
--- a/MediaBrowser.Common.Implementations/Devices/DeviceId.cs
+++ b/MediaBrowser.Common.Implementations/Devices/DeviceId.cs
@@ -1,6 +1,4 @@
using MediaBrowser.Common.Configuration;
-using MediaBrowser.Common.Extensions;
-using MediaBrowser.Common.Net;
using MediaBrowser.Model.Logging;
using System;
using System.IO;
@@ -11,7 +9,6 @@ namespace MediaBrowser.Common.Implementations.Devices
public class DeviceId
{
private readonly IApplicationPaths _appPaths;
- private readonly INetworkManager _networkManager;
private readonly ILogger _logger;
private readonly object _syncLock = new object();
@@ -73,23 +70,7 @@ namespace MediaBrowser.Common.Implementations.Devices
private string GetNewId()
{
- // When generating an Id, base it off of the app path + mac address
- // But we can't fail here, so if we can't get the mac address then just use a random guid
-
- string mac;
-
- try
- {
- mac = _networkManager.GetMacAddress();
- }
- catch
- {
- mac = Guid.NewGuid().ToString("N");
- }
-
- mac += "-" + _appPaths.ApplicationPath;
-
- return mac.GetMD5().ToString("N");
+ return Guid.NewGuid().ToString("N");
}
private string GetDeviceId()
@@ -107,11 +88,10 @@ namespace MediaBrowser.Common.Implementations.Devices
private string _id;
- public DeviceId(IApplicationPaths appPaths, ILogger logger, INetworkManager networkManager)
+ public DeviceId(IApplicationPaths appPaths, ILogger logger)
{
_appPaths = appPaths;
_logger = logger;
- _networkManager = networkManager;
}
public string Value
diff --git a/MediaBrowser.Model/Sync/SyncJobItem.cs b/MediaBrowser.Model/Sync/SyncJobItem.cs
index 4090d82b0..3d06943aa 100644
--- a/MediaBrowser.Model/Sync/SyncJobItem.cs
+++ b/MediaBrowser.Model/Sync/SyncJobItem.cs
@@ -73,5 +73,10 @@ namespace MediaBrowser.Model.Sync
///
/// The primary image tag.
public string PrimaryImageTag { get; set; }
+ ///
+ /// Gets or sets a value indicating whether [requires conversion].
+ ///
+ /// true if [requires conversion]; otherwise, false.
+ public bool RequiresConversion { get; set; }
}
}
diff --git a/MediaBrowser.Providers/MediaInfo/VideoImageProvider.cs b/MediaBrowser.Providers/MediaInfo/VideoImageProvider.cs
index 7f55ce1ac..59db382ea 100644
--- a/MediaBrowser.Providers/MediaInfo/VideoImageProvider.cs
+++ b/MediaBrowser.Providers/MediaInfo/VideoImageProvider.cs
@@ -1,5 +1,6 @@
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Drawing;
@@ -18,12 +19,14 @@ namespace MediaBrowser.Providers.MediaInfo
private readonly IIsoManager _isoManager;
private readonly IMediaEncoder _mediaEncoder;
private readonly IServerConfigurationManager _config;
+ private readonly ILibraryManager _libraryManager;
- public VideoImageProvider(IIsoManager isoManager, IMediaEncoder mediaEncoder, IServerConfigurationManager config)
+ public VideoImageProvider(IIsoManager isoManager, IMediaEncoder mediaEncoder, IServerConfigurationManager config, ILibraryManager libraryManager)
{
_isoManager = isoManager;
_mediaEncoder = mediaEncoder;
_config = config;
+ _libraryManager = libraryManager;
}
///
@@ -123,7 +126,21 @@ namespace MediaBrowser.Providers.MediaInfo
{
var video = item as Video;
- return item.LocationType == LocationType.FileSystem && video != null && !video.IsPlaceHolder && !video.IsShortcut && !video.IsArchive;
+ if (item.LocationType == LocationType.FileSystem && video != null && !video.IsPlaceHolder &&
+ !video.IsShortcut && !video.IsArchive)
+ {
+ if (video.GetType() == typeof(Video))
+ {
+ if (string.IsNullOrEmpty(_libraryManager.GetContentType(video)))
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ return false;
}
public int Order
diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json
index 2d00f3c76..c070f3077 100644
--- a/MediaBrowser.Server.Implementations/Localization/Server/server.json
+++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json
@@ -35,6 +35,11 @@
"LabelChapterImageExtractionForMoviesHelp": "Extracting chapter images will allow clients to display graphical scene selection menus. The process can be slow, cpu-intensive and may require several gigabytes of space. It runs as a nightly scheduled task at 4am, although this is configurable in the scheduled tasks area. It is not recommended to run this task during peak usage hours.",
"LabelEnableAutomaticPortMapping": "Enable automatic port mapping",
"LabelEnableAutomaticPortMappingHelp": "UPnP allows automated router configuration for easy remote access. This may not work with some router models.",
+ "HeaderTermsOfService": "Media Browser Terms of Service",
+ "MessagePleaseAcceptTermsOfService": "Please accept the terms of service and privacy policy before continuing.",
+ "OptionIAcceptTermsOfService": "I accept the terms of service",
+ "ButtonPrivacyPolicy": "Privacy policy",
+ "ButtonTermsOfService": "Terms of Service",
"ButtonOk": "Ok",
"ButtonCancel": "Cancel",
"ButtonNew": "New",
diff --git a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj
index ccc0737e9..81054b3c5 100644
--- a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj
+++ b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj
@@ -51,7 +51,7 @@
False
- ..\packages\MediaBrowser.Naming.1.0.0.24\lib\portable-net45+sl4+wp71+win8+wpa81\MediaBrowser.Naming.dll
+ ..\packages\MediaBrowser.Naming.1.0.0.25\lib\portable-net45+sl4+wp71+win8+wpa81\MediaBrowser.Naming.dll
False
diff --git a/MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs b/MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs
index b09bfe91f..698806d09 100644
--- a/MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs
+++ b/MediaBrowser.Server.Implementations/Sync/SyncJobProcessor.cs
@@ -340,16 +340,17 @@ namespace MediaBrowser.Server.Implementations.Sync
var innerProgress = new ActionableProgress();
- await ProcessJobItem(item, innerProgress, cancellationToken).ConfigureAwait(false);
-
var job = _syncRepo.GetJob(item.JobId);
+ await ProcessJobItem(job, item, innerProgress, cancellationToken).ConfigureAwait(false);
+
+ job = _syncRepo.GetJob(item.JobId);
await UpdateJobStatus(job).ConfigureAwait(false);
index++;
}
}
- private async Task ProcessJobItem(SyncJobItem jobItem, IProgress progress, CancellationToken cancellationToken)
+ private async Task ProcessJobItem(SyncJob job, SyncJobItem jobItem, IProgress progress, CancellationToken cancellationToken)
{
var item = _libraryManager.GetItemById(jobItem.ItemId);
if (item == null)
@@ -372,15 +373,17 @@ namespace MediaBrowser.Server.Implementations.Sync
jobItem.Progress = 0;
jobItem.Status = SyncJobItemStatus.Converting;
+ var user = _userManager.GetUserById(job.UserId);
+
var video = item as Video;
if (video != null)
{
- await Sync(jobItem, video, deviceProfile, progress, cancellationToken).ConfigureAwait(false);
+ await Sync(jobItem, video, user, deviceProfile, progress, cancellationToken).ConfigureAwait(false);
}
else if (item is Audio)
{
- await Sync(jobItem, (Audio)item, deviceProfile, progress, cancellationToken).ConfigureAwait(false);
+ await Sync(jobItem, (Audio)item, user, deviceProfile, progress, cancellationToken).ConfigureAwait(false);
}
else if (item is Photo)
@@ -394,7 +397,7 @@ namespace MediaBrowser.Server.Implementations.Sync
}
}
- private async Task Sync(SyncJobItem jobItem, Video item, DeviceProfile profile, IProgress progress, CancellationToken cancellationToken)
+ private async Task Sync(SyncJobItem jobItem, Video item, User user, DeviceProfile profile, IProgress progress, CancellationToken cancellationToken)
{
var options = new VideoOptions
{
@@ -402,7 +405,7 @@ namespace MediaBrowser.Server.Implementations.Sync
ItemId = item.Id.ToString("N"),
DeviceId = jobItem.TargetId,
Profile = profile,
- MediaSources = item.GetMediaSources(false).ToList()
+ MediaSources = item.GetMediaSources(false, user).ToList()
};
var streamInfo = new StreamBuilder().BuildVideoItem(options);
@@ -413,6 +416,7 @@ namespace MediaBrowser.Server.Implementations.Sync
if (streamInfo.PlayMethod == PlayMethod.Transcode)
{
jobItem.Status = SyncJobItemStatus.Converting;
+ jobItem.RequiresConversion = true;
await _syncRepo.Update(jobItem).ConfigureAwait(false);
try
@@ -438,6 +442,8 @@ namespace MediaBrowser.Server.Implementations.Sync
}
else
{
+ jobItem.RequiresConversion = false;
+
if (mediaSource.Protocol == MediaProtocol.File)
{
jobItem.OutputPath = mediaSource.Path;
@@ -457,7 +463,7 @@ namespace MediaBrowser.Server.Implementations.Sync
await _syncRepo.Update(jobItem).ConfigureAwait(false);
}
- private async Task Sync(SyncJobItem jobItem, Audio item, DeviceProfile profile, IProgress progress, CancellationToken cancellationToken)
+ private async Task Sync(SyncJobItem jobItem, Audio item, User user, DeviceProfile profile, IProgress progress, CancellationToken cancellationToken)
{
var options = new AudioOptions
{
@@ -465,7 +471,7 @@ namespace MediaBrowser.Server.Implementations.Sync
ItemId = item.Id.ToString("N"),
DeviceId = jobItem.TargetId,
Profile = profile,
- MediaSources = item.GetMediaSources(false).ToList()
+ MediaSources = item.GetMediaSources(false, user).ToList()
};
var streamInfo = new StreamBuilder().BuildAudioItem(options);
@@ -476,6 +482,7 @@ namespace MediaBrowser.Server.Implementations.Sync
if (streamInfo.PlayMethod == PlayMethod.Transcode)
{
jobItem.Status = SyncJobItemStatus.Converting;
+ jobItem.RequiresConversion = true;
await _syncRepo.Update(jobItem).ConfigureAwait(false);
try
@@ -500,6 +507,8 @@ namespace MediaBrowser.Server.Implementations.Sync
}
else
{
+ jobItem.RequiresConversion = false;
+
if (mediaSource.Protocol == MediaProtocol.File)
{
jobItem.OutputPath = mediaSource.Path;
diff --git a/MediaBrowser.Server.Implementations/Sync/SyncManager.cs b/MediaBrowser.Server.Implementations/Sync/SyncManager.cs
index 3b2d70f84..b8f199e6b 100644
--- a/MediaBrowser.Server.Implementations/Sync/SyncManager.cs
+++ b/MediaBrowser.Server.Implementations/Sync/SyncManager.cs
@@ -12,7 +12,6 @@ using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Controller.Sync;
using MediaBrowser.Controller.TV;
using MediaBrowser.Model.Dlna;
-using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Querying;
@@ -393,6 +392,18 @@ namespace MediaBrowser.Server.Implementations.Sync
jobItem.Status = SyncJobItemStatus.Synced;
jobItem.Progress = 100;
+ if (jobItem.RequiresConversion)
+ {
+ try
+ {
+ File.Delete(jobItem.OutputPath);
+ }
+ catch (Exception ex)
+ {
+ _logger.ErrorException("Error deleting temporary job file: {0}", ex, jobItem.OutputPath);
+ }
+ }
+
await _repo.Update(jobItem).ConfigureAwait(false);
var processor = new SyncJobProcessor(_libraryManager, _repo, this, _logger, _userManager, _tvSeriesManager, _mediaEncoder());
diff --git a/MediaBrowser.Server.Implementations/Sync/SyncRepository.cs b/MediaBrowser.Server.Implementations/Sync/SyncRepository.cs
index 09c1b316e..151860d84 100644
--- a/MediaBrowser.Server.Implementations/Sync/SyncRepository.cs
+++ b/MediaBrowser.Server.Implementations/Sync/SyncRepository.cs
@@ -36,7 +36,7 @@ namespace MediaBrowser.Server.Implementations.Sync
public async Task Initialize()
{
- var dbFile = Path.Combine(_appPaths.DataPath, "sync10.db");
+ var dbFile = Path.Combine(_appPaths.DataPath, "sync11.db");
_connection = await SqliteExtensions.ConnectToDb(dbFile, _logger).ConfigureAwait(false);
@@ -45,7 +45,7 @@ namespace MediaBrowser.Server.Implementations.Sync
"create table if not exists SyncJobs (Id GUID PRIMARY KEY, TargetId TEXT NOT NULL, Name TEXT NOT NULL, Quality TEXT NOT NULL, Status TEXT NOT NULL, Progress FLOAT, UserId TEXT NOT NULL, ItemIds TEXT NOT NULL, Category TEXT, ParentId TEXT, UnwatchedOnly BIT, ItemLimit INT, SyncNewContent BIT, DateCreated DateTime, DateLastModified DateTime, ItemCount int)",
"create index if not exists idx_SyncJobs on SyncJobs(Id)",
- "create table if not exists SyncJobItems (Id GUID PRIMARY KEY, ItemId TEXT, ItemName TEXT, MediaSourceId TEXT, JobId TEXT, OutputPath TEXT, Status TEXT, TargetId TEXT, DateCreated DateTime, Progress FLOAT)",
+ "create table if not exists SyncJobItems (Id GUID PRIMARY KEY, ItemId TEXT, ItemName TEXT, MediaSourceId TEXT, JobId TEXT, RequiresConversion BIT, OutputPath TEXT, Status TEXT, TargetId TEXT, DateCreated DateTime, Progress FLOAT)",
"create index if not exists idx_SyncJobItems on SyncJobs(Id)",
//pragmas
@@ -90,13 +90,14 @@ namespace MediaBrowser.Server.Implementations.Sync
_saveJobCommand.Parameters.Add(_saveJobCommand, "@ItemCount");
_saveJobItemCommand = _connection.CreateCommand();
- _saveJobItemCommand.CommandText = "replace into SyncJobItems (Id, ItemId, ItemName, MediaSourceId, JobId, OutputPath, Status, TargetId, DateCreated, Progress) values (@Id, @ItemId, @ItemName, @MediaSourceId, @JobId, @OutputPath, @Status, @TargetId, @DateCreated, @Progress)";
+ _saveJobItemCommand.CommandText = "replace into SyncJobItems (Id, ItemId, ItemName, MediaSourceId, JobId, RequiresConversion, OutputPath, Status, TargetId, DateCreated, Progress) values (@Id, @ItemId, @ItemName, @MediaSourceId, @JobId, @RequiresConversion, @OutputPath, @Status, @TargetId, @DateCreated, @Progress)";
_saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@Id");
_saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@ItemId");
_saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@ItemName");
_saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@MediaSourceId");
_saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@JobId");
+ _saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@RequiresConversion");
_saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@OutputPath");
_saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@Status");
_saveJobItemCommand.Parameters.Add(_saveJobItemCommand, "@TargetId");
@@ -105,7 +106,7 @@ namespace MediaBrowser.Server.Implementations.Sync
}
private const string BaseJobSelectText = "select Id, TargetId, Name, Quality, Status, Progress, UserId, ItemIds, Category, ParentId, UnwatchedOnly, ItemLimit, SyncNewContent, DateCreated, DateLastModified, ItemCount from SyncJobs";
- private const string BaseJobItemSelectText = "select Id, ItemId, ItemName, MediaSourceId, JobId, OutputPath, Status, TargetId, DateCreated, Progress from SyncJobItems";
+ private const string BaseJobItemSelectText = "select Id, ItemId, ItemName, MediaSourceId, JobId, RequiresConversion, OutputPath, Status, TargetId, DateCreated, Progress from SyncJobItems";
public SyncJob GetJob(string id)
{
@@ -556,6 +557,7 @@ namespace MediaBrowser.Server.Implementations.Sync
_saveJobItemCommand.GetParameter(index++).Value = jobItem.ItemName;
_saveJobItemCommand.GetParameter(index++).Value = jobItem.MediaSourceId;
_saveJobItemCommand.GetParameter(index++).Value = jobItem.JobId;
+ _saveJobItemCommand.GetParameter(index++).Value = jobItem.RequiresConversion;
_saveJobItemCommand.GetParameter(index++).Value = jobItem.OutputPath;
_saveJobItemCommand.GetParameter(index++).Value = jobItem.Status.ToString();
_saveJobItemCommand.GetParameter(index++).Value = jobItem.TargetId;
@@ -618,24 +620,25 @@ namespace MediaBrowser.Server.Implementations.Sync
}
info.JobId = reader.GetString(4);
-
- if (!reader.IsDBNull(5))
- {
- info.OutputPath = reader.GetString(5);
- }
+ info.RequiresConversion = reader.GetBoolean(5);
if (!reader.IsDBNull(6))
{
- info.Status = (SyncJobItemStatus)Enum.Parse(typeof(SyncJobItemStatus), reader.GetString(6), true);
+ info.OutputPath = reader.GetString(6);
}
- info.TargetId = reader.GetString(7);
-
- info.DateCreated = reader.GetDateTime(8);
-
- if (!reader.IsDBNull(9))
+ if (!reader.IsDBNull(7))
{
- info.Progress = reader.GetDouble(9);
+ info.Status = (SyncJobItemStatus)Enum.Parse(typeof(SyncJobItemStatus), reader.GetString(7), true);
+ }
+
+ info.TargetId = reader.GetString(8);
+
+ info.DateCreated = reader.GetDateTime(9);
+
+ if (!reader.IsDBNull(10))
+ {
+ info.Progress = reader.GetDouble(10);
}
return info;
diff --git a/MediaBrowser.Server.Implementations/packages.config b/MediaBrowser.Server.Implementations/packages.config
index 239bca405..aba7d0e33 100644
--- a/MediaBrowser.Server.Implementations/packages.config
+++ b/MediaBrowser.Server.Implementations/packages.config
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.cs
index 2f9f3f5f5..a6707bac3 100644
--- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs
+++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs
@@ -471,6 +471,7 @@ namespace MediaBrowser.WebDashboard.Api
"userprofilespage.js",
"userparentalcontrol.js",
"userlibraryaccess.js",
+ "wizardagreement.js",
"wizardfinishpage.js",
"wizardservice.js",
"wizardstartpage.js",
diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
index 1343b1e69..7979f35ae 100644
--- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
+++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
@@ -120,6 +120,9 @@
PreserveNewest
+
+ PreserveNewest
+
PreserveNewest
@@ -1638,6 +1641,9 @@
PreserveNewest
+
+ PreserveNewest
+
PreserveNewest