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

View File

@ -10,6 +10,7 @@ namespace MediaBrowser.Model.Configuration
public int ClientDiscoveryIntervalSeconds { get; set; }
public int BlastAliveMessageIntervalSeconds { get; set; }
public string DefaultUserId { get; set; }
public bool EnableEnhancedMovies { get; set; }
public DlnaOptions()
{
@ -18,6 +19,7 @@ namespace MediaBrowser.Model.Configuration
BlastAliveMessages = true;
ClientDiscoveryIntervalSeconds = 60;
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.",
"LabelEnterConnectUserName": "User name or email:",
"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",
"FolderTypeMixed": "Mixed content",
"FolderTypeMovies": "Movies",