diff --git a/MediaBrowser.Controller/Entities/IHasMediaSources.cs b/MediaBrowser.Controller/Entities/IHasMediaSources.cs
index 0b0dd1bf8..da040f296 100644
--- a/MediaBrowser.Controller/Entities/IHasMediaSources.cs
+++ b/MediaBrowser.Controller/Entities/IHasMediaSources.cs
@@ -1,5 +1,9 @@
-using MediaBrowser.Model.Dto;
+using MediaBrowser.Controller.MediaEncoding;
+using MediaBrowser.Model.Dto;
+using MediaBrowser.Model.Entities;
+using System;
using System.Collections.Generic;
+using System.Linq;
namespace MediaBrowser.Controller.Entities
{
@@ -12,4 +16,53 @@ namespace MediaBrowser.Controller.Entities
/// Task{IEnumerable{MediaSourceInfo}}.
IEnumerable GetMediaSources(bool enablePathSubstitution);
}
+
+ public static class HasMediaSourceExtensions
+ {
+ public static IEnumerable GetMediaSources(this IHasMediaSources item, bool enablePathSubstitution, User user)
+ {
+ if (item == null)
+ {
+ throw new ArgumentNullException("item");
+ }
+
+ if (!(item is Video))
+ {
+ return item.GetMediaSources(enablePathSubstitution);
+ }
+
+ if (user == null)
+ {
+ throw new ArgumentNullException("user");
+ }
+
+ var sources = item.GetMediaSources(enablePathSubstitution).ToList();
+
+ var preferredAudio = string.IsNullOrEmpty(user.Configuration.AudioLanguagePreference)
+ ? new string[] { }
+ : new[] { user.Configuration.AudioLanguagePreference };
+
+ var preferredSubs = string.IsNullOrEmpty(user.Configuration.SubtitleLanguagePreference)
+ ? new string[] { }
+ : new[] { user.Configuration.SubtitleLanguagePreference };
+
+ foreach (var source in sources)
+ {
+ source.DefaultAudioStreamIndex = MediaStreamSelector.GetDefaultAudioStreamIndex(
+ source.MediaStreams, preferredAudio, user.Configuration.PlayDefaultAudioTrack);
+
+ var defaultAudioIndex = source.DefaultAudioStreamIndex;
+ var audioLangage = defaultAudioIndex == null
+ ? null
+ : source.MediaStreams.Where(i => i.Type == MediaStreamType.Audio && i.Index == defaultAudioIndex).Select(i => i.Language).FirstOrDefault();
+
+ source.DefaultSubtitleStreamIndex = MediaStreamSelector.GetDefaultSubtitleStreamIndex(source.MediaStreams,
+ preferredSubs,
+ user.Configuration.SubtitleMode,
+ audioLangage);
+ }
+
+ return sources;
+ }
+ }
}
diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
index addcaea8d..5f3a06f79 100644
--- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj
+++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
@@ -192,6 +192,7 @@
+
diff --git a/MediaBrowser.Server.Implementations/Dto/MediaStreamSelector.cs b/MediaBrowser.Controller/MediaEncoding/MediaStreamSelector.cs
similarity index 98%
rename from MediaBrowser.Server.Implementations/Dto/MediaStreamSelector.cs
rename to MediaBrowser.Controller/MediaEncoding/MediaStreamSelector.cs
index c2dc1ef24..58a68c257 100644
--- a/MediaBrowser.Server.Implementations/Dto/MediaStreamSelector.cs
+++ b/MediaBrowser.Controller/MediaEncoding/MediaStreamSelector.cs
@@ -4,7 +4,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
-namespace MediaBrowser.Server.Implementations.Dto
+namespace MediaBrowser.Controller.MediaEncoding
{
public static class MediaStreamSelector
{
diff --git a/MediaBrowser.Dlna/ContentDirectory/ContentDirectory.cs b/MediaBrowser.Dlna/ContentDirectory/ContentDirectory.cs
index 5f0a863e7..bb65f422c 100644
--- a/MediaBrowser.Dlna/ContentDirectory/ContentDirectory.cs
+++ b/MediaBrowser.Dlna/ContentDirectory/ContentDirectory.cs
@@ -2,7 +2,6 @@
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Dlna;
using MediaBrowser.Controller.Drawing;
-using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Dlna.Service;
@@ -17,7 +16,6 @@ namespace MediaBrowser.Dlna.ContentDirectory
public class ContentDirectory : BaseService, IContentDirectory, IDisposable
{
private readonly ILibraryManager _libraryManager;
- private readonly IDtoService _dtoService;
private readonly IImageProcessor _imageProcessor;
private readonly IUserDataManager _userDataManager;
private readonly IDlnaManager _dlna;
@@ -27,7 +25,6 @@ namespace MediaBrowser.Dlna.ContentDirectory
public ContentDirectory(IDlnaManager dlna,
IUserDataManager userDataManager,
IImageProcessor imageProcessor,
- IDtoService dtoService,
ILibraryManager libraryManager,
IServerConfigurationManager config,
IUserManager userManager,
@@ -38,7 +35,6 @@ namespace MediaBrowser.Dlna.ContentDirectory
_dlna = dlna;
_userDataManager = userDataManager;
_imageProcessor = imageProcessor;
- _dtoService = dtoService;
_libraryManager = libraryManager;
_config = config;
_userManager = userManager;
@@ -73,7 +69,6 @@ namespace MediaBrowser.Dlna.ContentDirectory
_libraryManager,
profile,
serverAddress,
- _dtoService,
_imageProcessor,
_userDataManager,
user,
diff --git a/MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs b/MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs
index 0e4f0d8f9..2ba018ad2 100644
--- a/MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs
+++ b/MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs
@@ -1,7 +1,6 @@
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Drawing;
-using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Entities.Movies;
@@ -42,7 +41,7 @@ namespace MediaBrowser.Dlna.ContentDirectory
private readonly DeviceProfile _profile;
- public ControlHandler(ILogger logger, ILibraryManager libraryManager, DeviceProfile profile, string serverAddress, IDtoService dtoService, IImageProcessor imageProcessor, IUserDataManager userDataManager, User user, int systemUpdateId, IServerConfigurationManager config)
+ public ControlHandler(ILogger logger, ILibraryManager libraryManager, DeviceProfile profile, string serverAddress, IImageProcessor imageProcessor, IUserDataManager userDataManager, User user, int systemUpdateId, IServerConfigurationManager config)
: base(config, logger)
{
_libraryManager = libraryManager;
@@ -51,7 +50,7 @@ namespace MediaBrowser.Dlna.ContentDirectory
_systemUpdateId = systemUpdateId;
_profile = profile;
- _didlBuilder = new DidlBuilder(profile, imageProcessor, serverAddress, dtoService);
+ _didlBuilder = new DidlBuilder(profile, user, imageProcessor, serverAddress);
}
protected override IEnumerable> GetResult(string methodName, Headers methodParams)
diff --git a/MediaBrowser.Dlna/Didl/DidlBuilder.cs b/MediaBrowser.Dlna/Didl/DidlBuilder.cs
index c60b3a49a..ad641ce16 100644
--- a/MediaBrowser.Dlna/Didl/DidlBuilder.cs
+++ b/MediaBrowser.Dlna/Didl/DidlBuilder.cs
@@ -1,7 +1,5 @@
-using System.Collections.Generic;
-using MediaBrowser.Common.Net;
+using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Drawing;
-using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Entities.Movies;
@@ -10,6 +8,7 @@ using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Drawing;
using MediaBrowser.Model.Entities;
using System;
+using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Xml;
@@ -28,14 +27,14 @@ namespace MediaBrowser.Dlna.Didl
private readonly DeviceProfile _profile;
private readonly IImageProcessor _imageProcessor;
private readonly string _serverAddress;
- private readonly IDtoService _dtoService;
+ private readonly User _user;
- public DidlBuilder(DeviceProfile profile, IImageProcessor imageProcessor, string serverAddress, IDtoService dtoService)
+ public DidlBuilder(DeviceProfile profile, User user, IImageProcessor imageProcessor, string serverAddress)
{
_profile = profile;
_imageProcessor = imageProcessor;
_serverAddress = serverAddress;
- _dtoService = dtoService;
+ _user = user;
}
public string GetItemDidl(BaseItem item, string deviceId, Filter filter)
@@ -99,9 +98,7 @@ namespace MediaBrowser.Dlna.Didl
{
var res = container.OwnerDocument.CreateElement(string.Empty, "res", NS_DIDL);
- var sources = _dtoService.GetMediaSources(video);
-
- int? maxBitrateSetting = null;
+ var sources = _user == null ? video.GetMediaSources(true).ToList() : video.GetMediaSources(true, _user).ToList();
var streamInfo = new StreamBuilder().BuildVideoItem(new VideoOptions
{
@@ -109,11 +106,11 @@ namespace MediaBrowser.Dlna.Didl
MediaSources = sources,
Profile = _profile,
DeviceId = deviceId,
- MaxBitrate = maxBitrateSetting
+ MaxBitrate = _profile.MaxBitrate
});
var url = streamInfo.ToDlnaUrl(_serverAddress);
- //res.AppendChild(container.OwnerDocument.CreateCDataSection(url));
+
res.InnerText = url;
var mediaSource = sources.First(i => string.Equals(i.Id, streamInfo.MediaSourceId));
@@ -218,7 +215,7 @@ namespace MediaBrowser.Dlna.Didl
{
var res = container.OwnerDocument.CreateElement(string.Empty, "res", NS_DIDL);
- var sources = _dtoService.GetMediaSources(audio);
+ var sources = _user == null ? audio.GetMediaSources(true).ToList() : audio.GetMediaSources(true, _user).ToList();
var streamInfo = new StreamBuilder().BuildAudioItem(new AudioOptions
{
@@ -229,7 +226,7 @@ namespace MediaBrowser.Dlna.Didl
});
var url = streamInfo.ToDlnaUrl(_serverAddress);
- //res.AppendChild(container.OwnerDocument.CreateCDataSection(url));
+
res.InnerText = url;
var mediaSource = sources.First(i => string.Equals(i.Id, streamInfo.MediaSourceId));
diff --git a/MediaBrowser.Dlna/Main/DlnaEntryPoint.cs b/MediaBrowser.Dlna/Main/DlnaEntryPoint.cs
index 5be2a040a..048525588 100644
--- a/MediaBrowser.Dlna/Main/DlnaEntryPoint.cs
+++ b/MediaBrowser.Dlna/Main/DlnaEntryPoint.cs
@@ -4,7 +4,6 @@ using MediaBrowser.Controller;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Dlna;
using MediaBrowser.Controller.Drawing;
-using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Controller.Plugins;
@@ -32,7 +31,6 @@ namespace MediaBrowser.Dlna.Main
private readonly ILibraryManager _libraryManager;
private readonly IUserManager _userManager;
private readonly IDlnaManager _dlnaManager;
- private readonly IDtoService _dtoService;
private readonly IImageProcessor _imageProcessor;
private SsdpHandler _ssdpHandler;
@@ -40,7 +38,7 @@ namespace MediaBrowser.Dlna.Main
private readonly List _registeredServerIds = new List();
private bool _dlnaServerStarted;
- public DlnaEntryPoint(IServerConfigurationManager config, ILogManager logManager, IServerApplicationHost appHost, INetworkManager network, ISessionManager sessionManager, IHttpClient httpClient, IItemRepository itemRepo, ILibraryManager libraryManager, IUserManager userManager, IDlnaManager dlnaManager, IDtoService dtoService, IImageProcessor imageProcessor)
+ public DlnaEntryPoint(IServerConfigurationManager config, ILogManager logManager, IServerApplicationHost appHost, INetworkManager network, ISessionManager sessionManager, IHttpClient httpClient, IItemRepository itemRepo, ILibraryManager libraryManager, IUserManager userManager, IDlnaManager dlnaManager, IImageProcessor imageProcessor)
{
_config = config;
_appHost = appHost;
@@ -51,7 +49,6 @@ namespace MediaBrowser.Dlna.Main
_libraryManager = libraryManager;
_userManager = userManager;
_dlnaManager = dlnaManager;
- _dtoService = dtoService;
_imageProcessor = imageProcessor;
_logger = logManager.GetLogger("Dlna");
}
@@ -197,7 +194,6 @@ namespace MediaBrowser.Dlna.Main
_userManager,
_dlnaManager,
_appHost,
- _dtoService,
_imageProcessor,
_ssdpHandler);
diff --git a/MediaBrowser.Dlna/PlayTo/PlayToController.cs b/MediaBrowser.Dlna/PlayTo/PlayToController.cs
index 35ebb4cf9..47fd062aa 100644
--- a/MediaBrowser.Dlna/PlayTo/PlayToController.cs
+++ b/MediaBrowser.Dlna/PlayTo/PlayToController.cs
@@ -1,6 +1,5 @@
using MediaBrowser.Controller.Dlna;
using MediaBrowser.Controller.Drawing;
-using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Library;
@@ -13,13 +12,13 @@ using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Session;
+using MediaBrowser.Model.System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
-using MediaBrowser.Model.System;
namespace MediaBrowser.Dlna.PlayTo
{
@@ -33,7 +32,6 @@ namespace MediaBrowser.Dlna.PlayTo
private readonly ILogger _logger;
private readonly IDlnaManager _dlnaManager;
private readonly IUserManager _userManager;
- private readonly IDtoService _dtoService;
private readonly IImageProcessor _imageProcessor;
private readonly SsdpHandler _ssdpHandler;
@@ -54,7 +52,7 @@ namespace MediaBrowser.Dlna.PlayTo
private Timer _updateTimer;
- public PlayToController(SessionInfo session, ISessionManager sessionManager, IItemRepository itemRepository, ILibraryManager libraryManager, ILogger logger, IDlnaManager dlnaManager, IUserManager userManager, IDtoService dtoService, IImageProcessor imageProcessor, SsdpHandler ssdpHandler, string serverAddress)
+ public PlayToController(SessionInfo session, ISessionManager sessionManager, IItemRepository itemRepository, ILibraryManager libraryManager, ILogger logger, IDlnaManager dlnaManager, IUserManager userManager, IImageProcessor imageProcessor, SsdpHandler ssdpHandler, string serverAddress)
{
_session = session;
_itemRepository = itemRepository;
@@ -62,7 +60,6 @@ namespace MediaBrowser.Dlna.PlayTo
_libraryManager = libraryManager;
_dlnaManager = dlnaManager;
_userManager = userManager;
- _dtoService = dtoService;
_imageProcessor = imageProcessor;
_ssdpHandler = ssdpHandler;
_serverAddress = serverAddress;
@@ -228,6 +225,8 @@ namespace MediaBrowser.Dlna.PlayTo
{
_logger.Debug("{0} - Received PlayRequest: {1}", this._session.DeviceName, command.PlayCommand);
+ var user = string.IsNullOrEmpty(command.ControllingUserId) ? null : _userManager.GetUserById(new Guid(command.ControllingUserId));
+
var items = new List();
foreach (string id in command.ItemIds)
{
@@ -243,12 +242,12 @@ namespace MediaBrowser.Dlna.PlayTo
{
if (isFirst && command.StartPositionTicks.HasValue)
{
- playlist.Add(CreatePlaylistItem(item, command.StartPositionTicks.Value, serverAddress));
+ playlist.Add(CreatePlaylistItem(item, user, command.StartPositionTicks.Value, serverAddress));
isFirst = false;
}
else
{
- playlist.Add(CreatePlaylistItem(item, 0, serverAddress));
+ playlist.Add(CreatePlaylistItem(item, user, 0, serverAddress));
}
}
@@ -267,10 +266,6 @@ namespace MediaBrowser.Dlna.PlayTo
if (!string.IsNullOrWhiteSpace(command.ControllingUserId))
{
- var userId = new Guid(command.ControllingUserId);
-
- var user = _userManager.GetUserById(userId);
-
await _sessionManager.LogSessionActivity(_session.Client, _session.ApplicationVersion, _session.DeviceId,
_session.DeviceName, _session.RemoteEndPoint, user).ConfigureAwait(false);
}
@@ -388,15 +383,16 @@ namespace MediaBrowser.Dlna.PlayTo
}
}
- private PlaylistItem CreatePlaylistItem(BaseItem item, long startPostionTicks, string serverAddress)
+ private PlaylistItem CreatePlaylistItem(BaseItem item, User user, long startPostionTicks, string serverAddress)
{
var deviceInfo = _device.Properties;
var profile = _dlnaManager.GetProfile(deviceInfo.ToDeviceIdentification()) ??
_dlnaManager.GetDefaultProfile();
- var mediaSources = item is Audio || item is Video
- ? _dtoService.GetMediaSources(item)
+ var hasMediaSources = item as IHasMediaSources;
+ var mediaSources = hasMediaSources != null
+ ? (user == null ? hasMediaSources.GetMediaSources(true) : hasMediaSources.GetMediaSources(true, user)).ToList()
: new List();
var playlistItem = GetPlaylistItem(item, mediaSources, profile, _session.DeviceId);
@@ -404,9 +400,7 @@ namespace MediaBrowser.Dlna.PlayTo
playlistItem.StreamUrl = playlistItem.StreamInfo.ToUrl(serverAddress);
- var itemXml =
- new DidlBuilder(profile, _imageProcessor, serverAddress, _dtoService).GetItemDidl(item, _session.DeviceId,
- new Filter());
+ var itemXml = new DidlBuilder(profile, user, _imageProcessor, serverAddress).GetItemDidl(item, _session.DeviceId, new Filter());
playlistItem.Didl = itemXml;
diff --git a/MediaBrowser.Dlna/PlayTo/PlayToManager.cs b/MediaBrowser.Dlna/PlayTo/PlayToManager.cs
index 240a87b90..d4beee8d4 100644
--- a/MediaBrowser.Dlna/PlayTo/PlayToManager.cs
+++ b/MediaBrowser.Dlna/PlayTo/PlayToManager.cs
@@ -3,7 +3,6 @@ using MediaBrowser.Controller;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Dlna;
using MediaBrowser.Controller.Drawing;
-using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Controller.Session;
@@ -36,12 +35,11 @@ namespace MediaBrowser.Dlna.PlayTo
private readonly IDlnaManager _dlnaManager;
private readonly IServerConfigurationManager _config;
private readonly IServerApplicationHost _appHost;
- private readonly IDtoService _dtoService;
private readonly IImageProcessor _imageProcessor;
private readonly SsdpHandler _ssdpHandler;
- public PlayToManager(ILogger logger, IServerConfigurationManager config, ISessionManager sessionManager, IHttpClient httpClient, IItemRepository itemRepository, ILibraryManager libraryManager, IUserManager userManager, IDlnaManager dlnaManager, IServerApplicationHost appHost, IDtoService dtoService, IImageProcessor imageProcessor, SsdpHandler ssdpHandler)
+ public PlayToManager(ILogger logger, IServerConfigurationManager config, ISessionManager sessionManager, IHttpClient httpClient, IItemRepository itemRepository, ILibraryManager libraryManager, IUserManager userManager, IDlnaManager dlnaManager, IServerApplicationHost appHost, IImageProcessor imageProcessor, SsdpHandler ssdpHandler)
{
_tokenSource = new CancellationTokenSource();
@@ -53,7 +51,6 @@ namespace MediaBrowser.Dlna.PlayTo
_userManager = userManager;
_dlnaManager = dlnaManager;
_appHost = appHost;
- _dtoService = dtoService;
_imageProcessor = imageProcessor;
_ssdpHandler = ssdpHandler;
_config = config;
@@ -284,7 +281,6 @@ namespace MediaBrowser.Dlna.PlayTo
_logger,
_dlnaManager,
_userManager,
- _dtoService,
_imageProcessor,
_ssdpHandler,
serverAddress);
diff --git a/MediaBrowser.MediaEncoding/Subtitles/VttWriter.cs b/MediaBrowser.MediaEncoding/Subtitles/VttWriter.cs
index d570bec1c..36a05adae 100644
--- a/MediaBrowser.MediaEncoding/Subtitles/VttWriter.cs
+++ b/MediaBrowser.MediaEncoding/Subtitles/VttWriter.cs
@@ -21,7 +21,8 @@ namespace MediaBrowser.MediaEncoding.Subtitles
writer.WriteLine(@"{0:hh\:mm\:ss\.fff} --> {1:hh\:mm\:ss\.fff}", TimeSpan.FromTicks(trackEvent.StartPositionTicks), TimeSpan.FromTicks(trackEvent.EndPositionTicks));
- var text = Regex.Replace(trackEvent.Text, @"\\N", "
", RegexOptions.IgnoreCase);
+ var text = trackEvent.Text;
+ //text = Regex.Replace(text, @"\\N", "
", RegexOptions.IgnoreCase);
writer.WriteLine(text);
writer.WriteLine(string.Empty);
diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj
index 99a5f6692..9efa63283 100644
--- a/MediaBrowser.Model/MediaBrowser.Model.csproj
+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj
@@ -49,6 +49,12 @@
Always
+
+ false
+
+
+ MediaBrowser.Model.snk
+
Properties\SharedVersion.cs
@@ -325,6 +331,7 @@
+
diff --git a/MediaBrowser.Model/MediaBrowser.Model.snk b/MediaBrowser.Model/MediaBrowser.Model.snk
new file mode 100644
index 000000000..f8188c78e
Binary files /dev/null and b/MediaBrowser.Model/MediaBrowser.Model.snk differ
diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs
index a43c51282..6a0723c52 100644
--- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs
+++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs
@@ -103,6 +103,22 @@ namespace MediaBrowser.Server.Implementations.Dto
AttachUserSpecificInfo(dto, item, user, fields);
}
+ var hasMediaSources = item as IHasMediaSources;
+ if (hasMediaSources != null)
+ {
+ if (fields.Contains(ItemFields.MediaSources))
+ {
+ if (user == null)
+ {
+ dto.MediaSources = hasMediaSources.GetMediaSources(true).ToList();
+ }
+ else
+ {
+ dto.MediaSources = hasMediaSources.GetMediaSources(true, user).ToList();
+ }
+ }
+ }
+
if (fields.Contains(ItemFields.Studios))
{
AttachStudios(dto, item);
@@ -110,33 +126,6 @@ namespace MediaBrowser.Server.Implementations.Dto
AttachBasicFields(dto, item, owner, fields);
- if (user != null && dto.MediaSources != null && item is Video)
- {
- var preferredAudio = string.IsNullOrEmpty(user.Configuration.AudioLanguagePreference)
- ? new string[] { }
- : new[] { user.Configuration.AudioLanguagePreference };
-
- var preferredSubs = string.IsNullOrEmpty(user.Configuration.SubtitleLanguagePreference)
- ? new string[] { }
- : new[] { user.Configuration.SubtitleLanguagePreference };
-
- foreach (var source in dto.MediaSources)
- {
- source.DefaultAudioStreamIndex = MediaStreamSelector.GetDefaultAudioStreamIndex(
- source.MediaStreams, preferredAudio, user.Configuration.PlayDefaultAudioTrack);
-
- var defaultAudioIndex = source.DefaultAudioStreamIndex;
- var audioLangage = defaultAudioIndex == null
- ? null
- : source.MediaStreams.Where(i => i.Type == MediaStreamType.Audio && i.Index == defaultAudioIndex).Select(i => i.Language).FirstOrDefault();
-
- source.DefaultSubtitleStreamIndex = MediaStreamSelector.GetDefaultSubtitleStreamIndex(source.MediaStreams,
- preferredSubs,
- user.Configuration.SubtitleMode,
- audioLangage);
- }
- }
-
if (fields.Contains(ItemFields.SoundtrackIds))
{
var hasSoundtracks = item as IHasSoundtracks;
@@ -926,11 +915,6 @@ namespace MediaBrowser.Server.Implementations.Dto
}
dto.MediaSourceCount = 1;
-
- if (fields.Contains(ItemFields.MediaSources))
- {
- dto.MediaSources = GetMediaSources(audio);
- }
}
var album = item as MusicAlbum;
@@ -963,11 +947,6 @@ namespace MediaBrowser.Server.Implementations.Dto
dto.PartCount = video.AdditionalPartIds.Count + 1;
dto.MediaSourceCount = video.MediaSourceCount;
- if (fields.Contains(ItemFields.MediaSources))
- {
- dto.MediaSources = GetMediaSources(video);
- }
-
if (fields.Contains(ItemFields.Chapters))
{
List chapters;
diff --git a/MediaBrowser.Server.Implementations/LiveTv/ChannelImageProvider.cs b/MediaBrowser.Server.Implementations/LiveTv/ChannelImageProvider.cs
index 83d8e4b73..564fa1a0b 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/ChannelImageProvider.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/ChannelImageProvider.cs
@@ -109,7 +109,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
if (liveTvItem != null)
{
- return !liveTvItem.HasImage(ImageType.Primary) && (liveTvItem.HasProviderImage ?? true) && (DateTime.UtcNow - date).TotalHours >= 6;
+ return !liveTvItem.HasImage(ImageType.Primary) && (liveTvItem.HasProviderImage ?? true);
}
return false;
}
diff --git a/MediaBrowser.Server.Implementations/LiveTv/ProgramImageProvider.cs b/MediaBrowser.Server.Implementations/LiveTv/ProgramImageProvider.cs
index 081722bb2..06210e03b 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/ProgramImageProvider.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/ProgramImageProvider.cs
@@ -109,7 +109,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
if (liveTvItem != null)
{
- return !liveTvItem.HasImage(ImageType.Primary) && (liveTvItem.HasProviderImage ?? true) && (DateTime.UtcNow - date).TotalHours >= 6;
+ return !liveTvItem.HasImage(ImageType.Primary) && (liveTvItem.HasProviderImage ?? true);
}
return false;
}
diff --git a/MediaBrowser.Server.Implementations/LiveTv/RecordingImageProvider.cs b/MediaBrowser.Server.Implementations/LiveTv/RecordingImageProvider.cs
index 7aa5dcebd..e615305dc 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/RecordingImageProvider.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/RecordingImageProvider.cs
@@ -109,7 +109,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
if (liveTvItem != null)
{
- return !liveTvItem.HasImage(ImageType.Primary) && (liveTvItem.RecordingInfo.HasImage ?? true) && (DateTime.UtcNow - date).TotalHours >= 6;
+ return !liveTvItem.HasImage(ImageType.Primary) && (liveTvItem.RecordingInfo.HasImage ?? true);
}
return false;
}
diff --git a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj
index 563c5d76a..18c2d8582 100644
--- a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj
+++ b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj
@@ -112,7 +112,6 @@
-
diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs
index 1c1595093..770d945d5 100644
--- a/MediaBrowser.ServerApplication/ApplicationHost.cs
+++ b/MediaBrowser.ServerApplication/ApplicationHost.cs
@@ -521,7 +521,7 @@ namespace MediaBrowser.ServerApplication
var dlnaManager = new DlnaManager(XmlSerializer, FileSystemManager, ApplicationPaths, LogManager.GetLogger("Dlna"), JsonSerializer);
RegisterSingleInstance(dlnaManager);
- var contentDirectory = new ContentDirectory(dlnaManager, UserDataManager, ImageProcessor, DtoService, LibraryManager, ServerConfigurationManager, UserManager, LogManager.GetLogger("UpnpContentDirectory"), HttpClient);
+ var contentDirectory = new ContentDirectory(dlnaManager, UserDataManager, ImageProcessor, LibraryManager, ServerConfigurationManager, UserManager, LogManager.GetLogger("UpnpContentDirectory"), HttpClient);
RegisterSingleInstance(contentDirectory);
var connectionManager = new ConnectionManager(dlnaManager, ServerConfigurationManager, LogManager.GetLogger("UpnpConnectionManager"), HttpClient);
diff --git a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj
index 2ab245c66..7657fc091 100644
--- a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj
+++ b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj
@@ -61,14 +61,14 @@
- ..\packages\MediaBrowser.IsoMounting.3.0.65\lib\net45\MediaBrowser.IsoMounter.dll
+ ..\packages\MediaBrowser.IsoMounting.3.0.68\lib\net45\MediaBrowser.IsoMounter.dll
False
..\packages\NLog.3.0.0.0\lib\net45\NLog.dll
- ..\packages\MediaBrowser.IsoMounting.3.0.65\lib\net45\pfmclrapi.dll
+ ..\packages\MediaBrowser.IsoMounting.3.0.68\lib\net45\pfmclrapi.dll
..\ThirdParty\ServiceStack\ServiceStack.Interfaces.dll
diff --git a/MediaBrowser.ServerApplication/packages.config b/MediaBrowser.ServerApplication/packages.config
index 8a9f17d96..87bd11bd4 100644
--- a/MediaBrowser.ServerApplication/packages.config
+++ b/MediaBrowser.ServerApplication/packages.config
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec
index 8aa32dc81..68434ab1d 100644
--- a/Nuget/MediaBrowser.Common.Internal.nuspec
+++ b/Nuget/MediaBrowser.Common.Internal.nuspec
@@ -2,7 +2,7 @@
MediaBrowser.Common.Internal
- 3.0.401
+ 3.0.405
MediaBrowser.Common.Internal
Luke
ebr,Luke,scottisafool
@@ -12,7 +12,7 @@
Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.
Copyright © Media Browser 2013
-
+
diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec
index 0c97d2113..5f2bae74d 100644
--- a/Nuget/MediaBrowser.Common.nuspec
+++ b/Nuget/MediaBrowser.Common.nuspec
@@ -2,7 +2,7 @@
MediaBrowser.Common
- 3.0.401
+ 3.0.405
MediaBrowser.Common
Media Browser Team
ebr,Luke,scottisafool
diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec
index ed1c21b13..91dfb4d7a 100644
--- a/Nuget/MediaBrowser.Server.Core.nuspec
+++ b/Nuget/MediaBrowser.Server.Core.nuspec
@@ -2,7 +2,7 @@
MediaBrowser.Server.Core
- 3.0.401
+ 3.0.405
Media Browser.Server.Core
Media Browser Team
ebr,Luke,scottisafool
@@ -12,7 +12,7 @@
Contains core components required to build plugins for Media Browser Server.
Copyright © Media Browser 2013
-
+