commit
d803b55f4d
|
@ -1058,18 +1058,8 @@ namespace Emby.Server.Implementations.Dto
|
||||||
dto.CommunityRating = item.CommunityRating;
|
dto.CommunityRating = item.CommunityRating;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (item.IsFolder)
|
|
||||||
//{
|
|
||||||
// var folder = (Folder)item;
|
|
||||||
|
|
||||||
// if (fields.Contains(ItemFields.IndexOptions))
|
|
||||||
// {
|
|
||||||
// dto.IndexOptions = folder.IndexByOptionStrings.ToArray();
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
var supportsPlaceHolders = item as ISupportsPlaceHolders;
|
var supportsPlaceHolders = item as ISupportsPlaceHolders;
|
||||||
if (supportsPlaceHolders != null)
|
if (supportsPlaceHolders != null && supportsPlaceHolders.IsPlaceHolder)
|
||||||
{
|
{
|
||||||
dto.IsPlaceHolder = supportsPlaceHolders.IsPlaceHolder;
|
dto.IsPlaceHolder = supportsPlaceHolders.IsPlaceHolder;
|
||||||
}
|
}
|
||||||
|
|
|
@ -174,7 +174,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
|
||||||
var imagesWithText = allImages.Where(i => string.Equals(i.text, "yes", StringComparison.OrdinalIgnoreCase)).ToList();
|
var imagesWithText = allImages.Where(i => string.Equals(i.text, "yes", StringComparison.OrdinalIgnoreCase)).ToList();
|
||||||
var imagesWithoutText = allImages.Where(i => string.Equals(i.text, "no", StringComparison.OrdinalIgnoreCase)).ToList();
|
var imagesWithoutText = allImages.Where(i => string.Equals(i.text, "no", StringComparison.OrdinalIgnoreCase)).ToList();
|
||||||
|
|
||||||
double desiredAspect = IsMovie(programEntry) ? 0.666666667 : wideAspect;
|
double desiredAspect = 0.666666667;
|
||||||
|
|
||||||
programEntry.primaryImage = GetProgramImage(ApiUrl, imagesWithText, true, desiredAspect) ??
|
programEntry.primaryImage = GetProgramImage(ApiUrl, imagesWithText, true, desiredAspect) ??
|
||||||
GetProgramImage(ApiUrl, allImages, true, desiredAspect);
|
GetProgramImage(ApiUrl, allImages, true, desiredAspect);
|
||||||
|
|
|
@ -742,7 +742,7 @@ namespace Emby.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 + "4";
|
var etag = info.Etag + "5";
|
||||||
|
|
||||||
if (!string.Equals(etag, item.ExternalEtag, StringComparison.OrdinalIgnoreCase))
|
if (!string.Equals(etag, item.ExternalEtag, StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
|
@ -1422,6 +1422,8 @@ namespace Emby.Server.Implementations.LiveTv
|
||||||
await _libraryManager.UpdateItem(program, ItemUpdateType.MetadataImport, cancellationToken).ConfigureAwait(false);
|
await _libraryManager.UpdateItem(program, ItemUpdateType.MetadataImport, cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(service is EmbyTV.EmbyTV))
|
||||||
|
{
|
||||||
foreach (var program in newPrograms)
|
foreach (var program in newPrograms)
|
||||||
{
|
{
|
||||||
_providerManager.QueueRefresh(program.Id, new MetadataRefreshOptions(_fileSystem), RefreshPriority.Low);
|
_providerManager.QueueRefresh(program.Id, new MetadataRefreshOptions(_fileSystem), RefreshPriority.Low);
|
||||||
|
@ -1430,6 +1432,7 @@ namespace Emby.Server.Implementations.LiveTv
|
||||||
{
|
{
|
||||||
_providerManager.QueueRefresh(program.Id, new MetadataRefreshOptions(_fileSystem), RefreshPriority.Low);
|
_providerManager.QueueRefresh(program.Id, new MetadataRefreshOptions(_fileSystem), RefreshPriority.Low);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
currentChannel.IsMovie = isMovie;
|
currentChannel.IsMovie = isMovie;
|
||||||
currentChannel.IsNews = isNews;
|
currentChannel.IsNews = isNews;
|
||||||
|
|
|
@ -1671,7 +1671,6 @@ namespace Emby.Server.Implementations.Session
|
||||||
dtoOptions.Fields.Remove(ItemFields.DisplayPreferencesId);
|
dtoOptions.Fields.Remove(ItemFields.DisplayPreferencesId);
|
||||||
dtoOptions.Fields.Remove(ItemFields.Etag);
|
dtoOptions.Fields.Remove(ItemFields.Etag);
|
||||||
dtoOptions.Fields.Remove(ItemFields.ExternalEtag);
|
dtoOptions.Fields.Remove(ItemFields.ExternalEtag);
|
||||||
dtoOptions.Fields.Remove(ItemFields.IndexOptions);
|
|
||||||
dtoOptions.Fields.Remove(ItemFields.InheritedParentalRatingValue);
|
dtoOptions.Fields.Remove(ItemFields.InheritedParentalRatingValue);
|
||||||
dtoOptions.Fields.Remove(ItemFields.ItemCounts);
|
dtoOptions.Fields.Remove(ItemFields.ItemCounts);
|
||||||
dtoOptions.Fields.Remove(ItemFields.Keywords);
|
dtoOptions.Fields.Remove(ItemFields.Keywords);
|
||||||
|
|
|
@ -211,33 +211,6 @@ namespace MediaBrowser.Controller.Entities
|
||||||
item.SetParent(null);
|
item.SetParent(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns the valid set of index by options for this folder type.
|
|
||||||
/// Override or extend to modify.
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>Dictionary{System.StringFunc{UserIEnumerable{BaseItem}}}.</returns>
|
|
||||||
protected virtual IEnumerable<string> GetIndexByOptions()
|
|
||||||
{
|
|
||||||
return new List<string> {
|
|
||||||
{"None"},
|
|
||||||
{"Performer"},
|
|
||||||
{"Genre"},
|
|
||||||
{"Director"},
|
|
||||||
{"Year"},
|
|
||||||
{"Studio"}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Get the list of indexy by choices for this folder (localized).
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The index by option strings.</value>
|
|
||||||
[IgnoreDataMember]
|
|
||||||
public IEnumerable<string> IndexByOptionStrings
|
|
||||||
{
|
|
||||||
get { return GetIndexByOptions(); }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the actual children.
|
/// Gets the actual children.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -66,17 +66,6 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
return series == null ? SeriesName : series.SortName;
|
return series == null ? SeriesName : series.SortName;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Genre, Rating and Stuido will all be the same
|
|
||||||
protected override IEnumerable<string> GetIndexByOptions()
|
|
||||||
{
|
|
||||||
return new List<string> {
|
|
||||||
{"None"},
|
|
||||||
{"Performer"},
|
|
||||||
{"Director"},
|
|
||||||
{"Year"},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public override List<string> GetUserDataKeys()
|
public override List<string> GetUserDataKeys()
|
||||||
{
|
{
|
||||||
var list = base.GetUserDataKeys();
|
var list = base.GetUserDataKeys();
|
||||||
|
|
|
@ -227,17 +227,6 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Studio, Genre and Rating will all be the same so makes no sense to index by these
|
|
||||||
protected override IEnumerable<string> GetIndexByOptions()
|
|
||||||
{
|
|
||||||
return new List<string> {
|
|
||||||
{"None"},
|
|
||||||
{"Performer"},
|
|
||||||
{"Director"},
|
|
||||||
{"Year"},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
public bool ContainsEpisodesWithoutSeasonFolders
|
public bool ContainsEpisodesWithoutSeasonFolders
|
||||||
{
|
{
|
||||||
|
|
|
@ -57,8 +57,13 @@ namespace MediaBrowser.Controller.LiveTv
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
double value = 2;
|
||||||
|
value /= 3;
|
||||||
|
|
||||||
return null;
|
return value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
|
|
|
@ -42,6 +42,11 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
{
|
{
|
||||||
var hwType = encodingOptions.HardwareAccelerationType;
|
var hwType = encodingOptions.HardwareAccelerationType;
|
||||||
|
|
||||||
|
if (!encodingOptions.EnableHardwareEncoding)
|
||||||
|
{
|
||||||
|
hwType = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (string.Equals(hwType, "qsv", StringComparison.OrdinalIgnoreCase) ||
|
if (string.Equals(hwType, "qsv", StringComparison.OrdinalIgnoreCase) ||
|
||||||
string.Equals(hwType, "h264_qsv", StringComparison.OrdinalIgnoreCase))
|
string.Equals(hwType, "h264_qsv", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
|
@ -1761,14 +1766,11 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state.VideoStream != null && !string.IsNullOrWhiteSpace(state.VideoStream.Codec))
|
if (state.VideoStream != null &&
|
||||||
|
!string.IsNullOrWhiteSpace(state.VideoStream.Codec) &&
|
||||||
|
!string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType) &&
|
||||||
|
encodingOptions.EnableHardwareDecoding)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType))
|
|
||||||
{
|
|
||||||
// causing unpredictable results
|
|
||||||
//return "-hwaccel auto";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (string.Equals(encodingOptions.HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(encodingOptions.HardwareAccelerationType, "qsv", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
switch (state.MediaSource.VideoStream.Codec.ToLower())
|
switch (state.MediaSource.VideoStream.Codec.ToLower())
|
||||||
|
@ -1818,6 +1820,13 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
return "-c:v h264_cuvid ";
|
return "-c:v h264_cuvid ";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "hevc":
|
||||||
|
case "h265":
|
||||||
|
if (_mediaEncoder.SupportsDecoder("hevc_cuvid"))
|
||||||
|
{
|
||||||
|
return "-c:v hevc_cuvid ";
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,8 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
||||||
"hevc_qsv",
|
"hevc_qsv",
|
||||||
"mpeg2_qsv",
|
"mpeg2_qsv",
|
||||||
"vc1_qsv",
|
"vc1_qsv",
|
||||||
"h264_cuvid"
|
"h264_cuvid",
|
||||||
|
"hevc_cuvid"
|
||||||
};
|
};
|
||||||
|
|
||||||
foreach (var codec in required)
|
foreach (var codec in required)
|
||||||
|
|
|
@ -13,6 +13,8 @@ namespace MediaBrowser.Model.Configuration
|
||||||
public string VaapiDevice { get; set; }
|
public string VaapiDevice { get; set; }
|
||||||
public int H264Crf { get; set; }
|
public int H264Crf { get; set; }
|
||||||
public string H264Preset { get; set; }
|
public string H264Preset { get; set; }
|
||||||
|
public bool EnableHardwareDecoding { get; set; }
|
||||||
|
public bool EnableHardwareEncoding { get; set; }
|
||||||
|
|
||||||
public EncodingOptions()
|
public EncodingOptions()
|
||||||
{
|
{
|
||||||
|
@ -22,6 +24,8 @@ namespace MediaBrowser.Model.Configuration
|
||||||
EncodingThreadCount = -1;
|
EncodingThreadCount = -1;
|
||||||
VaapiDevice = "/dev/dri/card0";
|
VaapiDevice = "/dev/dri/card0";
|
||||||
H264Crf = 23;
|
H264Crf = 23;
|
||||||
|
EnableHardwareDecoding = true;
|
||||||
|
EnableHardwareEncoding = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,11 +87,6 @@
|
||||||
/// </summary>
|
/// </summary>
|
||||||
HomePageUrl,
|
HomePageUrl,
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The fields that the server supports indexing on
|
|
||||||
/// </summary>
|
|
||||||
IndexOptions,
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The item counts
|
/// The item counts
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -72,7 +72,6 @@
|
||||||
<Compile Include="MediaInfo\SubtitleDownloader.cs" />
|
<Compile Include="MediaInfo\SubtitleDownloader.cs" />
|
||||||
<Compile Include="MediaInfo\SubtitleResolver.cs" />
|
<Compile Include="MediaInfo\SubtitleResolver.cs" />
|
||||||
<Compile Include="MediaInfo\SubtitleScheduledTask.cs" />
|
<Compile Include="MediaInfo\SubtitleScheduledTask.cs" />
|
||||||
<Compile Include="Movies\LiveTvMovieDbProvider.cs" />
|
|
||||||
<Compile Include="Movies\MovieDbTrailerProvider.cs" />
|
<Compile Include="Movies\MovieDbTrailerProvider.cs" />
|
||||||
<Compile Include="Movies\MovieExternalIds.cs" />
|
<Compile Include="Movies\MovieExternalIds.cs" />
|
||||||
<Compile Include="Movies\GenericMovieDbInfo.cs" />
|
<Compile Include="Movies\GenericMovieDbInfo.cs" />
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
using MediaBrowser.Common.Net;
|
|
||||||
using MediaBrowser.Controller.LiveTv;
|
|
||||||
using MediaBrowser.Controller.Providers;
|
|
||||||
using MediaBrowser.Model.Providers;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace MediaBrowser.Providers.Movies
|
|
||||||
{
|
|
||||||
public class LiveTvMovieDbProvider : IRemoteMetadataProvider<LiveTvProgram, LiveTvProgramLookupInfo>, IHasOrder
|
|
||||||
{
|
|
||||||
public Task<IEnumerable<RemoteSearchResult>> GetSearchResults(LiveTvProgramLookupInfo searchInfo, CancellationToken cancellationToken)
|
|
||||||
{
|
|
||||||
return MovieDbProvider.Current.GetMovieSearchResults(searchInfo, cancellationToken);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Task<MetadataResult<LiveTvProgram>> GetMetadata(LiveTvProgramLookupInfo info, CancellationToken cancellationToken)
|
|
||||||
{
|
|
||||||
return MovieDbProvider.Current.GetItemMetadata<LiveTvProgram>(info, cancellationToken);
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Name
|
|
||||||
{
|
|
||||||
get { return "LiveTvMovieDbProvider"; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public Task<HttpResponseInfo> GetImageResponse(string url, CancellationToken cancellationToken)
|
|
||||||
{
|
|
||||||
return MovieDbProvider.Current.GetImageResponse(url, cancellationToken);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int Order
|
|
||||||
{
|
|
||||||
get { return 1; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -43,13 +43,6 @@ namespace MediaBrowser.Providers.Movies
|
||||||
|
|
||||||
public bool Supports(IHasImages item)
|
public bool Supports(IHasImages item)
|
||||||
{
|
{
|
||||||
// Supports images for tv movies
|
|
||||||
var tvProgram = item as LiveTvProgram;
|
|
||||||
if (tvProgram != null && tvProgram.IsMovie)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return item is Movie || item is MusicVideo || item is Trailer;
|
return item is Movie || item is MusicVideo || item is Trailer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,13 +93,6 @@ namespace MediaBrowser.Providers.Omdb
|
||||||
|
|
||||||
public bool Supports(IHasImages item)
|
public bool Supports(IHasImages item)
|
||||||
{
|
{
|
||||||
// Supports images for tv movies
|
|
||||||
var tvProgram = item as LiveTvProgram;
|
|
||||||
if (tvProgram != null && tvProgram.IsMovie)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return item is Movie || item is Trailer || item is Episode;
|
return item is Movie || item is Trailer || item is Episode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ using System.Threading.Tasks;
|
||||||
namespace MediaBrowser.Providers.Omdb
|
namespace MediaBrowser.Providers.Omdb
|
||||||
{
|
{
|
||||||
public class OmdbItemProvider : IRemoteMetadataProvider<Series, SeriesInfo>,
|
public class OmdbItemProvider : IRemoteMetadataProvider<Series, SeriesInfo>,
|
||||||
IRemoteMetadataProvider<Movie, MovieInfo>, IRemoteMetadataProvider<Trailer, TrailerInfo>, IRemoteMetadataProvider<LiveTvProgram, LiveTvProgramLookupInfo>
|
IRemoteMetadataProvider<Movie, MovieInfo>, IRemoteMetadataProvider<Trailer, TrailerInfo>
|
||||||
{
|
{
|
||||||
private readonly IJsonSerializer _jsonSerializer;
|
private readonly IJsonSerializer _jsonSerializer;
|
||||||
private readonly IHttpClient _httpClient;
|
private readonly IHttpClient _httpClient;
|
||||||
|
@ -51,16 +51,6 @@ namespace MediaBrowser.Providers.Omdb
|
||||||
return GetSearchResults(searchInfo, "movie", cancellationToken);
|
return GetSearchResults(searchInfo, "movie", cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task<IEnumerable<RemoteSearchResult>> GetSearchResults(LiveTvProgramLookupInfo searchInfo, CancellationToken cancellationToken)
|
|
||||||
{
|
|
||||||
if (!searchInfo.IsMovie)
|
|
||||||
{
|
|
||||||
return Task.FromResult<IEnumerable<RemoteSearchResult>>(new List<RemoteSearchResult>());
|
|
||||||
}
|
|
||||||
|
|
||||||
return GetSearchResults(searchInfo, "movie", cancellationToken);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Task<IEnumerable<RemoteSearchResult>> GetSearchResults(ItemLookupInfo searchInfo, string type, CancellationToken cancellationToken)
|
public Task<IEnumerable<RemoteSearchResult>> GetSearchResults(ItemLookupInfo searchInfo, string type, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
return GetSearchResultsInternal(searchInfo, type, true, cancellationToken);
|
return GetSearchResultsInternal(searchInfo, type, true, cancellationToken);
|
||||||
|
@ -230,15 +220,6 @@ namespace MediaBrowser.Providers.Omdb
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task<MetadataResult<LiveTvProgram>> GetMetadata(LiveTvProgramLookupInfo info, CancellationToken cancellationToken)
|
|
||||||
{
|
|
||||||
if (!info.IsMovie)
|
|
||||||
{
|
|
||||||
return Task.FromResult(new MetadataResult<LiveTvProgram>());
|
|
||||||
}
|
|
||||||
return GetMovieResult<LiveTvProgram>(info, cancellationToken);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Task<MetadataResult<Movie>> GetMetadata(MovieInfo info, CancellationToken cancellationToken)
|
public Task<MetadataResult<Movie>> GetMetadata(MovieInfo info, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
return GetMovieResult<Movie>(info, cancellationToken);
|
return GetMovieResult<Movie>(info, cancellationToken);
|
||||||
|
|
|
@ -107,7 +107,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
||||||
/// <param name="metadataFile">The metadata file.</param>
|
/// <param name="metadataFile">The metadata file.</param>
|
||||||
/// <param name="settings">The settings.</param>
|
/// <param name="settings">The settings.</param>
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
private void Fetch(MetadataResult<T> item, string metadataFile, XmlReaderSettings settings, CancellationToken cancellationToken)
|
protected virtual void Fetch(MetadataResult<T> item, string metadataFile, XmlReaderSettings settings, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
if (!SupportsUrlAfterClosingXmlTag)
|
if (!SupportsUrlAfterClosingXmlTag)
|
||||||
{
|
{
|
||||||
|
@ -233,7 +233,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
||||||
get { return "themoviedb.org/movie/"; }
|
get { return "themoviedb.org/movie/"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ParseProviderLinks(T item, string xml)
|
protected void ParseProviderLinks(T item, string xml)
|
||||||
{
|
{
|
||||||
//Look for a match for the Regex pattern "tt" followed by 7 digits
|
//Look for a match for the Regex pattern "tt" followed by 7 digits
|
||||||
Match m = Regex.Match(xml, @"tt([0-9]{7})", RegexOptions.IgnoreCase);
|
Match m = Regex.Match(xml, @"tt([0-9]{7})", RegexOptions.IgnoreCase);
|
||||||
|
|
|
@ -9,6 +9,8 @@ using System.Threading;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using MediaBrowser.Model.IO;
|
using MediaBrowser.Model.IO;
|
||||||
using MediaBrowser.Model.Xml;
|
using MediaBrowser.Model.Xml;
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
namespace MediaBrowser.XbmcMetadata.Parsers
|
namespace MediaBrowser.XbmcMetadata.Parsers
|
||||||
{
|
{
|
||||||
|
@ -24,6 +26,65 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
||||||
|
|
||||||
private static readonly CultureInfo UsCulture = new CultureInfo("en-US");
|
private static readonly CultureInfo UsCulture = new CultureInfo("en-US");
|
||||||
|
|
||||||
|
protected override void Fetch(MetadataResult<Episode> item, string metadataFile, XmlReaderSettings settings, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
using (var fileStream = FileSystem.OpenRead(metadataFile))
|
||||||
|
{
|
||||||
|
using (var streamReader = new StreamReader(fileStream, Encoding.UTF8))
|
||||||
|
{
|
||||||
|
item.ResetPeople();
|
||||||
|
|
||||||
|
var xml = streamReader.ReadToEnd();
|
||||||
|
|
||||||
|
var srch = "</episodedetails>";
|
||||||
|
var index = xml.IndexOf(srch, StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
|
if (index != -1)
|
||||||
|
{
|
||||||
|
xml = xml.Substring(0, index + srch.Length);
|
||||||
|
}
|
||||||
|
|
||||||
|
using (var ms = new MemoryStream())
|
||||||
|
{
|
||||||
|
var bytes = Encoding.UTF8.GetBytes(xml);
|
||||||
|
|
||||||
|
ms.Write(bytes, 0, bytes.Length);
|
||||||
|
ms.Position = 0;
|
||||||
|
|
||||||
|
// These are not going to be valid xml so no sense in causing the provider to fail and spamming the log with exceptions
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// Use XmlReader for best performance
|
||||||
|
using (var reader = XmlReader.Create(ms, settings))
|
||||||
|
{
|
||||||
|
reader.MoveToContent();
|
||||||
|
reader.Read();
|
||||||
|
|
||||||
|
// Loop through each element
|
||||||
|
while (!reader.EOF && reader.ReadState == ReadState.Interactive)
|
||||||
|
{
|
||||||
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
|
if (reader.NodeType == XmlNodeType.Element)
|
||||||
|
{
|
||||||
|
FetchDataFromXmlNode(reader, item);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
reader.Read();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (XmlException)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fetches the data from XML node.
|
/// Fetches the data from XML node.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Common</id>
|
<id>MediaBrowser.Common</id>
|
||||||
<version>3.0.703</version>
|
<version>3.0.704</version>
|
||||||
<title>Emby.Common</title>
|
<title>Emby.Common</title>
|
||||||
<authors>Emby Team</authors>
|
<authors>Emby Team</authors>
|
||||||
<owners>ebr,Luke,scottisafool</owners>
|
<owners>ebr,Luke,scottisafool</owners>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Server.Core</id>
|
<id>MediaBrowser.Server.Core</id>
|
||||||
<version>3.0.703</version>
|
<version>3.0.704</version>
|
||||||
<title>Emby.Server.Core</title>
|
<title>Emby.Server.Core</title>
|
||||||
<authors>Emby Team</authors>
|
<authors>Emby Team</authors>
|
||||||
<owners>ebr,Luke,scottisafool</owners>
|
<owners>ebr,Luke,scottisafool</owners>
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
<description>Contains core components required to build plugins for Emby Server.</description>
|
<description>Contains core components required to build plugins for Emby Server.</description>
|
||||||
<copyright>Copyright © Emby 2013</copyright>
|
<copyright>Copyright © Emby 2013</copyright>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency id="MediaBrowser.Common" version="3.0.703" />
|
<dependency id="MediaBrowser.Common" version="3.0.704" />
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyVersion("3.2.20.1")]
|
[assembly: AssemblyVersion("3.2.20.2")]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user