move tv data

pull/702/head
Luke Pulverenti 9 years ago
parent 0d6580baf3
commit 6e222eaaf4

@ -15,6 +15,6 @@ namespace MediaBrowser.Controller.Entities
bool IsLive { get; set; } bool IsLive { get; set; }
bool IsPremiere { get; set; } bool IsPremiere { get; set; }
ProgramAudio? Audio { get; set; } ProgramAudio? Audio { get; set; }
DateTime? OriginalAirDate { get; set; } string EpisodeTitle { get; set; }
} }
} }

@ -17,6 +17,7 @@ namespace MediaBrowser.Controller.LiveTv
public string ExternalId { get; set; } public string ExternalId { get; set; }
public string ProviderImagePath { get; set; } public string ProviderImagePath { get; set; }
public string ProviderImageUrl { get; set; } public string ProviderImageUrl { get; set; }
[IgnoreDataMember]
public string EpisodeTitle { get; set; } public string EpisodeTitle { get; set; }
[IgnoreDataMember] [IgnoreDataMember]
public bool IsSeries { get; set; } public bool IsSeries { get; set; }
@ -30,6 +31,7 @@ namespace MediaBrowser.Controller.LiveTv
public bool IsNews { get; set; } public bool IsNews { get; set; }
[IgnoreDataMember] [IgnoreDataMember]
public bool IsKids { get; set; } public bool IsKids { get; set; }
[IgnoreDataMember]
public bool IsRepeat { get; set; } public bool IsRepeat { get; set; }
[IgnoreDataMember] [IgnoreDataMember]
public bool IsMovie { get; set; } public bool IsMovie { get; set; }
@ -41,7 +43,6 @@ namespace MediaBrowser.Controller.LiveTv
public ChannelType ChannelType { get; set; } public ChannelType ChannelType { get; set; }
public string ProgramId { get; set; } public string ProgramId { get; set; }
public ProgramAudio? Audio { get; set; } public ProgramAudio? Audio { get; set; }
public DateTime? OriginalAirDate { get; set; }
/// <summary> /// <summary>
/// Gets the user data key. /// Gets the user data key.

@ -41,12 +41,6 @@ namespace MediaBrowser.Controller.LiveTv
/// </summary> /// </summary>
public string ExternalId { get; set; } public string ExternalId { get; set; }
/// <summary>
/// Gets or sets the original air date.
/// </summary>
/// <value>The original air date.</value>
public DateTime? OriginalAirDate { get; set; }
/// <summary> /// <summary>
/// Gets or sets the type of the channel. /// Gets or sets the type of the channel.
/// </summary> /// </summary>
@ -75,12 +69,14 @@ namespace MediaBrowser.Controller.LiveTv
/// Gets or sets a value indicating whether this instance is repeat. /// Gets or sets a value indicating whether this instance is repeat.
/// </summary> /// </summary>
/// <value><c>true</c> if this instance is repeat; otherwise, <c>false</c>.</value> /// <value><c>true</c> if this instance is repeat; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public bool IsRepeat { get; set; } public bool IsRepeat { get; set; }
/// <summary> /// <summary>
/// Gets or sets the episode title. /// Gets or sets the episode title.
/// </summary> /// </summary>
/// <value>The episode title.</value> /// <value>The episode title.</value>
[IgnoreDataMember]
public string EpisodeTitle { get; set; } public string EpisodeTitle { get; set; }
/// <summary> /// <summary>

@ -17,6 +17,7 @@ namespace MediaBrowser.Controller.LiveTv
public string ExternalId { get; set; } public string ExternalId { get; set; }
public string ProviderImagePath { get; set; } public string ProviderImagePath { get; set; }
public string ProviderImageUrl { get; set; } public string ProviderImageUrl { get; set; }
[IgnoreDataMember]
public string EpisodeTitle { get; set; } public string EpisodeTitle { get; set; }
[IgnoreDataMember] [IgnoreDataMember]
public bool IsSeries { get; set; } public bool IsSeries { get; set; }
@ -30,6 +31,7 @@ namespace MediaBrowser.Controller.LiveTv
public bool IsNews { get; set; } public bool IsNews { get; set; }
[IgnoreDataMember] [IgnoreDataMember]
public bool IsKids { get; set; } public bool IsKids { get; set; }
[IgnoreDataMember]
public bool IsRepeat { get; set; } public bool IsRepeat { get; set; }
[IgnoreDataMember] [IgnoreDataMember]
public bool IsMovie { get; set; } public bool IsMovie { get; set; }
@ -41,7 +43,6 @@ namespace MediaBrowser.Controller.LiveTv
public ChannelType ChannelType { get; set; } public ChannelType ChannelType { get; set; }
public string ProgramId { get; set; } public string ProgramId { get; set; }
public ProgramAudio? Audio { get; set; } public ProgramAudio? Audio { get; set; }
public DateTime? OriginalAirDate { get; set; }
/// <summary> /// <summary>
/// Gets the user data key. /// Gets the user data key.

