From b8fb177fc8d54a5b9e29995e9ef1d4ad30a37344 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 5 May 2015 11:24:47 -0400 Subject: added manual server form --- .../Localization/JavaScript/javascript.json | 3 ++- .../Localization/Server/server.json | 13 ++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Localization') diff --git a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json index c15e520e2..3fe1b7492 100644 --- a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json +++ b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json @@ -766,5 +766,6 @@ "SyncJobItemStatusRemovedFromDevice": "Removed from device", "SyncJobItemStatusCancelled": "Cancelled", "LabelProfile": "Profile:", - "LabelBitrateMbps": "Bitrate (Mbps):" + "LabelBitrateMbps": "Bitrate (Mbps):", + "EmbyIntroDownloadMessage": "To download and install Emby Server visit {0}." } diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json index 9b608513f..1297ec0fc 100644 --- a/MediaBrowser.Server.Implementations/Localization/Server/server.json +++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json @@ -1436,5 +1436,16 @@ "LabelSelectViewStyles": "Enable enhanced presentations for:", "LabelSelectViewStylesHelp": "If enabled, views will be built with metadata to offer categories such as Suggestions, Latest, Genres, and more. If disabled, they'll be displayed with simple folders.", "TabPhotos": "Photos", - "TabVideos": "Videos" + "TabVideos": "Videos", + "HeaderWelcomeToEmby": "Welcome to Emby", + "EmbyIntroMessage": "With Emby you can easily stream videos, music and photos to smart phones, tablets and other devices from your Emby Server.", + "ButtonSkip": "Skip", + "TextConnectToServerManually": "Connect to server manually", + "ButtonNewServer": "New Server", + "ButtonSignInWithConnect": "Sign in with Emby Connect", + "HeaderNewServer": "New Server", + "ButtonConnect": "Connect", + "LabelServerHost": "Host:", + "LabelServerHostHelp": "192.168.1.100 or https://myserver.com", + "LabelServerPort": "Port:" } -- cgit v1.2.3 From 32454bdfe1b5a58fa9901e092fd0d764482a0def Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 5 May 2015 19:15:47 -0400 Subject: update login page --- MediaBrowser.Controller/Entities/BaseItem.cs | 2 +- MediaBrowser.Server.Implementations/Library/UserManager.cs | 6 +++--- .../Localization/JavaScript/javascript.json | 7 +++++-- .../Localization/Server/server.json | 6 +++--- MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj | 2 +- 5 files changed, 13 insertions(+), 10 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Localization') diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index bbc3b6fd3..8b6cbdc93 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -496,7 +496,7 @@ namespace MediaBrowser.Controller.Entities /// /// /// ``0. - protected T FindParent() + public T FindParent() where T : Folder { return Parents.OfType().FirstOrDefault(); diff --git a/MediaBrowser.Server.Implementations/Library/UserManager.cs b/MediaBrowser.Server.Implementations/Library/UserManager.cs index 02e1795f3..5012f2479 100644 --- a/MediaBrowser.Server.Implementations/Library/UserManager.cs +++ b/MediaBrowser.Server.Implementations/Library/UserManager.cs @@ -281,10 +281,10 @@ namespace MediaBrowser.Server.Implementations.Library if (newValue >= maxCount) { - _logger.Debug("Disabling user {0} due to {1} unsuccessful login attempts.", user.Name, newValue.ToString(CultureInfo.InvariantCulture)); - user.Policy.IsDisabled = true; + //_logger.Debug("Disabling user {0} due to {1} unsuccessful login attempts.", user.Name, newValue.ToString(CultureInfo.InvariantCulture)); + //user.Policy.IsDisabled = true; - fireLockout = true; + //fireLockout = true; } await UpdateUserPolicy(user, user.Policy, false).ConfigureAwait(false); diff --git a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json index 3fe1b7492..9aa09a75b 100644 --- a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json +++ b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json @@ -440,7 +440,7 @@ "HeaderVideo": "Video", "HeaderRuntime": "Runtime", "HeaderCommunityRating": "Community rating", - "HeaderPasswordReset": "Password Reset", + "HeaderPasswordReset": "Password Reset", "HeaderParentalRating": "Parental rating", "HeaderReleaseDate": "Release date", "HeaderDateAdded": "Date added", @@ -767,5 +767,8 @@ "SyncJobItemStatusCancelled": "Cancelled", "LabelProfile": "Profile:", "LabelBitrateMbps": "Bitrate (Mbps):", - "EmbyIntroDownloadMessage": "To download and install Emby Server visit {0}." + "EmbyIntroDownloadMessage": "To download and install Emby Server visit {0}.", + "ButtonNewServer": "New Server", + "ButtonSignInWithConnect": "Sign in with Emby Connect", + "HeaderNewServer": "New Server" } diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json index 1297ec0fc..ff99c4078 100644 --- a/MediaBrowser.Server.Implementations/Localization/Server/server.json +++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json @@ -1441,11 +1441,11 @@ "EmbyIntroMessage": "With Emby you can easily stream videos, music and photos to smart phones, tablets and other devices from your Emby Server.", "ButtonSkip": "Skip", "TextConnectToServerManually": "Connect to server manually", - "ButtonNewServer": "New Server", "ButtonSignInWithConnect": "Sign in with Emby Connect", - "HeaderNewServer": "New Server", "ButtonConnect": "Connect", "LabelServerHost": "Host:", "LabelServerHostHelp": "192.168.1.100 or https://myserver.com", - "LabelServerPort": "Port:" + "LabelServerPort": "Port:", + "HeaderNewServer": "New Server", + "ButtonChangeServer": "Change Server" } diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index 0da2d5660..e39df9602 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -93,7 +93,7 @@ PreserveNewest - + PreserveNewest -- cgit v1.2.3 From 6c97afef23856890bed55759363c7b7516f99921 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 6 May 2015 08:56:26 -0400 Subject: updated bravia profiles --- .../Profiles/SonyBravia2010Profile.cs | 1 + .../Profiles/SonyBravia2011Profile.cs | 1 + .../Profiles/SonyBravia2012Profile.cs | 1 + .../Profiles/SonyBravia2013Profile.cs | 1 + .../Profiles/Xml/Sony Bravia (2010).xml | 2 +- .../Profiles/Xml/Sony Bravia (2011).xml | 2 +- .../Profiles/Xml/Sony Bravia (2012).xml | 2 +- .../Profiles/Xml/Sony Bravia (2013).xml | 2 +- MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs | 296 +++++++++++---------- MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs | 3 +- .../Manager/ItemImageProvider.cs | 22 +- .../Localization/Server/server.json | 3 +- MediaBrowser.WebDashboard/Api/PackageCreator.cs | 20 +- .../MediaBrowser.WebDashboard.csproj | 3 + 14 files changed, 197 insertions(+), 162 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Localization') diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs index 78e90af26..3bd425cb3 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs @@ -47,6 +47,7 @@ namespace MediaBrowser.Dlna.Profiles "http-get:*:audio/mpeg:DLNA.ORG_PN=MP3;DLNA.ORG_OP=01;DLNA.ORG_FLAGS=81500000000000000000000000000000,http-get:*:image/jpeg:DLNA.ORG_PN=JPEG_SM;DLNA.ORG_OP=00;DLNA.ORG_FLAGS=00D00000000000000000000000000000,http-get:*:video/mpeg:DLNA.ORG_PN=MPEG_PS_PAL;DLNA.ORG_OP=11;DLNA.ORG_FLAGS=81500000000000000000000000000000"; EnableSingleAlbumArtLimit = true; + EnableAlbumArtInDidl = true; TranscodingProfiles = new[] { diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs index b435c6364..de4f1d2b6 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs @@ -44,6 +44,7 @@ namespace MediaBrowser.Dlna.Profiles ManufacturerUrl = "http://www.microsoft.com/"; SonyAggregationFlags = "10"; EnableSingleAlbumArtLimit = true; + EnableAlbumArtInDidl = true; TranscodingProfiles = new[] { diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs index b0cbb0970..5a5fb9e94 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2012Profile.cs @@ -44,6 +44,7 @@ namespace MediaBrowser.Dlna.Profiles ManufacturerUrl = "http://www.microsoft.com/"; SonyAggregationFlags = "10"; EnableSingleAlbumArtLimit = true; + EnableAlbumArtInDidl = true; TranscodingProfiles = new[] { diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs index ca4e802a1..74a07f389 100644 --- a/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs +++ b/MediaBrowser.Dlna/Profiles/SonyBravia2013Profile.cs @@ -44,6 +44,7 @@ namespace MediaBrowser.Dlna.Profiles ManufacturerUrl = "http://www.microsoft.com/"; SonyAggregationFlags = "10"; EnableSingleAlbumArtLimit = true; + EnableAlbumArtInDidl = true; TranscodingProfiles = new[] { diff --git a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2010).xml b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2010).xml index 68bfe85cf..7afc8183d 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2010).xml +++ b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2010).xml @@ -15,7 +15,7 @@ Emby 3.0 http://www.microsoft.com/ - false + true true Audio,Photo,Video JPEG_TN diff --git a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2011).xml b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2011).xml index 4f9ca7550..7400600e2 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2011).xml +++ b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2011).xml @@ -15,7 +15,7 @@ Emby 3.0 http://www.microsoft.com/ - false + true true Audio,Photo,Video JPEG_TN diff --git a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2012).xml b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2012).xml index 682b2f358..b8e3d6d30 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2012).xml +++ b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2012).xml @@ -15,7 +15,7 @@ Emby 3.0 http://www.microsoft.com/ - false + true true Audio,Photo,Video JPEG_TN diff --git a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2013).xml b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2013).xml index 5032bf69a..5733d9d0b 100644 --- a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2013).xml +++ b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2013).xml @@ -15,7 +15,7 @@ Emby 3.0 http://www.microsoft.com/ - false + true true Audio,Photo,Video JPEG_TN diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index a01f37f91..4d5b669e2 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -199,82 +199,83 @@ namespace MediaBrowser.MediaEncoding.Encoder await _ffProbeResourcePool.WaitAsync(cancellationToken).ConfigureAwait(false); - var processWrapper = new ProcessWrapper(process, this); - - try - { - StartProcess(processWrapper); - } - catch (Exception ex) + using (var processWrapper = new ProcessWrapper(process, this)) { - _ffProbeResourcePool.Release(); + try + { + StartProcess(processWrapper); + } + catch (Exception ex) + { + _ffProbeResourcePool.Release(); - _logger.ErrorException("Error starting ffprobe", ex); + _logger.ErrorException("Error starting ffprobe", ex); - throw; - } + throw; + } - try - { - process.BeginErrorReadLine(); + try + { + process.BeginErrorReadLine(); - var result = _jsonSerializer.DeserializeFromStream(process.StandardOutput.BaseStream); + var result = _jsonSerializer.DeserializeFromStream(process.StandardOutput.BaseStream); - if (result != null) - { - if (result.streams != null) + if (result != null) { - // Normalize aspect ratio if invalid - foreach (var stream in result.streams) + if (result.streams != null) { - if (string.Equals(stream.display_aspect_ratio, "0:1", StringComparison.OrdinalIgnoreCase)) - { - stream.display_aspect_ratio = string.Empty; - } - if (string.Equals(stream.sample_aspect_ratio, "0:1", StringComparison.OrdinalIgnoreCase)) + // Normalize aspect ratio if invalid + foreach (var stream in result.streams) { - stream.sample_aspect_ratio = string.Empty; + if (string.Equals(stream.display_aspect_ratio, "0:1", StringComparison.OrdinalIgnoreCase)) + { + stream.display_aspect_ratio = string.Empty; + } + if (string.Equals(stream.sample_aspect_ratio, "0:1", StringComparison.OrdinalIgnoreCase)) + { + stream.sample_aspect_ratio = string.Empty; + } } } - } - var mediaInfo = new ProbeResultNormalizer(_logger, FileSystem).GetMediaInfo(result, videoType, isAudio, primaryPath, protocol); + var mediaInfo = new ProbeResultNormalizer(_logger, FileSystem).GetMediaInfo(result, videoType, isAudio, primaryPath, protocol); - if (extractKeyFrameInterval && mediaInfo.RunTimeTicks.HasValue) - { - foreach (var stream in mediaInfo.MediaStreams) + if (extractKeyFrameInterval && mediaInfo.RunTimeTicks.HasValue) { - if (stream.Type == MediaStreamType.Video && string.Equals(stream.Codec, "h264", StringComparison.OrdinalIgnoreCase)) + foreach (var stream in mediaInfo.MediaStreams) { - try - { - //stream.KeyFrames = await GetKeyFrames(inputPath, stream.Index, cancellationToken) - // .ConfigureAwait(false); - } - catch (OperationCanceledException) - { - - } - catch (Exception ex) + if (stream.Type == MediaStreamType.Video && string.Equals(stream.Codec, "h264", StringComparison.OrdinalIgnoreCase)) { - _logger.ErrorException("Error getting key frame interval", ex); + try + { + //stream.KeyFrames = await GetKeyFrames(inputPath, stream.Index, cancellationToken) + // .ConfigureAwait(false); + } + catch (OperationCanceledException) + { + + } + catch (Exception ex) + { + _logger.ErrorException("Error getting key frame interval", ex); + } } } } - } - return mediaInfo; + return mediaInfo; + } } - } - catch - { - StopProcess(processWrapper, 100, true); + catch + { + StopProcess(processWrapper, 100, true); - throw; - } - finally - { - _ffProbeResourcePool.Release(); + throw; + } + finally + { + _ffProbeResourcePool.Release(); + } } throw new ApplicationException(string.Format("FFProbe failed for {0}", inputPath)); @@ -307,31 +308,32 @@ namespace MediaBrowser.MediaEncoding.Encoder _logger.Debug("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments); - var processWrapper = new ProcessWrapper(process, this); - - StartProcess(processWrapper); + using (var processWrapper = new ProcessWrapper(process, this)) + { + StartProcess(processWrapper); - var lines = new List(); + var lines = new List(); - try - { - process.BeginErrorReadLine(); + try + { + process.BeginErrorReadLine(); - await StartReadingOutput(process.StandardOutput.BaseStream, lines, 120000, cancellationToken).ConfigureAwait(false); - } - catch (OperationCanceledException) - { - if (cancellationToken.IsCancellationRequested) + await StartReadingOutput(process.StandardOutput.BaseStream, lines, 120000, cancellationToken).ConfigureAwait(false); + } + catch (OperationCanceledException) { - throw; + if (cancellationToken.IsCancellationRequested) + { + throw; + } + } + finally + { + StopProcess(processWrapper, 100, true); } - } - finally - { - StopProcess(processWrapper, 100, true); - } - return lines; + return lines; + } } private async Task StartReadingOutput(Stream source, List lines, int timeoutMs, CancellationToken cancellationToken) @@ -490,51 +492,53 @@ namespace MediaBrowser.MediaEncoding.Encoder await resourcePool.WaitAsync(cancellationToken).ConfigureAwait(false); - var processWrapper = new ProcessWrapper(process, this); - bool ranToCompletion; + using (var processWrapper = new ProcessWrapper(process, this)) + { + bool ranToCompletion; - var memoryStream = new MemoryStream(); + var memoryStream = new MemoryStream(); - try - { - StartProcess(processWrapper); + try + { + StartProcess(processWrapper); #pragma warning disable 4014 - // Important - don't await the log task or we won't be able to kill ffmpeg when the user stops playback - process.StandardOutput.BaseStream.CopyToAsync(memoryStream); + // Important - don't await the log task or we won't be able to kill ffmpeg when the user stops playback + process.StandardOutput.BaseStream.CopyToAsync(memoryStream); #pragma warning restore 4014 - // MUST read both stdout and stderr asynchronously or a deadlock may occurr - process.BeginErrorReadLine(); + // MUST read both stdout and stderr asynchronously or a deadlock may occurr + process.BeginErrorReadLine(); - ranToCompletion = process.WaitForExit(10000); + ranToCompletion = process.WaitForExit(10000); - if (!ranToCompletion) + if (!ranToCompletion) + { + StopProcess(processWrapper, 1000, false); + } + + } + finally { - StopProcess(processWrapper, 1000, false); + resourcePool.Release(); } - } - finally - { - resourcePool.Release(); - } + var exitCode = ranToCompletion ? processWrapper.ExitCode ?? 0 : -1; - var exitCode = ranToCompletion ? processWrapper.ExitCode ?? 0 : -1; + if (exitCode == -1 || memoryStream.Length == 0) + { + memoryStream.Dispose(); - if (exitCode == -1 || memoryStream.Length == 0) - { - memoryStream.Dispose(); + var msg = string.Format("ffmpeg image extraction failed for {0}", inputPath); - var msg = string.Format("ffmpeg image extraction failed for {0}", inputPath); + _logger.Error(msg); - _logger.Error(msg); + throw new ApplicationException(msg); + } - throw new ApplicationException(msg); + memoryStream.Position = 0; + return memoryStream; } - - memoryStream.Position = 0; - return memoryStream; } public string GetTimeParameter(long ticks) @@ -603,55 +607,56 @@ namespace MediaBrowser.MediaEncoding.Encoder bool ranToCompletion = false; - var processWrapper = new ProcessWrapper(process, this); - - try + using (var processWrapper = new ProcessWrapper(process, this)) { - StartProcess(processWrapper); + try + { + StartProcess(processWrapper); - // Need to give ffmpeg enough time to make all the thumbnails, which could be a while, - // but we still need to detect if the process hangs. - // Making the assumption that as long as new jpegs are showing up, everything is good. + // Need to give ffmpeg enough time to make all the thumbnails, which could be a while, + // but we still need to detect if the process hangs. + // Making the assumption that as long as new jpegs are showing up, everything is good. - bool isResponsive = true; - int lastCount = 0; + bool isResponsive = true; + int lastCount = 0; - while (isResponsive) - { - if (process.WaitForExit(30000)) + while (isResponsive) { - ranToCompletion = true; - break; - } + if (process.WaitForExit(30000)) + { + ranToCompletion = true; + break; + } + + cancellationToken.ThrowIfCancellationRequested(); - cancellationToken.ThrowIfCancellationRequested(); + var jpegCount = Directory.GetFiles(targetDirectory) + .Count(i => string.Equals(Path.GetExtension(i), ".jpg", StringComparison.OrdinalIgnoreCase)); - var jpegCount = Directory.GetFiles(targetDirectory) - .Count(i => string.Equals(Path.GetExtension(i), ".jpg", StringComparison.OrdinalIgnoreCase)); + isResponsive = (jpegCount > lastCount); + lastCount = jpegCount; + } - isResponsive = (jpegCount > lastCount); - lastCount = jpegCount; + if (!ranToCompletion) + { + StopProcess(processWrapper, 1000, false); + } } - - if (!ranToCompletion) + finally { - StopProcess(processWrapper, 1000, false); + resourcePool.Release(); } - } - finally - { - resourcePool.Release(); - } - var exitCode = ranToCompletion ? processWrapper.ExitCode ?? 0 : -1; + var exitCode = ranToCompletion ? processWrapper.ExitCode ?? 0 : -1; - if (exitCode == -1) - { - var msg = string.Format("ffmpeg image extraction failed for {0}", inputArgument); + if (exitCode == -1) + { + var msg = string.Format("ffmpeg image extraction failed for {0}", inputArgument); - _logger.Error(msg); + _logger.Error(msg); - throw new ApplicationException(msg); + throw new ApplicationException(msg); + } } } @@ -781,7 +786,7 @@ namespace MediaBrowser.MediaEncoding.Encoder } } - private class ProcessWrapper + private class ProcessWrapper : IDisposable { public readonly Process Process; public bool HasExited; @@ -810,6 +815,25 @@ namespace MediaBrowser.MediaEncoding.Encoder process.Dispose(); } + + private bool _disposed; + private readonly object _syncLock = new object(); + public void Dispose() + { + lock (_syncLock) + { + if (!_disposed) + { + if (Process != null) + { + Process.Exited -= Process_Exited; + Process.Dispose(); + } + } + + _disposed = true; + } + } } } } diff --git a/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs b/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs index b3fe28561..62463d196 100644 --- a/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs +++ b/MediaBrowser.Model/Dlna/ContentFeatureBuilder.cs @@ -1,4 +1,5 @@ using MediaBrowser.Model.MediaInfo; +using System; using System.Collections.Generic; namespace MediaBrowser.Model.Dlna @@ -164,7 +165,7 @@ namespace MediaBrowser.Model.Dlna if (mediaProfile != null && !string.IsNullOrEmpty(mediaProfile.OrgPn)) { - orgPnValues.AddRange(mediaProfile.OrgPn.Split(',')); + orgPnValues.AddRange(mediaProfile.OrgPn.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries)); } else { diff --git a/MediaBrowser.Providers/Manager/ItemImageProvider.cs b/MediaBrowser.Providers/Manager/ItemImageProvider.cs index c95cf6725..92fc1c2a8 100644 --- a/MediaBrowser.Providers/Manager/ItemImageProvider.cs +++ b/MediaBrowser.Providers/Manager/ItemImageProvider.cs @@ -38,12 +38,9 @@ namespace MediaBrowser.Providers.Manager { var hasChanges = false; - var localImageProviders = providers.OfType() - .ToList(); - - if (localImageProviders.Count > 0 || !(item is Photo)) + if (!(item is Photo)) { - var images = localImageProviders + var images = providers.OfType() .SelectMany(i => i.GetImages(item, directoryService)) .ToList(); @@ -425,19 +422,14 @@ namespace MediaBrowser.Providers.Manager var changed = false; var newImages = images.Where(i => i.Type == type).ToList(); - if (newImages.Count > 0) - { - var newImageFileInfos = images.Where(i => i.Type == type) + + var newImageFileInfos = newImages .Select(i => i.FileInfo) .ToList(); - if (newImageFileInfos.Count > 0) - { - if (item.AddImages(type, newImageFileInfos)) - { - changed = true; - } - } + if (item.AddImages(type, newImageFileInfos)) + { + changed = true; } return changed; diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json index ff99c4078..0a922dd0a 100644 --- a/MediaBrowser.Server.Implementations/Localization/Server/server.json +++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json @@ -1447,5 +1447,6 @@ "LabelServerHostHelp": "192.168.1.100 or https://myserver.com", "LabelServerPort": "Port:", "HeaderNewServer": "New Server", - "ButtonChangeServer": "Change Server" + "ButtonChangeServer": "Change Server", + "HeaderConnectToServer": "Connect to Server" } diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.cs index 6c812acce..292f74a56 100644 --- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs +++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs @@ -301,7 +301,7 @@ namespace MediaBrowser.WebDashboard.Api var builder = new StringBuilder(); - foreach (var file in new[] + var apiClientFiles = new[] { "thirdparty/apiclient/logger.js", "thirdparty/apiclient/md5.js", @@ -314,10 +314,20 @@ namespace MediaBrowser.WebDashboard.Api "thirdparty/apiclient/events.js", "thirdparty/apiclient/deferred.js", "thirdparty/apiclient/apiclient.js", - "thirdparty/apiclient/connectservice.js", - "thirdparty/apiclient/serverdiscovery.js", - "thirdparty/apiclient/connectionmanager.js" - }) + "thirdparty/apiclient/connectservice.js" + }.ToList(); + + if (string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase)) + { + apiClientFiles.Add("thirdparty/apiclient/cordova/serverdiscovery.js"); + } + else + { + apiClientFiles.Add("thirdparty/apiclient/serverdiscovery.js"); + } + apiClientFiles.Add("thirdparty/apiclient/connectionmanager.js"); + + foreach (var file in apiClientFiles) { using (var fs = _fileSystem.GetFileStream(GetDashboardResourcePath(file), FileMode.Open, FileAccess.Read, FileShare.ReadWrite, true)) { diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index e39df9602..6b3a0ae7e 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -210,6 +210,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest -- cgit v1.2.3 From e6d9d240e48ebdd0dcf2825d0c0cda60a431fb6f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 6 May 2015 23:11:51 -0400 Subject: fix xbox one browser access --- .../Networking/BaseNetworkManager.cs | 43 +++++++--------------- MediaBrowser.Model/Dlna/CodecProfile.cs | 27 +++++++++++++- MediaBrowser.Model/Dlna/StreamBuilder.cs | 12 +++--- MediaBrowser.Providers/TV/TvdbEpisodeProvider.cs | 15 ++++++-- .../Localization/JavaScript/cs.json | 1 - .../Localization/JavaScript/javascript.json | 3 +- MediaBrowser.WebDashboard/Api/PackageCreator.cs | 1 + .../MediaBrowser.WebDashboard.csproj | 6 +++ 8 files changed, 65 insertions(+), 43 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Localization') diff --git a/MediaBrowser.Common.Implementations/Networking/BaseNetworkManager.cs b/MediaBrowser.Common.Implementations/Networking/BaseNetworkManager.cs index 0fd4e2787..c27dfd68d 100644 --- a/MediaBrowser.Common.Implementations/Networking/BaseNetworkManager.cs +++ b/MediaBrowser.Common.Implementations/Networking/BaseNetworkManager.cs @@ -6,16 +6,29 @@ using System.Linq; using System.Net; using System.Net.NetworkInformation; using System.Net.Sockets; +using System.Threading; namespace MediaBrowser.Common.Implementations.Networking { public abstract class BaseNetworkManager { protected ILogger Logger { get; private set; } + private Timer _clearCacheTimer; protected BaseNetworkManager(ILogger logger) { Logger = logger; + + // Can't use network change events due to a crash in Linux + _clearCacheTimer = new Timer(ClearCacheTimerCallback, null, TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(1)); + } + + private void ClearCacheTimerCallback(object state) + { + lock (_localIpAddressSyncLock) + { + _localIpAddresses = null; + } } private volatile List _localIpAddresses; @@ -36,7 +49,6 @@ namespace MediaBrowser.Common.Implementations.Networking var addresses = GetLocalIpAddressesInternal().ToList(); _localIpAddresses = addresses; - BindEvents(); return addresses; } @@ -46,35 +58,6 @@ namespace MediaBrowser.Common.Implementations.Networking return _localIpAddresses; } - private void BindEvents() - { - NetworkChange.NetworkAddressChanged -= NetworkChange_NetworkAddressChanged; - NetworkChange.NetworkAvailabilityChanged -= NetworkChange_NetworkAvailabilityChanged; - - NetworkChange.NetworkAddressChanged += NetworkChange_NetworkAddressChanged; - NetworkChange.NetworkAvailabilityChanged += NetworkChange_NetworkAvailabilityChanged; - } - - void NetworkChange_NetworkAvailabilityChanged(object sender, NetworkAvailabilityEventArgs e) - { - Logger.Debug("NetworkAvailabilityChanged fired. Resetting cached network info."); - - lock (_localIpAddressSyncLock) - { - _localIpAddresses = null; - } - } - - void NetworkChange_NetworkAddressChanged(object sender, EventArgs e) - { - Logger.Debug("NetworkAddressChanged fired. Resetting cached network info."); - - lock (_localIpAddressSyncLock) - { - _localIpAddresses = null; - } - } - private IEnumerable GetLocalIpAddressesInternal() { var list = GetIPsDefault() diff --git a/MediaBrowser.Model/Dlna/CodecProfile.cs b/MediaBrowser.Model/Dlna/CodecProfile.cs index c2d36dc79..7200f648c 100644 --- a/MediaBrowser.Model/Dlna/CodecProfile.cs +++ b/MediaBrowser.Model/Dlna/CodecProfile.cs @@ -14,6 +14,9 @@ namespace MediaBrowser.Model.Dlna [XmlAttribute("codec")] public string Codec { get; set; } + [XmlAttribute("container")] + public string Container { get; set; } + public CodecProfile() { Conditions = new ProfileCondition[] {}; @@ -29,8 +32,30 @@ namespace MediaBrowser.Model.Dlna return list; } - public bool ContainsCodec(string codec) + public List GetContainers() + { + List list = new List(); + foreach (string i in (Container ?? string.Empty).Split(',')) + { + if (!string.IsNullOrEmpty(i)) list.Add(i); + } + return list; + } + + private bool ContainsContainer(string container) + { + List containers = GetContainers(); + + return containers.Count == 0 || ListHelper.ContainsIgnoreCase(containers, container ?? string.Empty); + } + + public bool ContainsCodec(string codec, string container) { + if (!ContainsContainer(container)) + { + return false; + } + List codecs = GetCodecs(); return codecs.Count == 0 || ListHelper.ContainsIgnoreCase(codecs, codec); diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index 715752d05..8400b204f 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -131,7 +131,7 @@ namespace MediaBrowser.Model.Dlna List conditions = new List(); foreach (CodecProfile i in options.Profile.CodecProfiles) { - if (i.Type == CodecType.Audio && i.ContainsCodec(audioCodec)) + if (i.Type == CodecType.Audio && i.ContainsCodec(audioCodec, item.Container)) { foreach (ProfileCondition c in i.Conditions) { @@ -206,7 +206,7 @@ namespace MediaBrowser.Model.Dlna List audioCodecProfiles = new List(); foreach (CodecProfile i in options.Profile.CodecProfiles) { - if (i.Type == CodecType.Audio && i.ContainsCodec(transcodingProfile.AudioCodec)) + if (i.Type == CodecType.Audio && i.ContainsCodec(transcodingProfile.AudioCodec, transcodingProfile.Container)) { audioCodecProfiles.Add(i); } @@ -423,7 +423,7 @@ namespace MediaBrowser.Model.Dlna List videoTranscodingConditions = new List(); foreach (CodecProfile i in options.Profile.CodecProfiles) { - if (i.Type == CodecType.Video && i.ContainsCodec(transcodingProfile.VideoCodec)) + if (i.Type == CodecType.Video && i.ContainsCodec(transcodingProfile.VideoCodec, transcodingProfile.Container)) { foreach (ProfileCondition c in i.Conditions) { @@ -437,7 +437,7 @@ namespace MediaBrowser.Model.Dlna List audioTranscodingConditions = new List(); foreach (CodecProfile i in options.Profile.CodecProfiles) { - if (i.Type == CodecType.VideoAudio && i.ContainsCodec(transcodingProfile.AudioCodec)) + if (i.Type == CodecType.VideoAudio && i.ContainsCodec(transcodingProfile.AudioCodec, transcodingProfile.Container)) { foreach (ProfileCondition c in i.Conditions) { @@ -600,7 +600,7 @@ namespace MediaBrowser.Model.Dlna conditions = new List(); foreach (CodecProfile i in profile.CodecProfiles) { - if (i.Type == CodecType.Video && i.ContainsCodec(videoCodec)) + if (i.Type == CodecType.Video && i.ContainsCodec(videoCodec, container)) { foreach (ProfileCondition c in i.Conditions) { @@ -635,7 +635,7 @@ namespace MediaBrowser.Model.Dlna conditions = new List(); foreach (CodecProfile i in profile.CodecProfiles) { - if (i.Type == CodecType.VideoAudio && i.ContainsCodec(audioCodec)) + if (i.Type == CodecType.VideoAudio && i.ContainsCodec(audioCodec, container)) { foreach (ProfileCondition c in i.Conditions) { diff --git a/MediaBrowser.Providers/TV/TvdbEpisodeProvider.cs b/MediaBrowser.Providers/TV/TvdbEpisodeProvider.cs index cbd3f0af0..68601b6b2 100644 --- a/MediaBrowser.Providers/TV/TvdbEpisodeProvider.cs +++ b/MediaBrowser.Providers/TV/TvdbEpisodeProvider.cs @@ -5,6 +5,7 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Logging; using MediaBrowser.Model.Providers; using System; using System.Collections.Generic; @@ -29,12 +30,14 @@ namespace MediaBrowser.Providers.TV private readonly IFileSystem _fileSystem; private readonly IServerConfigurationManager _config; private readonly IHttpClient _httpClient; + private readonly ILogger _logger; - public TvdbEpisodeProvider(IFileSystem fileSystem, IServerConfigurationManager config, IHttpClient httpClient) + public TvdbEpisodeProvider(IFileSystem fileSystem, IServerConfigurationManager config, IHttpClient httpClient, ILogger logger) { _fileSystem = fileSystem; _config = config; _httpClient = httpClient; + _logger = logger; Current = this; } @@ -100,7 +103,8 @@ namespace MediaBrowser.Providers.TV try { - result.Item = FetchEpisodeData(searchInfo, identity, seriesDataPath, searchInfo.SeriesProviderIds, cancellationToken); + result.Item = FetchEpisodeData(searchInfo, identity, seriesDataPath, searchInfo.SeriesProviderIds, + cancellationToken); result.HasMetadata = result.Item != null; } catch (FileNotFoundException) @@ -112,6 +116,10 @@ namespace MediaBrowser.Providers.TV // Don't fail the provider because this will just keep on going and going. } } + else + { + _logger.Debug("No series identity found for {0}", searchInfo.Name); + } return result; } @@ -265,7 +273,6 @@ namespace MediaBrowser.Providers.TV FetchMainEpisodeInfo(episode, file, cancellationToken); usingAbsoluteData = true; - success = true; } var end = identity.IndexNumberEnd ?? episodeNumber; @@ -298,7 +305,7 @@ namespace MediaBrowser.Providers.TV episodeNumber++; } - return success ? episode : null; + return episode; } private readonly CultureInfo _usCulture = new CultureInfo("en-US"); diff --git a/MediaBrowser.Server.Implementations/Localization/JavaScript/cs.json b/MediaBrowser.Server.Implementations/Localization/JavaScript/cs.json index ea141645c..2dff86fce 100644 --- a/MediaBrowser.Server.Implementations/Localization/JavaScript/cs.json +++ b/MediaBrowser.Server.Implementations/Localization/JavaScript/cs.json @@ -387,7 +387,6 @@ "ButtonSignOut": "Sign Out", "ButtonMyProfile": "My Profile", "ButtonMyPreferences": "My Preferences", - "MessageBrowserDoesNotSupportWebSockets": "This browser does not support web sockets. For a better experience, try a newer browser such as Chrome, Firefox, IE10+, Safari (iOS) or Opera.", "LabelInstallingPackage": "Installing {0}", "LabelPackageInstallCompleted": "{0} installation completed.", "LabelPackageInstallFailed": "{0} installation failed.", diff --git a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json index 9aa09a75b..ad6b159e7 100644 --- a/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json +++ b/MediaBrowser.Server.Implementations/Localization/JavaScript/javascript.json @@ -770,5 +770,6 @@ "EmbyIntroDownloadMessage": "To download and install Emby Server visit {0}.", "ButtonNewServer": "New Server", "ButtonSignInWithConnect": "Sign in with Emby Connect", - "HeaderNewServer": "New Server" + "HeaderNewServer": "New Server", + "MyDevice": "My Device" } diff --git a/MediaBrowser.WebDashboard/Api/PackageCreator.cs b/MediaBrowser.WebDashboard/Api/PackageCreator.cs index 292f74a56..89ae4a9b6 100644 --- a/MediaBrowser.WebDashboard/Api/PackageCreator.cs +++ b/MediaBrowser.WebDashboard/Api/PackageCreator.cs @@ -281,6 +281,7 @@ namespace MediaBrowser.WebDashboard.Api await AppendResource(memoryStream, "thirdparty/jstree3.0.8/jstree.js", newLineBytes).ConfigureAwait(false); + await AppendResource(memoryStream, "thirdparty/fastclick.js", newLineBytes).ConfigureAwait(false); await AppendResource(memoryStream, "thirdparty/headroom.js", newLineBytes).ConfigureAwait(false); await AppendLocalization(memoryStream, culture).ConfigureAwait(false); diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index 6b3a0ae7e..7582daab9 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -90,6 +90,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest @@ -993,6 +996,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest -- cgit v1.2.3 From 63dc2512c5d272dbc3cb1515beb175e9b3572440 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 7 May 2015 10:04:10 -0400 Subject: rename web client tab --- MediaBrowser.Server.Implementations/Localization/Server/server.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'MediaBrowser.Server.Implementations/Localization') diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json index 0a922dd0a..368d11646 100644 --- a/MediaBrowser.Server.Implementations/Localization/Server/server.json +++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json @@ -882,7 +882,7 @@ "MessageNoSubtitleSearchResultsFound": "No search results founds.", "TabDisplay": "Display", "TabLanguages": "Languages", - "TabWebClient": "Web Client", + "TabAppSettings": "App Settings", "LabelEnableThemeSongs": "Enable theme songs", "LabelEnableBackdrops": "Enable backdrops", "LabelEnableThemeSongsHelp": "If enabled, theme songs will be played in the background while browsing the library.", -- cgit v1.2.3