From 15f0832a042ef77bee549958fcf130986af9f430 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 21 May 2016 02:12:00 -0400 Subject: deprecate refreshinfo db --- MediaBrowser.Model/Configuration/ServerConfiguration.cs | 9 --------- 1 file changed, 9 deletions(-) (limited to 'MediaBrowser.Model/Configuration/ServerConfiguration.cs') diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index 1cb19afdf..bbf21a9d7 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -86,12 +86,6 @@ namespace MediaBrowser.Model.Configuration /// true if [save local meta]; otherwise, false. public bool SaveLocalMeta { get; set; } - /// - /// Gets or sets a value indicating whether [enable localized guids]. - /// - /// true if [enable localized guids]; otherwise, false. - public bool EnableLocalizedGuids { get; set; } - /// /// Gets or sets the preferred metadata language. /// @@ -196,8 +190,6 @@ namespace MediaBrowser.Model.Configuration public int SharingExpirationDays { get; set; } - public bool EnableDateLastRefresh { get; set; } - public string[] Migrations { get; set; } public int MigrationVersion { get; set; } @@ -215,7 +207,6 @@ namespace MediaBrowser.Model.Configuration { Migrations = new string[] { }; - EnableLocalizedGuids = true; EnableCustomPathSubFolders = true; ImageSavingConvention = ImageSavingConvention.Compatible; -- cgit v1.2.3 From 556024ff40fa6e2854c300ad188aabe20b9c2a8f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 22 May 2016 14:53:57 -0400 Subject: set default schema version --- MediaBrowser.Model/Configuration/ServerConfiguration.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'MediaBrowser.Model/Configuration/ServerConfiguration.cs') diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index bbf21a9d7..e9084d4d1 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -223,7 +223,7 @@ namespace MediaBrowser.Model.Configuration DenyIFrameEmbedding = true; EnableUPnP = true; - + SchemaVersion = 79; SharingExpirationDays = 30; MinResumePct = 5; MaxResumePct = 90; -- cgit v1.2.3 From bc2f18bce37794b6968e19f13ca69eb109ec7c03 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 23 May 2016 00:11:37 -0400 Subject: save series name separately --- MediaBrowser.Model/Configuration/ServerConfiguration.cs | 1 - .../Persistence/SqliteItemRepository.cs | 16 ++++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'MediaBrowser.Model/Configuration/ServerConfiguration.cs') diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index e9084d4d1..66bea95bb 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -223,7 +223,6 @@ namespace MediaBrowser.Model.Configuration DenyIFrameEmbedding = true; EnableUPnP = true; - SchemaVersion = 79; SharingExpirationDays = 30; MinResumePct = 5; MaxResumePct = 90; diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs index 19f9653a8..7e2cc2da3 100644 --- a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs +++ b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs @@ -87,7 +87,7 @@ namespace MediaBrowser.Server.Implementations.Persistence private IDbCommand _updateInheritedRatingCommand; private IDbCommand _updateInheritedTagsCommand; - public const int LatestSchemaVersion = 79; + public const int LatestSchemaVersion = 80; /// /// Initializes a new instance of the class. @@ -239,6 +239,7 @@ namespace MediaBrowser.Server.Implementations.Persistence _connection.AddColumn(Logger, "TypedBaseItems", "DateLastMediaAdded", "DATETIME"); _connection.AddColumn(Logger, "TypedBaseItems", "Album", "Text"); _connection.AddColumn(Logger, "TypedBaseItems", "IsVirtualItem", "BIT"); + _connection.AddColumn(Logger, "TypedBaseItems", "SeriesName", "Text"); _connection.AddColumn(Logger, "UserDataKeys", "Priority", "INT"); @@ -433,7 +434,8 @@ namespace MediaBrowser.Server.Implementations.Persistence "PrimaryVersionId", "DateLastMediaAdded", "Album", - "IsVirtualItem" + "IsVirtualItem", + "SeriesName" }; _saveItemCommand = _connection.CreateCommand(); _saveItemCommand.CommandText = "replace into TypedBaseItems (" + string.Join(",", saveColumns.ToArray()) + ") values ("; @@ -835,6 +837,16 @@ namespace MediaBrowser.Server.Implementations.Persistence _saveItemCommand.GetParameter(index++).Value = null; } + var hasSeries = item as IHasSeries; + if (hasSeries != null) + { + _saveItemCommand.GetParameter(index++).Value = hasSeries.SeriesName; + } + else + { + _saveItemCommand.GetParameter(index++).Value = null; + } + _saveItemCommand.Transaction = transaction; _saveItemCommand.ExecuteNonQuery(); -- cgit v1.2.3 From 4fcdeaffee6d3a8775850c2babd719dec5f621ff Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 23 May 2016 13:52:16 -0400 Subject: restore localized guids config switch --- MediaBrowser.Api/StartupWizardService.cs | 1 + MediaBrowser.Model/Configuration/ServerConfiguration.cs | 2 ++ MediaBrowser.Server.Implementations/Library/LibraryManager.cs | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'MediaBrowser.Model/Configuration/ServerConfiguration.cs') diff --git a/MediaBrowser.Api/StartupWizardService.cs b/MediaBrowser.Api/StartupWizardService.cs index cdc00a9aa..8bb840697 100644 --- a/MediaBrowser.Api/StartupWizardService.cs +++ b/MediaBrowser.Api/StartupWizardService.cs @@ -109,6 +109,7 @@ namespace MediaBrowser.Api private void SetWizardFinishValues(ServerConfiguration config) { + config.EnableLocalizedGuids = true; config.EnableCustomPathSubFolders = true; config.EnableStandaloneMusicKeys = true; config.EnableCaseSensitiveItemIds = true; diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index 66bea95bb..1971b812e 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -199,6 +199,7 @@ namespace MediaBrowser.Model.Configuration public bool EnableAnonymousUsageReporting { get; set; } public bool EnableStandaloneMusicKeys { get; set; } + public bool EnableLocalizedGuids { get; set; } /// /// Initializes a new instance of the class. @@ -208,6 +209,7 @@ namespace MediaBrowser.Model.Configuration Migrations = new string[] { }; EnableCustomPathSubFolders = true; + EnableLocalizedGuids = true; ImageSavingConvention = ImageSavingConvention.Compatible; PublicPort = 8096; diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index 961819f0d..56d3bd4de 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -502,7 +502,7 @@ namespace MediaBrowser.Server.Implementations.Library throw new ArgumentNullException("type"); } - if (key.StartsWith(ConfigurationManager.ApplicationPaths.ProgramDataPath)) + if (ConfigurationManager.Configuration.EnableLocalizedGuids && key.StartsWith(ConfigurationManager.ApplicationPaths.ProgramDataPath)) { // Try to normalize paths located underneath program-data in an attempt to make them more portable key = key.Substring(ConfigurationManager.ApplicationPaths.ProgramDataPath.Length) -- cgit v1.2.3 From b6b6b85bf4d8bb6f58ea860a622dbc8902721b68 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 29 May 2016 17:04:49 -0400 Subject: remove x-frame-options --- MediaBrowser.Model/Configuration/ServerConfiguration.cs | 3 --- .../HttpServer/HttpListenerHost.cs | 2 +- MediaBrowser.Server.Implementations/HttpServer/ResponseFilter.cs | 9 +-------- 3 files changed, 2 insertions(+), 12 deletions(-) (limited to 'MediaBrowser.Model/Configuration/ServerConfiguration.cs') diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index 1971b812e..df0e42869 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -184,8 +184,6 @@ namespace MediaBrowser.Model.Configuration public bool EnableVideoArchiveFiles { get; set; } public int RemoteClientBitrateLimit { get; set; } - public bool DenyIFrameEmbedding { get; set; } - public AutoOnOff EnableLibraryMonitor { get; set; } public int SharingExpirationDays { get; set; } @@ -222,7 +220,6 @@ namespace MediaBrowser.Model.Configuration EnableAnonymousUsageReporting = true; EnableAutomaticRestart = true; - DenyIFrameEmbedding = true; EnableUPnP = true; SharingExpirationDays = 30; diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs index c5cb810e5..f091f0f1f 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -106,7 +106,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer } }); - HostContext.GlobalResponseFilters.Add(new ResponseFilter(_logger, () => _config.Configuration.DenyIFrameEmbedding).FilterResponse); + HostContext.GlobalResponseFilters.Add(new ResponseFilter(_logger).FilterResponse); } public override void OnAfterInit() diff --git a/MediaBrowser.Server.Implementations/HttpServer/ResponseFilter.cs b/MediaBrowser.Server.Implementations/HttpServer/ResponseFilter.cs index f993d4437..ee05702f4 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/ResponseFilter.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/ResponseFilter.cs @@ -12,12 +12,10 @@ namespace MediaBrowser.Server.Implementations.HttpServer { private static readonly CultureInfo UsCulture = new CultureInfo("en-US"); private readonly ILogger _logger; - private readonly Func _denyIframeEmbedding; - public ResponseFilter(ILogger logger, Func denyIframeEmbedding) + public ResponseFilter(ILogger logger) { _logger = logger; - _denyIframeEmbedding = denyIframeEmbedding; } /// @@ -31,11 +29,6 @@ namespace MediaBrowser.Server.Implementations.HttpServer // Try to prevent compatibility view res.AddHeader("X-UA-Compatible", "IE=Edge"); - if (_denyIframeEmbedding()) - { - res.AddHeader("X-Frame-Options", "SAMEORIGIN"); - } - var exception = dto as Exception; if (exception != null) -- cgit v1.2.3 From 020b1d9a6425dca8540156ace187fe72dd75f8f1 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 4 Jun 2016 01:51:33 -0400 Subject: add library display settings --- MediaBrowser.Api/StartupWizardService.cs | 1 + .../Configuration/ServerConfiguration.cs | 1 + .../Library/UserViewManager.cs | 6 ++++ .../ApplicationHost.cs | 5 +-- .../MediaBrowser.Server.Startup.Common.csproj | 1 + .../Migrations/FolderViewSettingMigration.cs | 37 ++++++++++++++++++++++ .../MediaBrowser.WebDashboard.csproj | 6 ++++ 7 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 MediaBrowser.Server.Startup.Common/Migrations/FolderViewSettingMigration.cs (limited to 'MediaBrowser.Model/Configuration/ServerConfiguration.cs') diff --git a/MediaBrowser.Api/StartupWizardService.cs b/MediaBrowser.Api/StartupWizardService.cs index 989dea6c6..dbb6478a1 100644 --- a/MediaBrowser.Api/StartupWizardService.cs +++ b/MediaBrowser.Api/StartupWizardService.cs @@ -113,6 +113,7 @@ namespace MediaBrowser.Api config.EnableCustomPathSubFolders = true; config.EnableStandaloneMusicKeys = true; config.EnableCaseSensitiveItemIds = true; + config.EnableFolderView = true; config.SchemaVersion = 89; } diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index df0e42869..e89aafaca 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -198,6 +198,7 @@ namespace MediaBrowser.Model.Configuration public bool EnableAnonymousUsageReporting { get; set; } public bool EnableStandaloneMusicKeys { get; set; } public bool EnableLocalizedGuids { get; set; } + public bool EnableFolderView { get; set; } /// /// Initializes a new instance of the class. diff --git a/MediaBrowser.Server.Implementations/Library/UserViewManager.cs b/MediaBrowser.Server.Implementations/Library/UserViewManager.cs index 6c88f506b..e6a571f07 100644 --- a/MediaBrowser.Server.Implementations/Library/UserViewManager.cs +++ b/MediaBrowser.Server.Implementations/Library/UserViewManager.cs @@ -105,6 +105,12 @@ namespace MediaBrowser.Server.Implementations.Library } } + if (_config.Configuration.EnableFolderView) + { + var name = _localizationManager.GetLocalizedString("ViewType" + CollectionType.Folders); + list.Add(await _libraryManager.GetNamedView(name, CollectionType.Folders, string.Empty, cancellationToken).ConfigureAwait(false)); + } + if (query.IncludeExternalContent) { var channelResult = await _channelManager.GetChannelsInternal(new ChannelQuery diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index 59a8a4f78..75e3bb7f5 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -380,7 +380,8 @@ namespace MediaBrowser.Server.Startup.Common { new OmdbEpisodeProviderMigration(ServerConfigurationManager), new MovieDbEpisodeProviderMigration(ServerConfigurationManager), - new DbMigration(ServerConfigurationManager, TaskManager) + new DbMigration(ServerConfigurationManager, TaskManager), + new FolderViewSettingMigration(ServerConfigurationManager, UserManager) }; foreach (var task in migrations) @@ -568,7 +569,7 @@ namespace MediaBrowser.Server.Startup.Common SubtitleEncoder = new SubtitleEncoder(LibraryManager, LogManager.GetLogger("SubtitleEncoder"), ApplicationPaths, FileSystemManager, MediaEncoder, JsonSerializer, HttpClient, MediaSourceManager); RegisterSingleInstance(SubtitleEncoder); - + await displayPreferencesRepo.Initialize(NativeApp.GetDbConnector()).ConfigureAwait(false); await ConfigureUserDataRepositories().ConfigureAwait(false); await itemRepo.Initialize(NativeApp.GetDbConnector()).ConfigureAwait(false); diff --git a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj index d0769f488..a6d09d343 100644 --- a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj +++ b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj @@ -71,6 +71,7 @@ + diff --git a/MediaBrowser.Server.Startup.Common/Migrations/FolderViewSettingMigration.cs b/MediaBrowser.Server.Startup.Common/Migrations/FolderViewSettingMigration.cs new file mode 100644 index 000000000..4049d1754 --- /dev/null +++ b/MediaBrowser.Server.Startup.Common/Migrations/FolderViewSettingMigration.cs @@ -0,0 +1,37 @@ +using System.Linq; +using MediaBrowser.Controller.Configuration; +using MediaBrowser.Controller.Library; + +namespace MediaBrowser.Server.Startup.Common.Migrations +{ + public class FolderViewSettingMigration : IVersionMigration + { + private readonly IServerConfigurationManager _config; + private readonly IUserManager _userManager; + + public FolderViewSettingMigration(IServerConfigurationManager config, IUserManager userManager) + { + _config = config; + _userManager = userManager; + } + + public void Run() + { + var migrationKey = this.GetType().Name; + var migrationKeyList = _config.Configuration.Migrations.ToList(); + + if (!migrationKeyList.Contains(migrationKey)) + { + if (_config.Configuration.IsStartupWizardCompleted) + { + _config.Configuration.EnableFolderView = _userManager.Users.Any(i => i.Configuration.DisplayFoldersView); + } + + migrationKeyList.Add(migrationKey); + _config.Configuration.Migrations = migrationKeyList.ToArray(); + _config.SaveConfiguration(); + } + + } + } +} diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index 1d860ed29..36693ad8e 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -272,6 +272,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest @@ -308,6 +311,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest -- cgit v1.2.3 From 2e040f9c0c3d8cca834687a7c729f14097f7a83b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 5 Jun 2016 15:44:55 -0400 Subject: update collection grouping setting --- MediaBrowser.Controller/Entities/Folder.cs | 4 +- MediaBrowser.Controller/Entities/UserView.cs | 2 +- .../Entities/UserViewBuilder.cs | 31 ++++++++------- .../Configuration/ServerConfiguration.cs | 1 + .../Connect/Responses.cs | 1 - .../MediaBrowser.Server.Startup.Common.csproj | 1 + .../Migrations/CollectionGroupingMigration.cs | 44 ++++++++++++++++++++++ 7 files changed, 67 insertions(+), 17 deletions(-) create mode 100644 MediaBrowser.Server.Startup.Common/Migrations/CollectionGroupingMigration.cs (limited to 'MediaBrowser.Model/Configuration/ServerConfiguration.cs') diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index 2e4cf3745..6868418d3 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -875,7 +875,7 @@ namespace MediaBrowser.Controller.Entities return true; } - if (UserViewBuilder.CollapseBoxSetItems(query, this, query.User)) + if (UserViewBuilder.CollapseBoxSetItems(query, this, query.User, ConfigurationManager)) { Logger.Debug("Query requires post-filtering due to CollapseBoxSetItems"); return true; @@ -983,7 +983,7 @@ namespace MediaBrowser.Controller.Entities protected QueryResult PostFilterAndSort(IEnumerable items, InternalItemsQuery query) { - return UserViewBuilder.PostFilterAndSort(items, this, null, query, LibraryManager); + return UserViewBuilder.PostFilterAndSort(items, this, null, query, LibraryManager, ConfigurationManager); } public virtual IEnumerable GetChildren(User user, bool includeLinkedChildren) diff --git a/MediaBrowser.Controller/Entities/UserView.cs b/MediaBrowser.Controller/Entities/UserView.cs index e40d9ca38..6ec719e87 100644 --- a/MediaBrowser.Controller/Entities/UserView.cs +++ b/MediaBrowser.Controller/Entities/UserView.cs @@ -58,7 +58,7 @@ namespace MediaBrowser.Controller.Entities parent = LibraryManager.GetItemById(ParentId) as Folder ?? parent; } - return new UserViewBuilder(UserViewManager, LiveTvManager, ChannelManager, LibraryManager, Logger, UserDataManager, TVSeriesManager, CollectionManager, PlaylistManager) + return new UserViewBuilder(UserViewManager, LiveTvManager, ChannelManager, LibraryManager, Logger, UserDataManager, TVSeriesManager, ConfigurationManager, PlaylistManager) .GetUserItems(parent, this, ViewType, query); } diff --git a/MediaBrowser.Controller/Entities/UserViewBuilder.cs b/MediaBrowser.Controller/Entities/UserViewBuilder.cs index a7b23112e..3c1c086ef 100644 --- a/MediaBrowser.Controller/Entities/UserViewBuilder.cs +++ b/MediaBrowser.Controller/Entities/UserViewBuilder.cs @@ -18,6 +18,8 @@ using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Controller.Configuration; +using MediaBrowser.Model.Configuration; namespace MediaBrowser.Controller.Entities { @@ -30,10 +32,10 @@ namespace MediaBrowser.Controller.Entities private readonly ILogger _logger; private readonly IUserDataManager _userDataManager; private readonly ITVSeriesManager _tvSeriesManager; - private readonly ICollectionManager _collectionManager; + private readonly IServerConfigurationManager _config; private readonly IPlaylistManager _playlistManager; - public UserViewBuilder(IUserViewManager userViewManager, ILiveTvManager liveTvManager, IChannelManager channelManager, ILibraryManager libraryManager, ILogger logger, IUserDataManager userDataManager, ITVSeriesManager tvSeriesManager, ICollectionManager collectionManager, IPlaylistManager playlistManager) + public UserViewBuilder(IUserViewManager userViewManager, ILiveTvManager liveTvManager, IChannelManager channelManager, ILibraryManager libraryManager, ILogger logger, IUserDataManager userDataManager, ITVSeriesManager tvSeriesManager, IServerConfigurationManager config, IPlaylistManager playlistManager) { _userViewManager = userViewManager; _liveTvManager = liveTvManager; @@ -42,7 +44,7 @@ namespace MediaBrowser.Controller.Entities _logger = logger; _userDataManager = userDataManager; _tvSeriesManager = tvSeriesManager; - _collectionManager = collectionManager; + _config = config; _playlistManager = playlistManager; } @@ -159,7 +161,7 @@ namespace MediaBrowser.Controller.Entities return await GetTvGenres(queryParent, user, query).ConfigureAwait(false); case SpecialFolder.TvGenre: - return await GetTvGenreItems(queryParent, displayParent, user, query).ConfigureAwait(false); + return GetTvGenreItems(queryParent, displayParent, user, query); case SpecialFolder.TvResume: return GetTvResume(queryParent, user, query); @@ -740,7 +742,7 @@ namespace MediaBrowser.Controller.Entities return GetResult(genres, parent, query); } - private async Task> GetTvGenreItems(Folder queryParent, Folder displayParent, User user, InternalItemsQuery query) + private QueryResult GetTvGenreItems(Folder queryParent, Folder displayParent, User user, InternalItemsQuery query) { query.Recursive = true; query.ParentId = queryParent.Id; @@ -769,7 +771,7 @@ namespace MediaBrowser.Controller.Entities { items = items.Where(i => Filter(i, query.User, query, _userDataManager, _libraryManager)); - return PostFilterAndSort(items, queryParent, null, query, _libraryManager); + return PostFilterAndSort(items, queryParent, null, query, _libraryManager, _config); } public static bool FilterItem(BaseItem item, InternalItemsQuery query) @@ -782,14 +784,15 @@ namespace MediaBrowser.Controller.Entities int? totalRecordLimit, InternalItemsQuery query) { - return PostFilterAndSort(items, queryParent, totalRecordLimit, query, _libraryManager); + return PostFilterAndSort(items, queryParent, totalRecordLimit, query, _libraryManager, _config); } public static QueryResult PostFilterAndSort(IEnumerable items, BaseItem queryParent, int? totalRecordLimit, InternalItemsQuery query, - ILibraryManager libraryManager) + ILibraryManager libraryManager, + IServerConfigurationManager configurationManager) { var user = query.User; @@ -798,7 +801,7 @@ namespace MediaBrowser.Controller.Entities query.IsVirtualUnaired, query.IsUnaired); - items = CollapseBoxSetItemsIfNeeded(items, query, queryParent, user); + items = CollapseBoxSetItemsIfNeeded(items, query, queryParent, user, configurationManager); // This must be the last filter if (!string.IsNullOrEmpty(query.AdjacentTo)) @@ -812,14 +815,15 @@ namespace MediaBrowser.Controller.Entities public static IEnumerable CollapseBoxSetItemsIfNeeded(IEnumerable items, InternalItemsQuery query, BaseItem queryParent, - User user) + User user, + IServerConfigurationManager configurationManager) { if (items == null) { throw new ArgumentNullException("items"); } - if (CollapseBoxSetItems(query, queryParent, user)) + if (CollapseBoxSetItems(query, queryParent, user, configurationManager)) { items = BaseItem.CollectionManager.CollapseItemsWithinBoxSets(items, user); } @@ -852,7 +856,8 @@ namespace MediaBrowser.Controller.Entities public static bool CollapseBoxSetItems(InternalItemsQuery query, BaseItem queryParent, - User user) + User user, + IServerConfigurationManager configurationManager) { // Could end up stuck in a loop like this if (queryParent is BoxSet) @@ -864,7 +869,7 @@ namespace MediaBrowser.Controller.Entities if (!param.HasValue) { - if (user != null && !user.Configuration.GroupMoviesIntoBoxSets) + if (user != null && !configurationManager.Configuration.EnableGroupingIntoCollections) { return false; } diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index e89aafaca..993799f65 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -199,6 +199,7 @@ namespace MediaBrowser.Model.Configuration public bool EnableStandaloneMusicKeys { get; set; } public bool EnableLocalizedGuids { get; set; } public bool EnableFolderView { get; set; } + public bool EnableGroupingIntoCollections { get; set; } /// /// Initializes a new instance of the class. diff --git a/MediaBrowser.Server.Implementations/Connect/Responses.cs b/MediaBrowser.Server.Implementations/Connect/Responses.cs index e7c3f8154..f86527829 100644 --- a/MediaBrowser.Server.Implementations/Connect/Responses.cs +++ b/MediaBrowser.Server.Implementations/Connect/Responses.cs @@ -60,7 +60,6 @@ namespace MediaBrowser.Server.Implementations.Connect { return new ConnectUserPreferences { - GroupMoviesIntoBoxSets = config.GroupMoviesIntoBoxSets, PlayDefaultAudioTrack = config.PlayDefaultAudioTrack, SubtitleMode = config.SubtitleMode, PreferredAudioLanguages = string.IsNullOrWhiteSpace(config.AudioLanguagePreference) ? new string[] { } : new[] { config.AudioLanguagePreference }, diff --git a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj index a6d09d343..e9fd14353 100644 --- a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj +++ b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj @@ -71,6 +71,7 @@ + diff --git a/MediaBrowser.Server.Startup.Common/Migrations/CollectionGroupingMigration.cs b/MediaBrowser.Server.Startup.Common/Migrations/CollectionGroupingMigration.cs new file mode 100644 index 000000000..b497eeb42 --- /dev/null +++ b/MediaBrowser.Server.Startup.Common/Migrations/CollectionGroupingMigration.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using MediaBrowser.Controller.Configuration; +using MediaBrowser.Controller.Library; + +namespace MediaBrowser.Server.Startup.Common.Migrations +{ + public class CollectionGroupingMigration : IVersionMigration + { + private readonly IServerConfigurationManager _config; + private readonly IUserManager _userManager; + + public CollectionGroupingMigration(IServerConfigurationManager config, IUserManager userManager) + { + _config = config; + _userManager = userManager; + } + + public void Run() + { + var migrationKey = this.GetType().Name; + var migrationKeyList = _config.Configuration.Migrations.ToList(); + + if (!migrationKeyList.Contains(migrationKey)) + { + if (_config.Configuration.IsStartupWizardCompleted) + { + if (_userManager.Users.Any(i => i.Configuration.GroupMoviesIntoBoxSets)) + { + _config.Configuration.EnableGroupingIntoCollections = true; + } + } + + migrationKeyList.Add(migrationKey); + _config.Configuration.Migrations = migrationKeyList.ToArray(); + _config.SaveConfiguration(); + } + + } + } +} -- cgit v1.2.3 From 19ee883ca26739a64d65ab54dfaf3b603ae36bfe Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 6 Jun 2016 17:13:00 -0400 Subject: record time base --- MediaBrowser.Api/ItemUpdateService.cs | 5 -- MediaBrowser.Api/Subtitles/SubtitleService.cs | 2 +- MediaBrowser.Controller/Entities/TV/Series.cs | 5 +- .../Probing/ProbeResultNormalizer.cs | 4 +- .../Configuration/ServerConfiguration.cs | 2 + MediaBrowser.Model/Entities/MediaStream.cs | 3 + MediaBrowser.Providers/TV/SeriesMetadataService.cs | 5 -- .../Dto/DtoService.cs | 5 -- .../Persistence/MediaStreamColumns.cs | 64 ++++++++++++++++++++++ .../Persistence/SqliteItemRepository.cs | 19 ++++++- 10 files changed, 91 insertions(+), 23 deletions(-) (limited to 'MediaBrowser.Model/Configuration/ServerConfiguration.cs') diff --git a/MediaBrowser.Api/ItemUpdateService.cs b/MediaBrowser.Api/ItemUpdateService.cs index 6cb23a140..79aaccfe8 100644 --- a/MediaBrowser.Api/ItemUpdateService.cs +++ b/MediaBrowser.Api/ItemUpdateService.cs @@ -419,11 +419,6 @@ namespace MediaBrowser.Api series.Status = request.SeriesStatus; series.AirDays = request.AirDays; series.AirTime = request.AirTime; - - if (request.DisplaySpecialsWithSeasons.HasValue) - { - series.DisplaySpecialsWithSeasons = request.DisplaySpecialsWithSeasons.Value; - } } } diff --git a/MediaBrowser.Api/Subtitles/SubtitleService.cs b/MediaBrowser.Api/Subtitles/SubtitleService.cs index 0500f3305..160fda065 100644 --- a/MediaBrowser.Api/Subtitles/SubtitleService.cs +++ b/MediaBrowser.Api/Subtitles/SubtitleService.cs @@ -221,7 +221,7 @@ namespace MediaBrowser.Api.Subtitles if (string.Equals(request.Format, "vtt", StringComparison.OrdinalIgnoreCase) && request.AddVttTimeMap) { - //text = text.Replace("WEBVTT", "WEBVTT\nX-TIMESTAMP-MAP=MPEGTS:900000,LOCAL:00:00:00.000"); + text = text.Replace("WEBVTT", "WEBVTT\nX-TIMESTAMP-MAP=MPEGTS:900000,LOCAL:00:00:00.000"); } return ResultFactory.GetResult(text, MimeTypes.GetMimeType("file." + request.Format)); diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs index a24148360..459b6dfb6 100644 --- a/MediaBrowser.Controller/Entities/TV/Series.cs +++ b/MediaBrowser.Controller/Entities/TV/Series.cs @@ -31,7 +31,6 @@ namespace MediaBrowser.Controller.Entities.TV RemoteTrailers = new List(); LocalTrailerIds = new List(); RemoteTrailerIds = new List(); - DisplaySpecialsWithSeasons = true; } [IgnoreDataMember] @@ -58,8 +57,6 @@ namespace MediaBrowser.Controller.Entities.TV } } - public bool DisplaySpecialsWithSeasons { get; set; } - public List LocalTrailerIds { get; set; } public List RemoteTrailerIds { get; set; } @@ -357,7 +354,7 @@ namespace MediaBrowser.Controller.Entities.TV return GetEpisodes(user, parentSeason, includeMissingEpisodes, includeVirtualUnairedEpisodes); } - var episodes = FilterEpisodesBySeason(allSeriesEpisodes, parentSeason, DisplaySpecialsWithSeasons); + var episodes = FilterEpisodesBySeason(allSeriesEpisodes, parentSeason, ConfigurationManager.Configuration.DisplaySpecialsWithinSeasons); if (!includeMissingEpisodes) { diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index 44c69d4c1..44a0f264d 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -408,7 +408,9 @@ namespace MediaBrowser.MediaEncoding.Probing Level = streamInfo.level, Index = streamInfo.index, PixelFormat = streamInfo.pix_fmt, - NalLengthSize = streamInfo.nal_length_size + NalLengthSize = streamInfo.nal_length_size, + TimeBase = streamInfo.time_base, + CodecTimeBase = streamInfo.codec_time_base }; if (string.Equals(streamInfo.is_avc, "true", StringComparison.OrdinalIgnoreCase) || diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index 993799f65..0ce69970f 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -200,6 +200,7 @@ namespace MediaBrowser.Model.Configuration public bool EnableLocalizedGuids { get; set; } public bool EnableFolderView { get; set; } public bool EnableGroupingIntoCollections { get; set; } + public bool DisplaySpecialsWithinSeasons { get; set; } /// /// Initializes a new instance of the class. @@ -210,6 +211,7 @@ namespace MediaBrowser.Model.Configuration EnableCustomPathSubFolders = true; EnableLocalizedGuids = true; + DisplaySpecialsWithinSeasons = true; ImageSavingConvention = ImageSavingConvention.Compatible; PublicPort = 8096; diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs index 6a3c08425..868f6b64f 100644 --- a/MediaBrowser.Model/Entities/MediaStream.cs +++ b/MediaBrowser.Model/Entities/MediaStream.cs @@ -36,6 +36,9 @@ namespace MediaBrowser.Model.Entities /// The comment. public string Comment { get; set; } + public string TimeBase { get; set; } + public string CodecTimeBase { get; set; } + public string Title { get; set; } public string DisplayTitle diff --git a/MediaBrowser.Providers/TV/SeriesMetadataService.cs b/MediaBrowser.Providers/TV/SeriesMetadataService.cs index 041969a59..f440baf5b 100644 --- a/MediaBrowser.Providers/TV/SeriesMetadataService.cs +++ b/MediaBrowser.Providers/TV/SeriesMetadataService.cs @@ -76,11 +76,6 @@ namespace MediaBrowser.Providers.TV { targetItem.AirDays = sourceItem.AirDays; } - - if (mergeMetadataSettings) - { - targetItem.DisplaySpecialsWithSeasons = sourceItem.DisplaySpecialsWithSeasons; - } } } } diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs index 5588405e3..2c31a8aae 100644 --- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs +++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs @@ -1466,11 +1466,6 @@ namespace MediaBrowser.Server.Implementations.Dto dto.AirTime = series.AirTime; dto.SeriesStatus = series.Status; - if (fields.Contains(ItemFields.Settings)) - { - dto.DisplaySpecialsWithSeasons = series.DisplaySpecialsWithSeasons; - } - dto.AnimeSeriesIndex = series.AnimeSeriesIndex; } diff --git a/MediaBrowser.Server.Implementations/Persistence/MediaStreamColumns.cs b/MediaBrowser.Server.Implementations/Persistence/MediaStreamColumns.cs index 948e99cb8..1d9be2e0d 100644 --- a/MediaBrowser.Server.Implementations/Persistence/MediaStreamColumns.cs +++ b/MediaBrowser.Server.Implementations/Persistence/MediaStreamColumns.cs @@ -28,6 +28,8 @@ namespace MediaBrowser.Server.Implementations.Persistence AddNalColumn(); AddIsAvcColumn(); AddTitleColumn(); + AddTimeBaseColumn(); + AddCodecTimeBaseColumn(); } private void AddIsAvcColumn() @@ -61,6 +63,68 @@ namespace MediaBrowser.Server.Implementations.Persistence _connection.RunQueries(new[] { builder.ToString() }, _logger); } + private void AddTimeBaseColumn() + { + using (var cmd = _connection.CreateCommand()) + { + cmd.CommandText = "PRAGMA table_info(mediastreams)"; + + using (var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess | CommandBehavior.SingleResult)) + { + while (reader.Read()) + { + if (!reader.IsDBNull(1)) + { + var name = reader.GetString(1); + + if (string.Equals(name, "TimeBase", StringComparison.OrdinalIgnoreCase)) + { + return; + } + } + } + } + } + + var builder = new StringBuilder(); + + builder.AppendLine("alter table mediastreams"); + builder.AppendLine("add column TimeBase TEXT"); + + _connection.RunQueries(new[] { builder.ToString() }, _logger); + } + + private void AddCodecTimeBaseColumn() + { + using (var cmd = _connection.CreateCommand()) + { + cmd.CommandText = "PRAGMA table_info(mediastreams)"; + + using (var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess | CommandBehavior.SingleResult)) + { + while (reader.Read()) + { + if (!reader.IsDBNull(1)) + { + var name = reader.GetString(1); + + if (string.Equals(name, "CodecTimeBase", StringComparison.OrdinalIgnoreCase)) + { + return; + } + } + } + } + } + + var builder = new StringBuilder(); + + builder.AppendLine("alter table mediastreams"); + builder.AppendLine("add column CodecTimeBase TEXT"); + + _connection.RunQueries(new[] { builder.ToString() }, _logger); + } + private void AddTitleColumn() { using (var cmd = _connection.CreateCommand()) diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs index 460a67ca7..a4cb0c48b 100644 --- a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs +++ b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs @@ -130,7 +130,7 @@ namespace MediaBrowser.Server.Implementations.Persistence _connection = await dbConnector.Connect(dbFile).ConfigureAwait(false); var createMediaStreamsTableCommand - = "create table if not exists mediastreams (ItemId GUID, StreamIndex INT, StreamType TEXT, Codec TEXT, Language TEXT, ChannelLayout TEXT, Profile TEXT, AspectRatio TEXT, Path TEXT, IsInterlaced BIT, BitRate INT NULL, Channels INT NULL, SampleRate INT NULL, IsDefault BIT, IsForced BIT, IsExternal BIT, Height INT NULL, Width INT NULL, AverageFrameRate FLOAT NULL, RealFrameRate FLOAT NULL, Level FLOAT NULL, PixelFormat TEXT, BitDepth INT NULL, IsAnamorphic BIT NULL, RefFrames INT NULL, CodecTag TEXT NULL, Comment TEXT NULL, NalLengthSize TEXT NULL, IsAvc BIT NULL, Title TEXT NULL, PRIMARY KEY (ItemId, StreamIndex))"; + = "create table if not exists mediastreams (ItemId GUID, StreamIndex INT, StreamType TEXT, Codec TEXT, Language TEXT, ChannelLayout TEXT, Profile TEXT, AspectRatio TEXT, Path TEXT, IsInterlaced BIT, BitRate INT NULL, Channels INT NULL, SampleRate INT NULL, IsDefault BIT, IsForced BIT, IsExternal BIT, Height INT NULL, Width INT NULL, AverageFrameRate FLOAT NULL, RealFrameRate FLOAT NULL, Level FLOAT NULL, PixelFormat TEXT, BitDepth INT NULL, IsAnamorphic BIT NULL, RefFrames INT NULL, CodecTag TEXT NULL, Comment TEXT NULL, NalLengthSize TEXT NULL, IsAvc BIT NULL, Title TEXT NULL, TimeBase TEXT NULL, CodecTimeBase TEXT NULL, PRIMARY KEY (ItemId, StreamIndex))"; string[] queries = { @@ -368,7 +368,9 @@ namespace MediaBrowser.Server.Implementations.Persistence "Comment", "NalLengthSize", "IsAvc", - "Title" + "Title", + "TimeBase", + "CodecTimeBase" }; /// @@ -3805,6 +3807,9 @@ namespace MediaBrowser.Server.Implementations.Persistence _saveStreamCommand.GetParameter(index++).Value = stream.IsAVC; _saveStreamCommand.GetParameter(index++).Value = stream.Title; + _saveStreamCommand.GetParameter(index++).Value = stream.TimeBase; + _saveStreamCommand.GetParameter(index++).Value = stream.CodecTimeBase; + _saveStreamCommand.Transaction = transaction; _saveStreamCommand.ExecuteNonQuery(); } @@ -3977,6 +3982,16 @@ namespace MediaBrowser.Server.Implementations.Persistence item.Title = reader.GetString(29); } + if (!reader.IsDBNull(30)) + { + item.TimeBase = reader.GetString(30); + } + + if (!reader.IsDBNull(31)) + { + item.CodecTimeBase = reader.GetString(31); + } + return item; } -- cgit v1.2.3 From 0ad015043532f498e382a5ea4ce4b77a7976b516 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 7 Jun 2016 12:21:46 -0400 Subject: update nuget --- .../Configuration/ServerConfiguration.cs | 6 ++-- .../Music/MusicBrainzAlbumProvider.cs | 2 +- .../MediaBrowser.Server.Implementations.csproj | 2 +- .../packages.config | 2 +- .../ApplicationHost.cs | 37 ++++++++++++++++++---- 5 files changed, 37 insertions(+), 12 deletions(-) (limited to 'MediaBrowser.Model/Configuration/ServerConfiguration.cs') diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index 0ce69970f..1eb169bf9 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -67,7 +67,7 @@ namespace MediaBrowser.Model.Configuration /// /// true if [enable case sensitive item ids]; otherwise, false. public bool EnableCaseSensitiveItemIds { get; set; } - + /// /// Gets or sets the metadata path. /// @@ -155,7 +155,7 @@ namespace MediaBrowser.Model.Configuration /// /// The dashboard source path. public string DashboardSourcePath { get; set; } - + /// /// Gets or sets the image saving convention. /// @@ -201,12 +201,14 @@ namespace MediaBrowser.Model.Configuration public bool EnableFolderView { get; set; } public bool EnableGroupingIntoCollections { get; set; } public bool DisplaySpecialsWithinSeasons { get; set; } + public string[] LocalNetworkAddresses { get; set; } /// /// Initializes a new instance of the class. /// public ServerConfiguration() { + LocalNetworkAddresses = new string[] { }; Migrations = new string[] { }; EnableCustomPathSubFolders = true; diff --git a/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs b/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs index 6e57b4022..d76c89dfb 100644 --- a/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs +++ b/MediaBrowser.Providers/Music/MusicBrainzAlbumProvider.cs @@ -25,7 +25,7 @@ namespace MediaBrowser.Providers.Music private readonly IApplicationHost _appHost; private readonly ILogger _logger; - public static string MusicBrainzBaseUrl = "https://www.musicbrainz.org"; + public static string MusicBrainzBaseUrl = "http://musicbrainz.fercasas.com:5000"; public MusicBrainzAlbumProvider(IHttpClient httpClient, IApplicationHost appHost, ILogger logger) { diff --git a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj index 5dc064035..52ffe3a4b 100644 --- a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj +++ b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj @@ -46,7 +46,7 @@ ..\packages\CommonIO.1.0.0.9\lib\net45\CommonIO.dll - ..\packages\Emby.XmlTv.1.0.0.50\lib\net45\Emby.XmlTv.dll + ..\packages\Emby.XmlTv.1.0.0.51\lib\net45\Emby.XmlTv.dll True diff --git a/MediaBrowser.Server.Implementations/packages.config b/MediaBrowser.Server.Implementations/packages.config index 516bf3271..badc3f2c1 100644 --- a/MediaBrowser.Server.Implementations/packages.config +++ b/MediaBrowser.Server.Implementations/packages.config @@ -1,7 +1,7 @@  - + diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index 75e3bb7f5..23710479b 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -833,17 +833,40 @@ namespace MediaBrowser.Server.Startup.Common private IEnumerable GetUrlPrefixes() { - var prefixes = new List - { - "http://+:" + ServerConfigurationManager.Configuration.HttpServerPortNumber + "/" - }; + var hosts = ServerConfigurationManager.Configuration.LocalNetworkAddresses.ToList(); + + if (hosts.Count == 0) + { + hosts.Add("+"); + } - if (!string.IsNullOrWhiteSpace(CertificatePath)) + if (!hosts.Contains("+", StringComparer.OrdinalIgnoreCase)) { - prefixes.Add("https://+:" + ServerConfigurationManager.Configuration.HttpsPortNumber + "/"); + if (!hosts.Contains("localhost", StringComparer.OrdinalIgnoreCase)) + { + hosts.Add("localhost"); + } + + if (!hosts.Contains("127.0.0.1", StringComparer.OrdinalIgnoreCase)) + { + hosts.Add("127.0.0.1"); + } } - return prefixes; + return hosts.SelectMany(i => + { + var prefixes = new List + { + "http://"+i+":" + ServerConfigurationManager.Configuration.HttpServerPortNumber + "/" + }; + + if (!string.IsNullOrWhiteSpace(CertificatePath)) + { + prefixes.Add("https://" + i + ":" + ServerConfigurationManager.Configuration.HttpsPortNumber + "/"); + } + + return prefixes; + }); } /// -- cgit v1.2.3 From ad663f8fa8ebae245ed9441eead678152b1f4306 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 13 Jun 2016 15:02:48 -0400 Subject: update sliders --- .../Configuration/ServerConfiguration.cs | 1 + .../Collections/ManualCollectionsFolder.cs | 2 +- .../ApplicationHost.cs | 3 +- .../MediaBrowser.Server.Startup.Common.csproj | 1 + .../Migrations/CollectionsViewMigration.cs | 44 ++++++++++++++++++++++ 5 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 MediaBrowser.Server.Startup.Common/Migrations/CollectionsViewMigration.cs (limited to 'MediaBrowser.Model/Configuration/ServerConfiguration.cs') diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index 1eb169bf9..e4c17ff2b 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -201,6 +201,7 @@ namespace MediaBrowser.Model.Configuration public bool EnableFolderView { get; set; } public bool EnableGroupingIntoCollections { get; set; } public bool DisplaySpecialsWithinSeasons { get; set; } + public bool DisplayCollectionsView { get; set; } public string[] LocalNetworkAddresses { get; set; } /// diff --git a/MediaBrowser.Server.Implementations/Collections/ManualCollectionsFolder.cs b/MediaBrowser.Server.Implementations/Collections/ManualCollectionsFolder.cs index 561d46229..3e33066ae 100644 --- a/MediaBrowser.Server.Implementations/Collections/ManualCollectionsFolder.cs +++ b/MediaBrowser.Server.Implementations/Collections/ManualCollectionsFolder.cs @@ -20,7 +20,7 @@ namespace MediaBrowser.Server.Implementations.Collections public bool IsHiddenFromUser(User user) { - return !user.Configuration.DisplayCollectionsView; + return !ConfigurationManager.Configuration.DisplayCollectionsView; } public override string CollectionType diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index e7f5c071c..196048f39 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -382,7 +382,8 @@ namespace MediaBrowser.Server.Startup.Common new MovieDbEpisodeProviderMigration(ServerConfigurationManager), new DbMigration(ServerConfigurationManager, TaskManager), new FolderViewSettingMigration(ServerConfigurationManager, UserManager), - new CollectionGroupingMigration(ServerConfigurationManager, UserManager) + new CollectionGroupingMigration(ServerConfigurationManager, UserManager), + new CollectionsViewMigration(ServerConfigurationManager, UserManager) }; foreach (var task in migrations) diff --git a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj index e9fd14353..5b88a6bd9 100644 --- a/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj +++ b/MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj @@ -72,6 +72,7 @@ + diff --git a/MediaBrowser.Server.Startup.Common/Migrations/CollectionsViewMigration.cs b/MediaBrowser.Server.Startup.Common/Migrations/CollectionsViewMigration.cs new file mode 100644 index 000000000..c6186ce08 --- /dev/null +++ b/MediaBrowser.Server.Startup.Common/Migrations/CollectionsViewMigration.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using MediaBrowser.Controller.Configuration; +using MediaBrowser.Controller.Library; + +namespace MediaBrowser.Server.Startup.Common.Migrations +{ + public class CollectionsViewMigration : IVersionMigration + { + private readonly IServerConfigurationManager _config; + private readonly IUserManager _userManager; + + public CollectionsViewMigration(IServerConfigurationManager config, IUserManager userManager) + { + _config = config; + _userManager = userManager; + } + + public void Run() + { + var migrationKey = this.GetType().Name; + var migrationKeyList = _config.Configuration.Migrations.ToList(); + + if (!migrationKeyList.Contains(migrationKey)) + { + if (_config.Configuration.IsStartupWizardCompleted) + { + if (_userManager.Users.Any(i => i.Configuration.DisplayCollectionsView)) + { + _config.Configuration.DisplayCollectionsView = true; + } + } + + migrationKeyList.Add(migrationKey); + _config.Configuration.Migrations = migrationKeyList.ToArray(); + _config.SaveConfiguration(); + } + + } + } +} -- cgit v1.2.3 From 4a95ec28f2b92c906be956b0e5686211744917db Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 30 Jun 2016 11:10:54 -0400 Subject: add config setting --- MediaBrowser.Model/Configuration/ServerConfiguration.cs | 2 ++ MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'MediaBrowser.Model/Configuration/ServerConfiguration.cs') diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index e4c17ff2b..f779fcd61 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -192,6 +192,7 @@ namespace MediaBrowser.Model.Configuration public int MigrationVersion { get; set; } public int SchemaVersion { get; set; } + public int SqliteCachePages { get; set; } public bool DownloadImagesInAdvance { get; set; } @@ -211,6 +212,7 @@ namespace MediaBrowser.Model.Configuration { LocalNetworkAddresses = new string[] { }; Migrations = new string[] { }; + SqliteCachePages = 10000; EnableCustomPathSubFolders = true; EnableLocalizedGuids = true; diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs index d0c351c5d..84e726ffa 100644 --- a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs +++ b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs @@ -123,7 +123,7 @@ namespace MediaBrowser.Server.Implementations.Persistence protected override async Task CreateConnection(bool isReadOnly = false) { - var connection = await DbConnector.Connect(DbFilePath, false, false, 10000).ConfigureAwait(false); + var connection = await DbConnector.Connect(DbFilePath, false, false, _config.Configuration.SqliteCachePages).ConfigureAwait(false); connection.RunQueries(new[] { -- cgit v1.2.3