resolve moviedb issues

pull/702/head
Luke Pulverenti 10 years ago
parent 28d4c54de8
commit 4999f19485

@ -1718,7 +1718,7 @@ namespace MediaBrowser.Api.Playback
string mediaSourceId,
CancellationToken cancellationToken)
{
var channelMediaSources = await ChannelManager.GetChannelItemMediaSources(id, cancellationToken)
var channelMediaSources = await ChannelManager.GetChannelItemMediaSources(id, true, cancellationToken)
.ConfigureAwait(false);
var list = channelMediaSources.ToList();

@ -344,7 +344,7 @@ namespace MediaBrowser.Api
// This must be the last filter
if (!string.IsNullOrEmpty(request.AdjacentTo))
{
seasons = ItemsService.FilterForAdjacency(seasons, request.AdjacentTo)
seasons = UserViewBuilder.FilterForAdjacency(seasons, request.AdjacentTo)
.Cast<Season>();
}
@ -434,7 +434,7 @@ namespace MediaBrowser.Api
// This must be the last filter
if (!string.IsNullOrEmpty(request.AdjacentTo))
{
episodes = ItemsService.FilterForAdjacency(episodes, request.AdjacentTo)
episodes = UserViewBuilder.FilterForAdjacency(episodes, request.AdjacentTo)
.Cast<Episode>();
}

@ -188,7 +188,7 @@ namespace MediaBrowser.Api.UserLibrary
var imageTypes = request.GetImageTypes().ToList();
if (imageTypes.Count > 0)
{
items = items.Where(item => imageTypes.Any(imageType => ItemsService.HasImage(item, imageType)));
items = items.Where(item => imageTypes.Any(item.HasImage));
}
var filters = request.GetFilters().ToList();

File diff suppressed because it is too large Load Diff

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

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

@ -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.

@ -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.

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

@ -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[] { };
}
}
}

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

@ -91,6 +91,13 @@ namespace MediaBrowser.Model.Dlna
throw new ArgumentNullException(baseUrl);
}
if (IsDirectStream && MediaSource != null && MediaSource.Protocol == MediaProtocol.Http)
{
if (MediaSource.RequiredHttpHeaders.Count == 0)
{
}
}
string dlnaCommand = BuildDlnaParam(this);
string extension = string.IsNullOrEmpty(Container) ? string.Empty : "." + Container;

@ -273,13 +273,17 @@ namespace MediaBrowser.Providers.Movies
languages.Add("en");
}
var firstLetter = string.IsNullOrWhiteSpace(preferredLanguage)
? string.Empty
: preferredLanguage.Substring(0, 1);
var allLanguages = localization.GetCultures()
.Select(i => i.TwoLetterISOLanguageName)
.Distinct(StringComparer.OrdinalIgnoreCase)
.Where(i => !languages.Contains(i, StringComparer.OrdinalIgnoreCase))
.Where(i => !languages.Contains(i, StringComparer.OrdinalIgnoreCase) && i.StartsWith(firstLetter, StringComparison.OrdinalIgnoreCase))
.ToList();
languages.AddRange(allLanguages);
//languages.AddRange(allLanguages);
return string.Join(",", languages.ToArray());
}

@ -212,12 +212,10 @@ namespace MediaBrowser.Server.Implementations.Channels
}
var itemId = item.Id.ToString("N");
var sources = await _manager.GetChannelItemMediaSources(itemId, cancellationToken)
var sources = await _manager.GetChannelItemMediaSources(itemId, false, cancellationToken)
.ConfigureAwait(false);
var list = sources.ToList();
var cachedVersions = list.Where(i => i.Protocol == MediaProtocol.File).ToList();
var cachedVersions = sources.Where(i => i.Protocol == MediaProtocol.File).ToList();
if (cachedVersions.Count > 0)
{
@ -225,13 +223,6 @@ namespace MediaBrowser.Server.Implementations.Channels
return;
}
var source = list.FirstOrDefault(i => i.Protocol == MediaProtocol.Http);
if (source == null)
{
return;
}
var channelItem = (IChannelMediaItem)item;
var destination = Path.Combine(path, channelItem.ChannelId, itemId);

