made dlna cast & crew optional

This commit is contained in:
Luke Pulverenti 2015-03-04 23:13:08 -05:00
parent 52a2ff5a2e
commit 30e782d307
3 changed files with 16 additions and 7 deletions

View File

@ -11,6 +11,7 @@ using MediaBrowser.Dlna.Didl;
using MediaBrowser.Dlna.Server; using MediaBrowser.Dlna.Server;
using MediaBrowser.Dlna.Service; using MediaBrowser.Dlna.Service;
using MediaBrowser.Model.Channels; using MediaBrowser.Model.Channels;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
@ -31,6 +32,7 @@ namespace MediaBrowser.Dlna.ContentDirectory
private readonly ILibraryManager _libraryManager; private readonly ILibraryManager _libraryManager;
private readonly IChannelManager _channelManager; private readonly IChannelManager _channelManager;
private readonly IUserDataManager _userDataManager; private readonly IUserDataManager _userDataManager;
private IServerConfigurationManager _config;
private readonly User _user; private readonly User _user;
private const string NS_DC = "http://purl.org/dc/elements/1.1/"; private const string NS_DC = "http://purl.org/dc/elements/1.1/";
@ -54,6 +56,7 @@ namespace MediaBrowser.Dlna.ContentDirectory
_systemUpdateId = systemUpdateId; _systemUpdateId = systemUpdateId;
_channelManager = channelManager; _channelManager = channelManager;
_profile = profile; _profile = profile;
_config = config;
_didlBuilder = new DidlBuilder(profile, user, imageProcessor, serverAddress, accessToken, userDataManager, localization); _didlBuilder = new DidlBuilder(profile, user, imageProcessor, serverAddress, accessToken, userDataManager, localization);
} }
@ -465,12 +468,14 @@ namespace MediaBrowser.Dlna.ContentDirectory
}).ConfigureAwait(false); }).ConfigureAwait(false);
var options = _config.GetDlnaConfiguration();
var serverItems = queryResult var serverItems = queryResult
.Items .Items
.Select(i => new ServerItem .Select(i => new ServerItem
{ {
Item = i, Item = i,
StubType = GetDisplayStubType(i, item) StubType = GetDisplayStubType(i, item, options)
}) })
.ToArray(); .ToArray();
@ -539,25 +544,25 @@ namespace MediaBrowser.Dlna.ContentDirectory
return result; return result;
} }
private StubType? GetDisplayStubType(BaseItem item, BaseItem context) private StubType? GetDisplayStubType(BaseItem item, BaseItem context, DlnaOptions options)
{ {
if (context == null || context.IsFolder) if (context == null || context.IsFolder)
{ {
var movie = item as Movie; var movie = item as Movie;
if (movie != null) if (movie != null && options.EnableEnhancedMovies)
{ {
if (movie.GetTrailerIds().Count > 0 || if (movie.GetTrailerIds().Count > 0 ||
movie.SpecialFeatureIds.Count > 0) movie.SpecialFeatureIds.Count > 0)
{ {
return StubType.Folder; return StubType.Folder;
} }
}
if (EnablePeopleDisplay(item)) if (EnablePeopleDisplay(item))
{ {
return StubType.Folder; return StubType.Folder;
} }
} }
}
return null; return null;
} }

View File

@ -10,6 +10,7 @@ namespace MediaBrowser.Model.Configuration
public int ClientDiscoveryIntervalSeconds { get; set; } public int ClientDiscoveryIntervalSeconds { get; set; }
public int BlastAliveMessageIntervalSeconds { get; set; } public int BlastAliveMessageIntervalSeconds { get; set; }
public string DefaultUserId { get; set; } public string DefaultUserId { get; set; }
public bool EnableEnhancedMovies { get; set; }
public DlnaOptions() public DlnaOptions()
{ {
@ -18,6 +19,7 @@ namespace MediaBrowser.Model.Configuration
BlastAliveMessages = true; BlastAliveMessages = true;
ClientDiscoveryIntervalSeconds = 60; ClientDiscoveryIntervalSeconds = 60;
BlastAliveMessageIntervalSeconds = 30; BlastAliveMessageIntervalSeconds = 30;
EnableEnhancedMovies = true;
} }
} }
} }

View File

@ -78,6 +78,8 @@
"OptionDetectArchiveFilesAsMediaHelp": "If enabled, files with .rar and .zip extensions will be detected as media files.", "OptionDetectArchiveFilesAsMediaHelp": "If enabled, files with .rar and .zip extensions will be detected as media files.",
"LabelEnterConnectUserName": "User name or email:", "LabelEnterConnectUserName": "User name or email:",
"LabelEnterConnectUserNameHelp": "This is your Media Browser online account user name or password.", "LabelEnterConnectUserNameHelp": "This is your Media Browser online account user name or password.",
"LabelEnableEnhancedMovies": "Enable enhanced movie displays",
"LabelEnableEnhancedMoviesHelp": "When enabled, movies will be displayed as folders to include trailers, extras, cast & crew, and other related content.",
"HeaderSyncJobInfo": "Sync Job", "HeaderSyncJobInfo": "Sync Job",
"FolderTypeMixed": "Mixed content", "FolderTypeMixed": "Mixed content",
"FolderTypeMovies": "Movies", "FolderTypeMovies": "Movies",