@ -1110,12 +1110,6 @@ namespace MediaBrowser.Model.Dto
/// </summary> /// </summary>
public DateTime? StartDate { get; set; } public DateTime? StartDate { get; set; }
/// <summary>
/// Gets or sets the original air date.
/// </summary>
/// <value>The original air date.</value>
public DateTime? OriginalAirDate { get; set; }
/// <summary> /// <summary>
/// Gets or sets the completion percentage. /// Gets or sets the completion percentage.
/// </summary> /// </summary>

@ -21,17 +21,19 @@ namespace MediaBrowser.Server.Implementations.Collections
private readonly IFileSystem _fileSystem; private readonly IFileSystem _fileSystem;
private readonly ILibraryMonitor _iLibraryMonitor; private readonly ILibraryMonitor _iLibraryMonitor;
private readonly ILogger _logger; private readonly ILogger _logger;
private readonly IProviderManager _providerManager;
public event EventHandler<CollectionCreatedEventArgs> CollectionCreated; public event EventHandler<CollectionCreatedEventArgs> CollectionCreated;
public event EventHandler<CollectionModifiedEventArgs> ItemsAddedToCollection; public event EventHandler<CollectionModifiedEventArgs> ItemsAddedToCollection;
public event EventHandler<CollectionModifiedEventArgs> ItemsRemovedFromCollection; public event EventHandler<CollectionModifiedEventArgs> 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; _libraryManager = libraryManager;
_fileSystem = fileSystem; _fileSystem = fileSystem;
_iLibraryMonitor = iLibraryMonitor; _iLibraryMonitor = iLibraryMonitor;
_logger = logger; _logger = logger;
_providerManager = providerManager;
} }
public Folder GetCollectionsFolder(string userId) public Folder GetCollectionsFolder(string userId)
@ -88,13 +90,14 @@ namespace MediaBrowser.Server.Implementations.Collections
await parentFolder.AddChild(collection, CancellationToken.None).ConfigureAwait(false); 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) if (options.ItemIdList.Count > 0)
{ {
await AddToCollection(collection.Id, options.ItemIdList, false); await AddToCollection(collection.Id, options.ItemIdList, false);
} }
else
{
_providerManager.QueueRefresh(collection.Id, new MetadataRefreshOptions(_fileSystem));
}
EventHelper.FireEventIfNotNull(CollectionCreated, this, new CollectionCreatedEventArgs EventHelper.FireEventIfNotNull(CollectionCreated, this, new CollectionCreatedEventArgs
{ {
@ -181,7 +184,8 @@ namespace MediaBrowser.Server.Implementations.Collections
collection.UpdateRatingToContent(); collection.UpdateRatingToContent();
await collection.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false); 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) if (fireEvent)
{ {
@ -263,7 +267,7 @@ namespace MediaBrowser.Server.Implementations.Collections
collection.UpdateRatingToContent(); collection.UpdateRatingToContent();
await collection.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false); 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 EventHelper.FireEventIfNotNull(ItemsRemovedFromCollection, this, new CollectionModifiedEventArgs
{ {

@ -633,7 +633,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv
item.Name = info.Name; item.Name = info.Name;
item.OfficialRating = item.OfficialRating ?? info.OfficialRating; item.OfficialRating = item.OfficialRating ?? info.OfficialRating;
item.Overview = item.Overview ?? info.Overview; item.Overview = item.Overview ?? info.Overview;
item.OriginalAirDate = info.OriginalAirDate;
item.ProviderImagePath = info.ImagePath; item.ProviderImagePath = info.ImagePath;
item.ProviderImageUrl = info.ImageUrl; item.ProviderImageUrl = info.ImageUrl;
item.RunTimeTicks = (info.EndDate - info.StartDate).Ticks; item.RunTimeTicks = (info.EndDate - info.StartDate).Ticks;
@ -641,7 +640,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
item.HomePageUrl = info.HomePageUrl; item.HomePageUrl = info.HomePageUrl;
item.ProductionYear = info.ProductionYear; item.ProductionYear = info.ProductionYear;
item.PremiereDate = item.PremiereDate ?? info.OriginalAirDate; item.PremiereDate = info.OriginalAirDate;
item.IndexNumber = info.EpisodeNumber; item.IndexNumber = info.EpisodeNumber;
item.ParentIndexNumber = info.SeasonNumber; item.ParentIndexNumber = info.SeasonNumber;
@ -657,7 +656,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
else else
{ {
// Increment this whenver some internal change deems it necessary // 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)) if (!string.Equals(etag, item.Etag, StringComparison.OrdinalIgnoreCase))
{ {
@ -712,6 +711,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
item.Overview = info.Overview; item.Overview = info.Overview;
item.EndDate = info.EndDate; item.EndDate = info.EndDate;
item.Genres = info.Genres; item.Genres = info.Genres;
item.PremiereDate = info.OriginalAirDate;
var recording = (ILiveTvRecording)item; var recording = (ILiveTvRecording)item;
@ -733,7 +733,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv
recording.IsRepeat = info.IsRepeat; recording.IsRepeat = info.IsRepeat;
recording.IsSeries = info.IsSeries; recording.IsSeries = info.IsSeries;
recording.IsSports = info.IsSports; recording.IsSports = info.IsSports;
recording.OriginalAirDate = info.OriginalAirDate;
recording.SeriesTimerId = info.SeriesTimerId; recording.SeriesTimerId = info.SeriesTimerId;
recording.StartDate = info.StartDate; recording.StartDate = info.StartDate;
recording.Status = info.Status; recording.Status = info.Status;
@ -1438,8 +1437,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv
dto.IsPremiere = program.IsPremiere; dto.IsPremiere = program.IsPremiere;
} }
dto.OriginalAirDate = program.OriginalAirDate;
if (channel != null) if (channel != null)
{ {
dto.ChannelName = channel.Name; dto.ChannelName = channel.Name;
@ -1479,7 +1476,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv
dto.IsNews = info.IsNews; dto.IsNews = info.IsNews;
dto.IsKids = info.IsKids; dto.IsKids = info.IsKids;
dto.IsPremiere = info.IsPremiere; dto.IsPremiere = info.IsPremiere;
dto.OriginalAirDate = info.OriginalAirDate;
dto.CanDelete = user == null dto.CanDelete = user == null
? recording.CanDelete() ? recording.CanDelete()

@ -72,7 +72,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
private IDbCommand _deletePeopleCommand; private IDbCommand _deletePeopleCommand;
private IDbCommand _savePersonCommand; private IDbCommand _savePersonCommand;
private const int LatestSchemaVersion = 9; private const int LatestSchemaVersion = 10;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="SqliteItemRepository"/> class. /// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.
@ -182,6 +182,9 @@ namespace MediaBrowser.Server.Implementations.Persistence
_connection.AddColumn(_logger, "TypedBaseItems", "IsNews", "BIT"); _connection.AddColumn(_logger, "TypedBaseItems", "IsNews", "BIT");
_connection.AddColumn(_logger, "TypedBaseItems", "IsPremiere", "BIT"); _connection.AddColumn(_logger, "TypedBaseItems", "IsPremiere", "BIT");
_connection.AddColumn(_logger, "TypedBaseItems", "EpisodeTitle", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "IsRepeat", "BIT");
PrepareStatements(); PrepareStatements();
_mediaStreamsRepository.Initialize(); _mediaStreamsRepository.Initialize();
@ -208,6 +211,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
"IsLive", "IsLive",
"IsNews", "IsNews",
"IsPremiere", "IsPremiere",
"EpisodeTitle",
"IsRepeat",
"CommunityRating", "CommunityRating",
"CustomRating", "CustomRating",
"IndexNumber", "IndexNumber",
@ -235,6 +240,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
"IsLive", "IsLive",
"IsNews", "IsNews",
"IsPremiere", "IsPremiere",
"EpisodeTitle",
"IsRepeat",
"CommunityRating", "CommunityRating",
"CustomRating", "CustomRating",
"IndexNumber", "IndexNumber",
@ -386,6 +393,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
_saveItemCommand.GetParameter(index++).Value = hasProgramAttributes.IsLive; _saveItemCommand.GetParameter(index++).Value = hasProgramAttributes.IsLive;
_saveItemCommand.GetParameter(index++).Value = hasProgramAttributes.IsNews; _saveItemCommand.GetParameter(index++).Value = hasProgramAttributes.IsNews;
_saveItemCommand.GetParameter(index++).Value = hasProgramAttributes.IsPremiere; _saveItemCommand.GetParameter(index++).Value = hasProgramAttributes.IsPremiere;
_saveItemCommand.GetParameter(index++).Value = hasProgramAttributes.EpisodeTitle;
_saveItemCommand.GetParameter(index++).Value = hasProgramAttributes.IsRepeat;
} }
else 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 = null;
_saveItemCommand.GetParameter(index++).Value = null;
_saveItemCommand.GetParameter(index++).Value = null;
} }
_saveItemCommand.GetParameter(index++).Value = item.CommunityRating; _saveItemCommand.GetParameter(index++).Value = item.CommunityRating;
@ -604,26 +615,36 @@ namespace MediaBrowser.Server.Implementations.Persistence
{ {
hasProgramAttributes.IsPremiere = reader.GetBoolean(12); hasProgramAttributes.IsPremiere = reader.GetBoolean(12);
} }
}
if (!reader.IsDBNull(13)) if (!reader.IsDBNull(13))
{ {
item.CommunityRating = reader.GetFloat(13); hasProgramAttributes.EpisodeTitle = reader.GetString(13);
} }
if (!reader.IsDBNull(14)) if (!reader.IsDBNull(14))
{ {
item.CustomRating = reader.GetString(14); hasProgramAttributes.IsRepeat = reader.GetBoolean(14);
}
} }
if (!reader.IsDBNull(15)) if (!reader.IsDBNull(15))
{ {
item.IndexNumber = reader.GetInt32(15); item.CommunityRating = reader.GetFloat(15);
} }
if (!reader.IsDBNull(16)) 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; return item;

@ -487,7 +487,7 @@ namespace MediaBrowser.Server.Startup.Common
var connectionManager = new ConnectionManager(dlnaManager, ServerConfigurationManager, LogManager.GetLogger("UpnpConnectionManager"), HttpClient); var connectionManager = new ConnectionManager(dlnaManager, ServerConfigurationManager, LogManager.GetLogger("UpnpConnectionManager"), HttpClient);
RegisterSingleInstance<IConnectionManager>(connectionManager); RegisterSingleInstance<IConnectionManager>(connectionManager);
CollectionManager = new CollectionManager(LibraryManager, FileSystemManager, LibraryMonitor, LogManager.GetLogger("CollectionManager")); CollectionManager = new CollectionManager(LibraryManager, FileSystemManager, LibraryMonitor, LogManager.GetLogger("CollectionManager"), ProviderManager);
RegisterSingleInstance(CollectionManager); RegisterSingleInstance(CollectionManager);
PlaylistManager = new PlaylistManager(LibraryManager, FileSystemManager, LibraryMonitor, LogManager.GetLogger("PlaylistManager"), UserManager, ProviderManager); PlaylistManager = new PlaylistManager(LibraryManager, FileSystemManager, LibraryMonitor, LogManager.GetLogger("PlaylistManager"), UserManager, ProviderManager);

@ -459,9 +459,6 @@
<Content Include="dashboard-ui\thirdparty\paper-button-style.css"> <Content Include="dashboard-ui\thirdparty\paper-button-style.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="dashboard-ui\thirdparty\paper-ie10.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\thirdparty\social-share-kit-1.0.4\.gitignore" /> <Content Include="dashboard-ui\thirdparty\social-share-kit-1.0.4\.gitignore" />
<Content Include="dashboard-ui\thirdparty\social-share-kit-1.0.4\dist\css\social-share-kit.css"> <Content Include="dashboard-ui\thirdparty\social-share-kit-1.0.4\dist\css\social-share-kit.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>

Loading…
Cancel
Save