@ -244,7 +244,7 @@ namespace MediaBrowser.Server.Implementations.Channels
return item;
}
public async Task<IEnumerable<MediaSourceInfo>> GetChannelItemMediaSources(string id, CancellationToken cancellationToken)
public async Task<IEnumerable<MediaSourceInfo>> GetChannelItemMediaSources(string id, bool includeDynamicSources, CancellationToken cancellationToken)
{
var item = (IChannelMediaItem)_libraryManager.GetItemById(id);
@ -255,7 +255,7 @@ namespace MediaBrowser.Server.Implementations.Channels
IEnumerable<ChannelMediaInfo> results;
if (requiresCallback != null)
if (requiresCallback != null && includeDynamicSources)
{
results = await GetChannelItemMediaSourcesInternal(requiresCallback, item.ExternalId, cancellationToken)
.ConfigureAwait(false);
@ -374,6 +374,18 @@ namespace MediaBrowser.Server.Implementations.Channels
Id = id
};
var bitrate = (info.AudioBitrate ?? 0) + (info.VideoBitrate ?? 0);
if (bitrate > 0)
{
source.Bitrate = bitrate;
}
if (item is ChannelVideoItem && info.Protocol != MediaProtocol.Rtmp)
{
}
return source;
}
@ -1447,7 +1459,7 @@ namespace MediaBrowser.Server.Implementations.Channels
IProgress<double> progress, CancellationToken cancellationToken)
{
var itemId = item.Id.ToString("N");
var sources = await GetChannelItemMediaSources(itemId, cancellationToken)
var sources = await GetChannelItemMediaSources(itemId, true, cancellationToken)
.ConfigureAwait(false);
var list = sources.Where(i => i.Protocol == MediaProtocol.Http).ToList();

@ -519,7 +519,7 @@
"MediaInfoLongitude": "L\u00e4nge",
"MediaInfoShutterSpeed": "Verschlusszeit",
"MediaInfoSoftware": "Software",
"HeaderIfYouLikeCheckTheseOut": "Wenn du {0} magst, schau dir einmal diese an...",
"HeaderIfYouLikeCheckTheseOut": "Wenn du {0} magst, schau dir einmal das an...",
"HeaderPlotKeywords": "Handlungsstichworte",
"HeaderMovies": "Filme",
"HeaderAlbums": "Alben",

@ -469,7 +469,7 @@
"LabelResumePoint": "Point de reprise",
"ValueOneMovie": "1 Film",
"ValueMovieCount": "{0} films",
"ValueOneTrailer": "1 Bande Annonce",
"ValueOneTrailer": "1 bande-annonce",
"ValueTrailerCount": "{0} bandes-annonces",
"ValueOneSeries": "1 S\u00e9rie",
"ValueSeriesCount": "{0} series",

@ -1020,7 +1020,7 @@
"LabelChannelDownloadPathHelp": "Sp\u00e9cifiez un chemin de t\u00e9l\u00e9chargements personnalis\u00e9 si besoin. Laissez vide pour t\u00e9l\u00e9charger dans un r\u00e9pertoire interne du programme.",
"LabelChannelDownloadAge": "Supprimer le contenu apr\u00e8s : (jours)",
"LabelChannelDownloadAgeHelp": "Le contenu t\u00e9l\u00e9charg\u00e9 plus vieux sera supprim\u00e9. Par contre, il sera toujours disponible par flux Internet (en ligne).",
"ChannelSettingsFormHelp": "Installer des cha\u00eenes comme \"Trailers\" and \"Vimeo\" par le catalogue de Plugins.",
"ChannelSettingsFormHelp": "Installer des cha\u00eenes comme \"Trailers\" et \"Vimeo\" dans le catalogue des plugins.",
"LabelSelectCollection": "S\u00e9lectionner la collection :",
"ButtonOptions": "Options",
"ViewTypeMovies": "Films",

@ -845,43 +845,43 @@
"OptionSpecialFeatures": "Specijalne opcije",
"HeaderCollections": "Kolekcije",
"LabelProfileCodecsHelp": "Odvojeno sa to\u010dka-zrezom. Ovo mo\u017ee ostaviti prazno kao bi bilo postavljeno za sve codecs.",
"LabelProfileContainersHelp": "Separated by comma. This can be left empty to apply to all containers.",
"HeaderResponseProfile": "Response Profile",
"LabelType": "Type:",
"LabelProfileContainersHelp": "Odvojeno sa to\u010dka-zrezom. Ovo mo\u017ee ostaviti prazno kao bi bilo postavljeno za sve spremnike.",
"HeaderResponseProfile": "Profil odziva",
"LabelType": "Tip:",
"LabelPersonRole": "Role:",
"LabelPersonRoleHelp": "Role is generally only applicable to actors.",
"LabelProfileContainer": "Container:",
"LabelProfileVideoCodecs": "Video codecs:",
"LabelProfileAudioCodecs": "Audio codecs:",
"LabelProfileCodecs": "Codecs:",
"HeaderDirectPlayProfile": "Direct Play Profile",
"HeaderTranscodingProfile": "Transcoding Profile",
"HeaderCodecProfile": "Codec Profile",
"HeaderCodecProfileHelp": "Codec profiles indicate the limitations of a device when playing specific codecs. If a limitation applies then the media will be transcoded, even if the codec is configured for direct play.",
"HeaderContainerProfile": "Container Profile",
"HeaderContainerProfileHelp": "Container profiles indicate the limitations of a device when playing specific formats. If a limitation applies then the media will be transcoded, even if the format is configured for direct play.",
"LabelProfileContainer": "Spremnik:",
"LabelProfileVideoCodecs": "Video kodek:",
"LabelProfileAudioCodecs": "Audio kodek:",
"LabelProfileCodecs": "Kodeki:",
"HeaderDirectPlayProfile": "Profil za direktnu reprodukciju",
"HeaderTranscodingProfile": "Profil transkodiranja",
"HeaderCodecProfile": "Profil kodeka",
"HeaderCodecProfileHelp": "Profili kodeka definiraju ograni\u010denja kada ure\u0111aji izvode sadr\u017eaj u specifi\u010dnom kodeku. Ako se ograni\u010denja podudaraju tada \u0107e sadr\u017eaj biti transkodiran, iako je kodek konfiguriran za direktno izvo\u0111enje.",
"HeaderContainerProfile": "Profil spremnika",
"HeaderContainerProfileHelp": "Profil spremnika definira ograni\u010denja za ure\u0111aje kada izvode specifi\u010dne formate. Ako se ograni\u010denja podudaraju tada \u0107e sadr\u017eaj biti transkodiran, iako je format konfiguriran za direktno izvo\u0111enje.",
"OptionProfileVideo": "Video",
"OptionProfileAudio": "Audio",
"OptionProfileVideoAudio": "Video Audio",
"OptionProfilePhoto": "Photo",
"LabelUserLibrary": "User library:",
"LabelUserLibraryHelp": "Select which user library to display to the device. Leave empty to inherit the default setting.",
"OptionPlainStorageFolders": "Display all folders as plain storage folders",
"OptionPlainStorageFoldersHelp": "If enabled, all folders are represented in DIDL as \"object.container.storageFolder\" instead of a more specific type, such as \"object.container.person.musicArtist\".",
"OptionPlainVideoItems": "Display all videos as plain video items",
"OptionPlainVideoItemsHelp": "If enabled, all videos are represented in DIDL as \"object.item.videoItem\" instead of a more specific type, such as \"object.item.videoItem.movie\".",
"LabelSupportedMediaTypes": "Supported Media Types:",
"TabIdentification": "Identification",
"OptionProfilePhoto": "Slika",
"LabelUserLibrary": "Korisni\u010dka biblioteka:",
"LabelUserLibraryHelp": "Odaberite koju korisni\u010dku biblioteku \u0107e te prikazati ure\u0111aju. Ostavite prazno ako \u017eelite preuzeti definirane postavke.",
"OptionPlainStorageFolders": "Prika\u017ei sve mape kako jednostavne mape za skladi\u0161tenje",
"OptionPlainStorageFoldersHelp": "Ako je omogu\u0107eno, sve mape se prezentiraju u DIDL-u kao \"objekt.spremnik.skladi\u0161naMapa\" umjesto vi\u0161e specijaliziranog tipa kao \"objekt.spremnik.osoba.glazbaIzvo\u0111a\u010d\".",
"OptionPlainVideoItems": "Prika\u017ei sav video kao jednostavne video stavke.",
"OptionPlainVideoItemsHelp": "Ako je omogu\u0107eno, sav video se prezentira u DIDL-u kao \"objekt.stavka.videoStavka\" umjesto vi\u0161e specijaliziranog tipa kao \"objekt.stavka.videoStavka.film\".",
"LabelSupportedMediaTypes": "Podr\u017eani tipovi medija:",
"TabIdentification": "Identifikacija",
"HeaderIdentification": "Identification",
"TabDirectPlay": "Direct Play",
"TabContainers": "Containers",
"TabCodecs": "Codecs",
"TabResponses": "Responses",
"HeaderProfileInformation": "Profile Information",
"LabelEmbedAlbumArtDidl": "Embed album art in Didl",
"LabelEmbedAlbumArtDidlHelp": "Some devices prefer this method for obtaining album art. Others may fail to play with this option enabled.",
"LabelAlbumArtPN": "Album art PN:",
"LabelAlbumArtHelp": "PN used for album art, within the dlna:profileID attribute on upnp:albumArtURI. Some clients require a specific value, regardless of the size of the image.",
"TabDirectPlay": "Direktna reprodukcija",
"TabContainers": "Spremnik",
"TabCodecs": "Kodek",
"TabResponses": "Odazivi",
"HeaderProfileInformation": "Informacija profila",
"LabelEmbedAlbumArtDidl": "Ugradi grafike albuma u Didl",
"LabelEmbedAlbumArtDidlHelp": "Neki ure\u0111aji podr\u017eavaju ovu metodu za prikaz grafike albuma. Drugi bi mogli imati problema sa ovom opcijom uklju\u010denom.",
"LabelAlbumArtPN": "Grafika albuma PN:",
"LabelAlbumArtHelp": "PN se koristi za grafiku albuma sa dlna:profilID atributom na upnp:albumGrafikaURI. Neki klijenti zahtijevaju specifi\u010dnu vrijednost bez obzira na veli\u010dinu slike.",
"LabelAlbumArtMaxWidth": "Album art max width:",
"LabelAlbumArtMaxWidthHelp": "Max resolution of album art exposed via upnp:albumArtURI.",
"LabelAlbumArtMaxHeight": "Album art max height:",

@ -218,6 +218,7 @@ namespace MediaBrowser.ServerApplication
private IAuthenticationRepository AuthenticationRepository { get; set; }
private ISyncRepository SyncRepository { get; set; }
private ITVSeriesManager TVSeriesManager { get; set; }
private ICollectionManager CollectionManager { get; set; }
private readonly StartupOptions _startupOptions;
private readonly string _remotePackageName;
@ -494,8 +495,8 @@ namespace MediaBrowser.ServerApplication
var connectionManager = new ConnectionManager(dlnaManager, ServerConfigurationManager, LogManager.GetLogger("UpnpConnectionManager"), HttpClient);
RegisterSingleInstance<IConnectionManager>(connectionManager);
var collectionManager = new CollectionManager(LibraryManager, FileSystemManager, LibraryMonitor, LogManager.GetLogger("CollectionManager"));
RegisterSingleInstance<ICollectionManager>(collectionManager);
CollectionManager = new CollectionManager(LibraryManager, FileSystemManager, LibraryMonitor, LogManager.GetLogger("CollectionManager"));
RegisterSingleInstance(CollectionManager);
var playlistManager = new PlaylistManager(LibraryManager, FileSystemManager, LibraryMonitor, LogManager.GetLogger("PlaylistManager"), UserManager);
RegisterSingleInstance<IPlaylistManager>(playlistManager);
@ -700,6 +701,7 @@ namespace MediaBrowser.ServerApplication
BaseItem.LiveTvManager = LiveTvManager;
Folder.UserViewManager = UserViewManager;
UserView.TVSeriesManager = TVSeriesManager;
BaseItem.CollectionManager = CollectionManager;
}
/// <summary>

Loading…
Cancel
Save