move tv data

This commit is contained in:
Luke Pulverenti 2015-09-29 12:29:06 -04:00
parent 0d6580baf3
commit 6e222eaaf4
10 changed files with 53 additions and 43 deletions

View File

@ -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; }
}
}

View File

@ -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; }
/// <summary>
/// Gets the user data key.

View File

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

View File

@ -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; }
/// <summary>
/// Gets the user data key.

View File

@ -1110,12 +1110,6 @@ namespace MediaBrowser.Model.Dto
/// </summary>
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>
/// Gets or sets the completion percentage.
/// </summary>

View File

@ -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<CollectionCreatedEventArgs> CollectionCreated;
public event EventHandler<CollectionModifiedEventArgs> ItemsAddedToCollection;
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;
_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
{

View File

@ -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()

View File

@ -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;
/// <summary>
/// Initializes a new instance of the <see cref="SqliteItemRepository"/> 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;

View File

@ -487,7 +487,7 @@ namespace MediaBrowser.Server.Startup.Common
var connectionManager = new ConnectionManager(dlnaManager, ServerConfigurationManager, LogManager.GetLogger("UpnpConnectionManager"), HttpClient);
RegisterSingleInstance<IConnectionManager>(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);

View File

@ -459,9 +459,6 @@
<Content Include="dashboard-ui\thirdparty\paper-button-style.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</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\dist\css\social-share-kit.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>