diff --git a/MediaBrowser.Controller/Entities/IHasProgramAttributes.cs b/MediaBrowser.Controller/Entities/IHasProgramAttributes.cs index 9938a4489..1c3270d72 100644 --- a/MediaBrowser.Controller/Entities/IHasProgramAttributes.cs +++ b/MediaBrowser.Controller/Entities/IHasProgramAttributes.cs @@ -15,6 +15,6 @@ namespace MediaBrowser.Controller.Entities bool IsLive { get; set; } bool IsPremiere { get; set; } ProgramAudio? Audio { get; set; } - DateTime? OriginalAirDate { get; set; } + string EpisodeTitle { get; set; } } } diff --git a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs index 0a91a9143..a34860c52 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs @@ -17,6 +17,7 @@ namespace MediaBrowser.Controller.LiveTv public string ExternalId { get; set; } public string ProviderImagePath { get; set; } public string ProviderImageUrl { get; set; } + [IgnoreDataMember] public string EpisodeTitle { get; set; } [IgnoreDataMember] public bool IsSeries { get; set; } @@ -30,6 +31,7 @@ namespace MediaBrowser.Controller.LiveTv public bool IsNews { get; set; } [IgnoreDataMember] public bool IsKids { get; set; } + [IgnoreDataMember] public bool IsRepeat { get; set; } [IgnoreDataMember] public bool IsMovie { get; set; } @@ -41,7 +43,6 @@ namespace MediaBrowser.Controller.LiveTv public ChannelType ChannelType { get; set; } public string ProgramId { get; set; } public ProgramAudio? Audio { get; set; } - public DateTime? OriginalAirDate { get; set; } /// /// Gets the user data key. diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs index 6d65672ec..8f032c522 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs @@ -41,12 +41,6 @@ namespace MediaBrowser.Controller.LiveTv /// public string ExternalId { get; set; } - /// - /// Gets or sets the original air date. - /// - /// The original air date. - public DateTime? OriginalAirDate { get; set; } - /// /// Gets or sets the type of the channel. /// @@ -75,12 +69,14 @@ namespace MediaBrowser.Controller.LiveTv /// Gets or sets a value indicating whether this instance is repeat. /// /// true if this instance is repeat; otherwise, false. + [IgnoreDataMember] public bool IsRepeat { get; set; } /// /// Gets or sets the episode title. /// /// The episode title. + [IgnoreDataMember] public string EpisodeTitle { get; set; } /// diff --git a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs index b8318a01c..4218e4911 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs @@ -17,6 +17,7 @@ namespace MediaBrowser.Controller.LiveTv public string ExternalId { get; set; } public string ProviderImagePath { get; set; } public string ProviderImageUrl { get; set; } + [IgnoreDataMember] public string EpisodeTitle { get; set; } [IgnoreDataMember] public bool IsSeries { get; set; } @@ -30,6 +31,7 @@ namespace MediaBrowser.Controller.LiveTv public bool IsNews { get; set; } [IgnoreDataMember] public bool IsKids { get; set; } + [IgnoreDataMember] public bool IsRepeat { get; set; } [IgnoreDataMember] public bool IsMovie { get; set; } @@ -41,7 +43,6 @@ namespace MediaBrowser.Controller.LiveTv public ChannelType ChannelType { get; set; } public string ProgramId { get; set; } public ProgramAudio? Audio { get; set; } - public DateTime? OriginalAirDate { get; set; } /// /// Gets the user data key. diff --git a/MediaBrowser.Model/Dto/BaseItemDto.cs b/MediaBrowser.Model/Dto/BaseItemDto.cs index 9400582c4..90dd3ad58 100644 --- a/MediaBrowser.Model/Dto/BaseItemDto.cs +++ b/MediaBrowser.Model/Dto/BaseItemDto.cs @@ -1110,12 +1110,6 @@ namespace MediaBrowser.Model.Dto /// public DateTime? StartDate { get; set; } - /// - /// Gets or sets the original air date. - /// - /// The original air date. - public DateTime? OriginalAirDate { get; set; } - /// /// Gets or sets the completion percentage. /// diff --git a/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs b/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs index 9968425e3..430bae38e 100644 --- a/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs +++ b/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs @@ -21,17 +21,19 @@ namespace MediaBrowser.Server.Implementations.Collections private readonly IFileSystem _fileSystem; private readonly ILibraryMonitor _iLibraryMonitor; private readonly ILogger _logger; + private readonly IProviderManager _providerManager; public event EventHandler CollectionCreated; public event EventHandler ItemsAddedToCollection; public event EventHandler ItemsRemovedFromCollection; - public CollectionManager(ILibraryManager libraryManager, IFileSystem fileSystem, ILibraryMonitor iLibraryMonitor, ILogger logger) + public CollectionManager(ILibraryManager libraryManager, IFileSystem fileSystem, ILibraryMonitor iLibraryMonitor, ILogger logger, IProviderManager providerManager) { _libraryManager = libraryManager; _fileSystem = fileSystem; _iLibraryMonitor = iLibraryMonitor; _logger = logger; + _providerManager = providerManager; } public Folder GetCollectionsFolder(string userId) @@ -88,13 +90,14 @@ namespace MediaBrowser.Server.Implementations.Collections await parentFolder.AddChild(collection, CancellationToken.None).ConfigureAwait(false); - await collection.RefreshMetadata(new MetadataRefreshOptions(new DirectoryService(_fileSystem)), CancellationToken.None) - .ConfigureAwait(false); - if (options.ItemIdList.Count > 0) { await AddToCollection(collection.Id, options.ItemIdList, false); } + else + { + _providerManager.QueueRefresh(collection.Id, new MetadataRefreshOptions(_fileSystem)); + } EventHelper.FireEventIfNotNull(CollectionCreated, this, new CollectionCreatedEventArgs { @@ -181,7 +184,8 @@ namespace MediaBrowser.Server.Implementations.Collections collection.UpdateRatingToContent(); await collection.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false); - await collection.RefreshMetadata(CancellationToken.None).ConfigureAwait(false); + + _providerManager.QueueRefresh(collection.Id, new MetadataRefreshOptions(_fileSystem)); if (fireEvent) { @@ -263,7 +267,7 @@ namespace MediaBrowser.Server.Implementations.Collections collection.UpdateRatingToContent(); await collection.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false); - await collection.RefreshMetadata(CancellationToken.None).ConfigureAwait(false); + _providerManager.QueueRefresh(collection.Id, new MetadataRefreshOptions(_fileSystem)); EventHelper.FireEventIfNotNull(ItemsRemovedFromCollection, this, new CollectionModifiedEventArgs { diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs index fbafe7151..8eb70a638 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs @@ -633,7 +633,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv item.Name = info.Name; item.OfficialRating = item.OfficialRating ?? info.OfficialRating; item.Overview = item.Overview ?? info.Overview; - item.OriginalAirDate = info.OriginalAirDate; item.ProviderImagePath = info.ImagePath; item.ProviderImageUrl = info.ImageUrl; item.RunTimeTicks = (info.EndDate - info.StartDate).Ticks; @@ -641,7 +640,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv item.HomePageUrl = info.HomePageUrl; item.ProductionYear = info.ProductionYear; - item.PremiereDate = item.PremiereDate ?? info.OriginalAirDate; + item.PremiereDate = info.OriginalAirDate; item.IndexNumber = info.EpisodeNumber; item.ParentIndexNumber = info.SeasonNumber; @@ -657,7 +656,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv else { // Increment this whenver some internal change deems it necessary - var etag = info.Etag + "1"; + var etag = info.Etag + "2"; if (!string.Equals(etag, item.Etag, StringComparison.OrdinalIgnoreCase)) { @@ -712,6 +711,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv item.Overview = info.Overview; item.EndDate = info.EndDate; item.Genres = info.Genres; + item.PremiereDate = info.OriginalAirDate; var recording = (ILiveTvRecording)item; @@ -733,7 +733,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv recording.IsRepeat = info.IsRepeat; recording.IsSeries = info.IsSeries; recording.IsSports = info.IsSports; - recording.OriginalAirDate = info.OriginalAirDate; recording.SeriesTimerId = info.SeriesTimerId; recording.StartDate = info.StartDate; recording.Status = info.Status; @@ -1438,8 +1437,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv dto.IsPremiere = program.IsPremiere; } - dto.OriginalAirDate = program.OriginalAirDate; - if (channel != null) { dto.ChannelName = channel.Name; @@ -1479,7 +1476,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv dto.IsNews = info.IsNews; dto.IsKids = info.IsKids; dto.IsPremiere = info.IsPremiere; - dto.OriginalAirDate = info.OriginalAirDate; dto.CanDelete = user == null ? recording.CanDelete() diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs index ce1a91791..35ef80b32 100644 --- a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs +++ b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs @@ -72,7 +72,7 @@ namespace MediaBrowser.Server.Implementations.Persistence private IDbCommand _deletePeopleCommand; private IDbCommand _savePersonCommand; - private const int LatestSchemaVersion = 9; + private const int LatestSchemaVersion = 10; /// /// Initializes a new instance of the class. @@ -181,6 +181,9 @@ namespace MediaBrowser.Server.Implementations.Persistence _connection.AddColumn(_logger, "TypedBaseItems", "IsLive", "BIT"); _connection.AddColumn(_logger, "TypedBaseItems", "IsNews", "BIT"); _connection.AddColumn(_logger, "TypedBaseItems", "IsPremiere", "BIT"); + + _connection.AddColumn(_logger, "TypedBaseItems", "EpisodeTitle", "Text"); + _connection.AddColumn(_logger, "TypedBaseItems", "IsRepeat", "BIT"); PrepareStatements(); @@ -208,6 +211,8 @@ namespace MediaBrowser.Server.Implementations.Persistence "IsLive", "IsNews", "IsPremiere", + "EpisodeTitle", + "IsRepeat", "CommunityRating", "CustomRating", "IndexNumber", @@ -235,6 +240,8 @@ namespace MediaBrowser.Server.Implementations.Persistence "IsLive", "IsNews", "IsPremiere", + "EpisodeTitle", + "IsRepeat", "CommunityRating", "CustomRating", "IndexNumber", @@ -386,6 +393,8 @@ namespace MediaBrowser.Server.Implementations.Persistence _saveItemCommand.GetParameter(index++).Value = hasProgramAttributes.IsLive; _saveItemCommand.GetParameter(index++).Value = hasProgramAttributes.IsNews; _saveItemCommand.GetParameter(index++).Value = hasProgramAttributes.IsPremiere; + _saveItemCommand.GetParameter(index++).Value = hasProgramAttributes.EpisodeTitle; + _saveItemCommand.GetParameter(index++).Value = hasProgramAttributes.IsRepeat; } else { @@ -396,6 +405,8 @@ namespace MediaBrowser.Server.Implementations.Persistence _saveItemCommand.GetParameter(index++).Value = null; _saveItemCommand.GetParameter(index++).Value = null; _saveItemCommand.GetParameter(index++).Value = null; + _saveItemCommand.GetParameter(index++).Value = null; + _saveItemCommand.GetParameter(index++).Value = null; } _saveItemCommand.GetParameter(index++).Value = item.CommunityRating; @@ -604,26 +615,36 @@ namespace MediaBrowser.Server.Implementations.Persistence { hasProgramAttributes.IsPremiere = reader.GetBoolean(12); } - } - if (!reader.IsDBNull(13)) - { - item.CommunityRating = reader.GetFloat(13); - } + if (!reader.IsDBNull(13)) + { + hasProgramAttributes.EpisodeTitle = reader.GetString(13); + } - if (!reader.IsDBNull(14)) - { - item.CustomRating = reader.GetString(14); + if (!reader.IsDBNull(14)) + { + hasProgramAttributes.IsRepeat = reader.GetBoolean(14); + } } if (!reader.IsDBNull(15)) { - item.IndexNumber = reader.GetInt32(15); + item.CommunityRating = reader.GetFloat(15); } if (!reader.IsDBNull(16)) { - item.IsLocked = reader.GetBoolean(16); + item.CustomRating = reader.GetString(16); + } + + if (!reader.IsDBNull(17)) + { + item.IndexNumber = reader.GetInt32(17); + } + + if (!reader.IsDBNull(18)) + { + item.IsLocked = reader.GetBoolean(18); } return item; diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index c38c81866..e63adaebd 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -487,7 +487,7 @@ namespace MediaBrowser.Server.Startup.Common var connectionManager = new ConnectionManager(dlnaManager, ServerConfigurationManager, LogManager.GetLogger("UpnpConnectionManager"), HttpClient); RegisterSingleInstance(connectionManager); - CollectionManager = new CollectionManager(LibraryManager, FileSystemManager, LibraryMonitor, LogManager.GetLogger("CollectionManager")); + CollectionManager = new CollectionManager(LibraryManager, FileSystemManager, LibraryMonitor, LogManager.GetLogger("CollectionManager"), ProviderManager); RegisterSingleInstance(CollectionManager); PlaylistManager = new PlaylistManager(LibraryManager, FileSystemManager, LibraryMonitor, LogManager.GetLogger("PlaylistManager"), UserManager, ProviderManager); diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj index c8b53cdbf..131c7e657 100644 --- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj +++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj @@ -459,9 +459,6 @@ PreserveNewest - - PreserveNewest - PreserveNewest