resolve moviedb issues

This commit is contained in:
Luke Pulverenti
2014-10-07 21:37:45 -04:00
parent 28d4c54de8
commit 4999f19485
21 changed files with 1358 additions and 831 deletions

View File

@@ -1,9 +1,11 @@
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Model.Channels;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
namespace MediaBrowser.Controller.Channels
{
@@ -69,5 +71,22 @@ namespace MediaBrowser.Controller.Channels
{
return System.IO.Path.Combine(basePath, "channels", ChannelId, Id.ToString("N"));
}
public override IEnumerable<MediaSourceInfo> GetMediaSources(bool enablePathSubstitution)
{
var list = base.GetMediaSources(enablePathSubstitution).ToList();
var sources = ChannelManager.GetChannelItemMediaSources(Id.ToString("N"), false, CancellationToken.None)
.Result.ToList();
if (sources.Count > 0)
{
return sources;
}
list.InsertRange(0, sources);
return list;
}
}
}

View File

@@ -7,6 +7,7 @@ using MediaBrowser.Model.Entities;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Threading;
namespace MediaBrowser.Controller.Channels
{
@@ -90,7 +91,15 @@ namespace MediaBrowser.Controller.Channels
{
var list = base.GetMediaSources(enablePathSubstitution).ToList();
list.InsertRange(0, ChannelManager.GetCachedChannelItemMediaSources(Id.ToString("N")));
var sources = ChannelManager.GetChannelItemMediaSources(Id.ToString("N"), false, CancellationToken.None)
.Result.ToList();
if (sources.Count > 0)
{
return sources;
}
list.InsertRange(0, sources);
return list;
}

View File

@@ -109,20 +109,14 @@ namespace MediaBrowser.Controller.Channels
/// <returns>Task&lt;QueryResult&lt;BaseItem&gt;&gt;.</returns>
Task<QueryResult<BaseItem>> GetChannelItemsInternal(ChannelItemQuery query, IProgress<double> progress, CancellationToken cancellationToken);
/// <summary>
/// Gets the cached channel item media sources.
/// </summary>
/// <param name="id">The identifier.</param>
/// <returns>IEnumerable{MediaSourceInfo}.</returns>
IEnumerable<MediaSourceInfo> GetCachedChannelItemMediaSources(string id);
/// <summary>
/// Gets the channel item media sources.
/// </summary>
/// <param name="id">The identifier.</param>
/// <param name="includeDynamicSources">if set to <c>true</c> [include dynamic sources].</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{IEnumerable{MediaSourceInfo}}.</returns>
Task<IEnumerable<MediaSourceInfo>> GetChannelItemMediaSources(string id, CancellationToken cancellationToken);
Task<IEnumerable<MediaSourceInfo>> GetChannelItemMediaSources(string id, bool includeDynamicSources, CancellationToken cancellationToken);
/// <summary>
/// Gets the channel folder.

View File

@@ -1,6 +1,7 @@
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.IO;
using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Collections;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.LiveTv;
@@ -251,6 +252,7 @@ namespace MediaBrowser.Controller.Entities
public static IUserDataManager UserDataManager { get; set; }
public static ILiveTvManager LiveTvManager { get; set; }
public static IChannelManager ChannelManager { get; set; }
public static ICollectionManager CollectionManager { get; set; }
/// <summary>
/// Returns a <see cref="System.String" /> that represents this instance.

View File

@@ -785,7 +785,7 @@ namespace MediaBrowser.Controller.Entities
protected QueryResult<BaseItem> SortAndFilter(IEnumerable<BaseItem> items, InternalItemsQuery query)
{
return UserViewBuilder.SortAndFilter(items, null, query, LibraryManager, UserDataManager);
return UserViewBuilder.SortAndFilter(items, this, null, query, LibraryManager, UserDataManager);
}
/// <summary>

View File

@@ -29,6 +29,46 @@ namespace MediaBrowser.Controller.Entities
public string[] MediaTypes { get; set; }
public string[] IncludeItemTypes { get; set; }
public string[] ExcludeItemTypes { get; set; }
public string[] Genres { get; set; }
public string[] AllGenres { get; set; }
public bool? IsMissing { get; set; }
public bool? IsUnaired { get; set; }
public bool? IsVirtualUnaired { get; set; }
public bool? CollapseBoxSetItems { get; set; }
public string NameStartsWithOrGreater { get; set; }
public string NameStartsWith { get; set; }
public string NameLessThan { get; set; }
public string Person { get; set; }
public string AdjacentTo { get; set; }
public string[] PersonTypes { get; set; }
public bool? Is3D { get; set; }
public bool? IsHD { get; set; }
public bool? IsInBoxSet { get; set; }
public bool? IsLocked { get; set; }
public bool? IsUnidentified { get; set; }
public bool? IsPlaceHolder { get; set; }
public bool? IsYearMismatched { get; set; }
public bool? HasImdbId { get; set; }
public bool? HasOverview { get; set; }
public bool? HasTmdbId { get; set; }
public bool? HasOfficialRating { get; set; }
public bool? HasTvdbId { get; set; }
public bool? HasThemeSong { get; set; }
public bool? HasThemeVideo { get; set; }
public bool? HasSubtitles { get; set; }
public bool? HasSpecialFeature { get; set; }
public bool? HasTrailer { get; set; }
public bool? HasParentalRating { get; set; }
public string[] Studios { get; set; }
public ImageType[] ImageTypes { get; set; }
public VideoType[] VideoTypes { get; set; }
public int[] Years { get; set; }
public InternalItemsQuery()
{
@@ -36,6 +76,13 @@ namespace MediaBrowser.Controller.Entities
MediaTypes = new string[] { };
IncludeItemTypes = new string[] { };
ExcludeItemTypes = new string[] { };
AllGenres = new string[] { };
Genres = new string[] { };
Studios = new string[] { };
ImageTypes = new ImageType[] { };
VideoTypes = new VideoType[] { };
Years = new int[] { };
PersonTypes = new string[] { };
}
}
}

View File

@@ -17,7 +17,7 @@ namespace MediaBrowser.Controller.Entities
public override Task<QueryResult<BaseItem>> GetItems(InternalItemsQuery query)
{
return new UserViewBuilder(UserViewManager, LiveTvManager, ChannelManager, LibraryManager, Logger, UserDataManager, TVSeriesManager)
return new UserViewBuilder(UserViewManager, LiveTvManager, ChannelManager, LibraryManager, Logger, UserDataManager, TVSeriesManager, CollectionManager)
.GetUserItems(this, ViewType, query);
}

File diff suppressed because it is too large Load Diff