From d683f3061979d786efc574f1073af4e77da11772 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 13 Mar 2016 21:34:24 -0400 Subject: update music user data key --- MediaBrowser.Model/Configuration/ServerConfiguration.cs | 3 ++- 1 file changed, 2 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 64edbdea9..009068dea 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -207,7 +207,8 @@ namespace MediaBrowser.Model.Configuration public bool DownloadImagesInAdvance { get; set; } public bool EnableAnonymousUsageReporting { get; set; } - + public bool EnableStandaloneMusicKeys { get; set; } + /// /// Initializes a new instance of the class. /// -- cgit v1.2.3 From 77e36768e4def7cb62f7cf0b855f01c15dcaf922 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 19 Mar 2016 17:55:42 -0400 Subject: removed dead code --- .../MediaBrowser.Model.Portable.csproj | 3 -- .../MediaBrowser.Model.net35.csproj | 3 -- .../Configuration/ServerConfiguration.cs | 6 --- MediaBrowser.Model/Dto/BaseItemDto.cs | 5 ++ MediaBrowser.Model/Dto/ItemByNameCounts.cs | 63 ---------------------- MediaBrowser.Model/MediaBrowser.Model.csproj | 1 - .../Configuration/ServerConfigurationManager.cs | 23 -------- .../Dto/DtoService.cs | 1 + 8 files changed, 6 insertions(+), 99 deletions(-) delete mode 100644 MediaBrowser.Model/Dto/ItemByNameCounts.cs (limited to 'MediaBrowser.Model/Configuration/ServerConfiguration.cs') diff --git a/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj b/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj index 5dcfded6f..54fdc6400 100644 --- a/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj +++ b/MediaBrowser.Model.Portable/MediaBrowser.Model.Portable.csproj @@ -470,9 +470,6 @@ Dto\ImageOptions.cs - - Dto\ItemByNameCounts.cs - Dto\ItemCounts.cs diff --git a/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj b/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj index 6c484ffc9..473186a46 100644 --- a/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj +++ b/MediaBrowser.Model.net35/MediaBrowser.Model.net35.csproj @@ -444,9 +444,6 @@ Dto\ImageOptions.cs - - Dto\ItemByNameCounts.cs - Dto\ItemCounts.cs diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index 009068dea..bbc6195ff 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -62,12 +62,6 @@ namespace MediaBrowser.Model.Configuration /// true if this instance is port authorized; otherwise, false. public bool IsPortAuthorized { get; set; } - /// - /// Gets or sets the item by name path. - /// - /// The item by name path. - public string ItemsByNamePath { get; set; } - /// /// Gets or sets the metadata path. /// diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs index d9b06dcfd..8f617cadf 100644 --- a/MediaBrowser.Model/Dto/BaseItemDto.cs +++ b/MediaBrowser.Model/Dto/BaseItemDto.cs @@ -792,6 +792,11 @@ namespace MediaBrowser.Model.Dto /// The locked fields. public List LockedFields { get; set; } + /// + /// Gets or sets the trailer count. + /// + /// The trailer count. + public int? TrailerCount { get; set; } /// /// Gets or sets the movie count. /// diff --git a/MediaBrowser.Model/Dto/ItemByNameCounts.cs b/MediaBrowser.Model/Dto/ItemByNameCounts.cs deleted file mode 100644 index 7c51f07bd..000000000 --- a/MediaBrowser.Model/Dto/ItemByNameCounts.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; - -namespace MediaBrowser.Model.Dto -{ - /// - /// Class ItemByNameCounts - /// - public class ItemByNameCounts - { - public string UserId { get; set; } - - /// - /// Gets or sets the total count. - /// - /// The total count. - public int TotalCount { get; set; } - /// - /// Gets or sets the adult video count. - /// - /// The adult video count. - public int AdultVideoCount { get; set; } - /// - /// Gets or sets the movie count. - /// - /// The movie count. - public int MovieCount { get; set; } - /// - /// Gets or sets the series count. - /// - /// The series count. - public int SeriesCount { get; set; } - /// - /// Gets or sets the episode count. - /// - /// The episode count. - public int EpisodeCount { get; set; } - /// - /// Gets or sets the game count. - /// - /// The game count. - public int GameCount { get; set; } - /// - /// Gets or sets the trailer count. - /// - /// The trailer count. - public int TrailerCount { get; set; } - /// - /// Gets or sets the song count. - /// - /// The song count. - public int SongCount { get; set; } - /// - /// Gets or sets the album count. - /// - /// The album count. - public int AlbumCount { get; set; } - /// - /// Gets or sets the music video count. - /// - /// The music video count. - public int MusicVideoCount { get; set; } - } -} diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index 2500a27a8..41952963c 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -215,7 +215,6 @@ - diff --git a/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs b/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs index 1a5c35df8..7db457c6e 100644 --- a/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs +++ b/MediaBrowser.Server.Implementations/Configuration/ServerConfigurationManager.cs @@ -145,7 +145,6 @@ namespace MediaBrowser.Server.Implementations.Configuration { var newConfig = (ServerConfiguration)newConfiguration; - ValidateItemByNamePath(newConfig); ValidatePathSubstitutions(newConfig); ValidateMetadataPath(newConfig); ValidateSslCertificate(newConfig); @@ -189,28 +188,6 @@ namespace MediaBrowser.Server.Implementations.Configuration } } - /// - /// Replaces the item by name path. - /// - /// The new configuration. - /// - private void ValidateItemByNamePath(ServerConfiguration newConfig) - { - var newPath = newConfig.ItemsByNamePath; - - if (!string.IsNullOrWhiteSpace(newPath) - && !string.Equals(Configuration.ItemsByNamePath ?? string.Empty, newPath)) - { - // Validate - if (!FileSystem.DirectoryExists(newPath)) - { - throw new DirectoryNotFoundException(string.Format("{0} does not exist.", newPath)); - } - - EnsureWriteAccess(newPath); - } - } - /// /// Validates the metadata path. /// diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs index 3b63eccfc..3ead1a835 100644 --- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs +++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs @@ -457,6 +457,7 @@ namespace MediaBrowser.Server.Implementations.Dto dto.EpisodeCount = taggedItems.Count(i => i is Episode); dto.GameCount = taggedItems.Count(i => i is Game); dto.MovieCount = taggedItems.Count(i => i is Movie); + dto.TrailerCount = taggedItems.Count(i => i is Trailer); dto.MusicVideoCount = taggedItems.Count(i => i is MusicVideo); dto.SeriesCount = taggedItems.Count(i => i is Series); dto.SongCount = taggedItems.Count(i => i is Audio); -- cgit v1.2.3 From 5d0abc280dc84598574515ba203388c0e22d3acf Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 24 Mar 2016 02:04:58 -0400 Subject: fixes #1404 - [BUG] Emby recreating old folder name after renaming/moving folder --- MediaBrowser.Api/StartupWizardService.cs | 1 + MediaBrowser.Model/Configuration/ServerConfiguration.cs | 6 ++++++ MediaBrowser.Providers/TV/DummySeasonProvider.cs | 2 +- MediaBrowser.Providers/TV/MissingEpisodeProvider.cs | 2 +- MediaBrowser.Server.Implementations/Channels/ChannelManager.cs | 3 +-- MediaBrowser.Server.Implementations/Library/LibraryManager.cs | 7 ++++++- MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs | 10 ++++++---- MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs | 2 +- 8 files changed, 23 insertions(+), 10 deletions(-) (limited to 'MediaBrowser.Model/Configuration/ServerConfiguration.cs') diff --git a/MediaBrowser.Api/StartupWizardService.cs b/MediaBrowser.Api/StartupWizardService.cs index 10f9ec022..14bd6b61f 100644 --- a/MediaBrowser.Api/StartupWizardService.cs +++ b/MediaBrowser.Api/StartupWizardService.cs @@ -69,6 +69,7 @@ namespace MediaBrowser.Api _config.Configuration.EnableCustomPathSubFolders = true; _config.Configuration.EnableDateLastRefresh = true; _config.Configuration.EnableStandaloneMusicKeys = true; + _config.Configuration.EnableCaseSensitiveItemIds = true; _config.SaveConfiguration(); } diff --git a/MediaBrowser.Model/Configuration/ServerConfiguration.cs b/MediaBrowser.Model/Configuration/ServerConfiguration.cs index bbc6195ff..041f51a89 100644 --- a/MediaBrowser.Model/Configuration/ServerConfiguration.cs +++ b/MediaBrowser.Model/Configuration/ServerConfiguration.cs @@ -62,6 +62,12 @@ namespace MediaBrowser.Model.Configuration /// true if this instance is port authorized; otherwise, false. public bool IsPortAuthorized { get; set; } + /// + /// Gets or sets a value indicating whether [enable case sensitive item ids]. + /// + /// true if [enable case sensitive item ids]; otherwise, false. + public bool EnableCaseSensitiveItemIds { get; set; } + /// /// Gets or sets the metadata path. /// diff --git a/MediaBrowser.Providers/TV/DummySeasonProvider.cs b/MediaBrowser.Providers/TV/DummySeasonProvider.cs index d4e4b4844..3a1e05704 100644 --- a/MediaBrowser.Providers/TV/DummySeasonProvider.cs +++ b/MediaBrowser.Providers/TV/DummySeasonProvider.cs @@ -115,7 +115,7 @@ namespace MediaBrowser.Providers.TV { Name = seasonName, IndexNumber = seasonNumber, - Id = (series.Id + (seasonNumber ?? -1).ToString(_usCulture) + seasonName).GetMBId(typeof(Season)) + Id = _libraryManager.GetNewItemId((series.Id + (seasonNumber ?? -1).ToString(_usCulture) + seasonName), typeof(Season)) }; season.SetParent(series); diff --git a/MediaBrowser.Providers/TV/MissingEpisodeProvider.cs b/MediaBrowser.Providers/TV/MissingEpisodeProvider.cs index ff31dbc92..248be675d 100644 --- a/MediaBrowser.Providers/TV/MissingEpisodeProvider.cs +++ b/MediaBrowser.Providers/TV/MissingEpisodeProvider.cs @@ -422,7 +422,7 @@ namespace MediaBrowser.Providers.TV Name = name, IndexNumber = episodeNumber, ParentIndexNumber = seasonNumber, - Id = (series.Id + seasonNumber.ToString(_usCulture) + name).GetMBId(typeof(Episode)) + Id = _libraryManager.GetNewItemId((series.Id + seasonNumber.ToString(_usCulture) + name), typeof(Episode)) }; episode.SetParent(season); diff --git a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs b/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs index 240037597..d849ce7bd 100644 --- a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs +++ b/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs @@ -561,8 +561,7 @@ namespace MediaBrowser.Server.Implementations.Channels { throw new ArgumentNullException("name"); } - - return ("Channel " + name).GetMBId(typeof(Channel)); + return _libraryManager.GetNewItemId("Channel " + name, typeof(Channel)); } public async Task> GetLatestChannelItems(AllChannelMediaQuery query, CancellationToken cancellationToken) diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index ad3cd2576..0e61f2969 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -508,7 +508,12 @@ namespace MediaBrowser.Server.Implementations.Library .Replace("/", "\\"); } - key = type.FullName + key.ToLower(); + if (!ConfigurationManager.Configuration.EnableCaseSensitiveItemIds) + { + key = key.ToLower(); + } + + key = type.FullName + key; return key.GetMD5(); } diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs index 3da0d15d3..7fe486de7 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvDtoService.cs @@ -25,14 +25,16 @@ namespace MediaBrowser.Server.Implementations.LiveTv private readonly IUserDataManager _userDataManager; private readonly IDtoService _dtoService; private readonly IApplicationHost _appHost; + private readonly ILibraryManager _libraryManager; - public LiveTvDtoService(IDtoService dtoService, IUserDataManager userDataManager, IImageProcessor imageProcessor, ILogger logger, IApplicationHost appHost) + public LiveTvDtoService(IDtoService dtoService, IUserDataManager userDataManager, IImageProcessor imageProcessor, ILogger logger, IApplicationHost appHost, ILibraryManager libraryManager) { _dtoService = dtoService; _userDataManager = userDataManager; _imageProcessor = imageProcessor; _logger = logger; _appHost = appHost; + _libraryManager = libraryManager; } public TimerInfoDto GetTimerInfoDto(TimerInfo info, ILiveTvService service, LiveTvProgram program, LiveTvChannel channel) @@ -200,7 +202,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv { var name = serviceName + externalId + InternalVersionNumber; - return name.ToLower().GetMBId(typeof(LiveTvChannel)); + return _libraryManager.GetNewItemId(name.ToLower(), typeof(LiveTvChannel)); } public Guid GetInternalTimerId(string serviceName, string externalId) @@ -221,14 +223,14 @@ namespace MediaBrowser.Server.Implementations.LiveTv { var name = serviceName + externalId + InternalVersionNumber; - return name.ToLower().GetMBId(typeof(LiveTvProgram)); + return _libraryManager.GetNewItemId(name.ToLower(), typeof(LiveTvProgram)); } public Guid GetInternalRecordingId(string serviceName, string externalId) { var name = serviceName + externalId + InternalVersionNumber + "0"; - return name.ToLower().GetMBId(typeof(ILiveTvRecording)); + return _libraryManager.GetNewItemId(name.ToLower(), typeof(ILiveTvRecording)); } public async Task GetTimerInfo(TimerInfoDto dto, bool isNew, LiveTvManager liveTv, CancellationToken cancellationToken) diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs index 08b0256b2..526de62c8 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs @@ -81,7 +81,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv _dtoService = dtoService; _userDataManager = userDataManager; - _tvDtoService = new LiveTvDtoService(dtoService, userDataManager, imageProcessor, logger, appHost); + _tvDtoService = new LiveTvDtoService(dtoService, userDataManager, imageProcessor, logger, appHost, _libraryManager); } /// -- cgit v1.2.3