aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Api/Playback/BaseStreamingService.cs4
-rw-r--r--MediaBrowser.Api/StartupWizardService.cs2
-rw-r--r--MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs4
-rw-r--r--MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs8
-rw-r--r--MediaBrowser.Providers/Omdb/OmdbItemProvider.cs4
-rw-r--r--MediaBrowser.Providers/Omdb/OmdbProvider.cs68
-rw-r--r--MediaBrowser.Providers/TV/Omdb/OmdbEpisodeProvider.cs2
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs4
8 files changed, 73 insertions, 23 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index e6ac990bc..89e62ed9b 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -996,7 +996,7 @@ namespace MediaBrowser.Api.Playback
UseShellExecute = false,
// Must consume both stdout and stderr or deadlocks may occur
- RedirectStandardOutput = true,
+ //RedirectStandardOutput = true,
RedirectStandardError = true,
RedirectStandardInput = true,
@@ -1063,7 +1063,7 @@ namespace MediaBrowser.Api.Playback
}
// MUST read both stdout and stderr asynchronously or a deadlock may occurr
- process.BeginOutputReadLine();
+ //process.BeginOutputReadLine();
// Important - don't await the log task or we won't be able to kill ffmpeg when the user stops playback
Task.Run(() => StartStreamingLog(transcodingJob, state, process.StandardError.BaseStream, state.LogFileStream));
diff --git a/MediaBrowser.Api/StartupWizardService.cs b/MediaBrowser.Api/StartupWizardService.cs
index 38a7337ec..dfb82438e 100644
--- a/MediaBrowser.Api/StartupWizardService.cs
+++ b/MediaBrowser.Api/StartupWizardService.cs
@@ -117,7 +117,7 @@ namespace MediaBrowser.Api
config.EnableCustomPathSubFolders = true;
config.EnableStandaloneMusicKeys = true;
config.EnableCaseSensitiveItemIds = true;
- config.EnableFolderView = true;
+ //config.EnableFolderView = true;
config.SchemaVersion = 97;
}
diff --git a/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs
index 9eb796360..725f0bc6d 100644
--- a/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Encoder/BaseEncoder.cs
@@ -81,7 +81,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
UseShellExecute = false,
// Must consume both stdout and stderr or deadlocks may occur
- RedirectStandardOutput = true,
+ //RedirectStandardOutput = true,
RedirectStandardError = true,
RedirectStandardInput = true,
@@ -133,7 +133,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
cancellationToken.Register(() => Cancel(process, encodingJob));
// MUST read both stdout and stderr asynchronously or a deadlock may occurr
- process.BeginOutputReadLine();
+ //process.BeginOutputReadLine();
// Important - don't await the log task or we won't be able to kill ffmpeg when the user stops playback
new JobLogger(Logger).StartStreamingLog(encodingJob, process.StandardError.BaseStream, encodingJob.LogFileStream);
diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
index 68113c0d1..7834a9feb 100644
--- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
@@ -482,7 +482,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
UseShellExecute = false,
// Must consume both or ffmpeg may hang due to deadlocks. See comments below.
- RedirectStandardOutput = true,
+ //RedirectStandardOutput = true,
RedirectStandardError = true,
RedirectStandardInput = true,
FileName = FFProbePath,
@@ -517,7 +517,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
try
{
- process.BeginErrorReadLine();
+ //process.BeginErrorReadLine();
var result = _jsonSerializer.DeserializeFromStream<InternalMediaInfoResult>(process.StandardOutput.BaseStream);
@@ -612,7 +612,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
UseShellExecute = false,
// Must consume both or ffmpeg may hang due to deadlocks. See comments below.
- RedirectStandardOutput = true,
+ //RedirectStandardOutput = true,
RedirectStandardError = true,
RedirectStandardInput = true,
FileName = FFMpegPath,
@@ -643,7 +643,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
try
{
- process.BeginOutputReadLine();
+ //process.BeginOutputReadLine();
using (var reader = new StreamReader(process.StandardError.BaseStream))
{
diff --git a/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs b/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs
index 7a803eb6f..914b775af 100644
--- a/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs
+++ b/MediaBrowser.Providers/Omdb/OmdbItemProvider.cs
@@ -226,7 +226,7 @@ namespace MediaBrowser.Providers.Omdb
result.Item.SetProviderId(MetadataProviders.Imdb, imdbId);
result.HasMetadata = true;
- await new OmdbProvider(_jsonSerializer, _httpClient, _fileSystem, _configurationManager).Fetch(result.Item, imdbId, info.MetadataLanguage, info.MetadataCountryCode, cancellationToken).ConfigureAwait(false);
+ await new OmdbProvider(_jsonSerializer, _httpClient, _fileSystem, _configurationManager).Fetch(result, imdbId, info.MetadataLanguage, info.MetadataCountryCode, cancellationToken).ConfigureAwait(false);
}
return result;
@@ -265,7 +265,7 @@ namespace MediaBrowser.Providers.Omdb
result.Item.SetProviderId(MetadataProviders.Imdb, imdbId);
result.HasMetadata = true;
- await new OmdbProvider(_jsonSerializer, _httpClient, _fileSystem, _configurationManager).Fetch(result.Item, imdbId, info.MetadataLanguage, info.MetadataCountryCode, cancellationToken).ConfigureAwait(false);
+ await new OmdbProvider(_jsonSerializer, _httpClient, _fileSystem, _configurationManager).Fetch(result, imdbId, info.MetadataLanguage, info.MetadataCountryCode, cancellationToken).ConfigureAwait(false);
}
return result;
diff --git a/MediaBrowser.Providers/Omdb/OmdbProvider.cs b/MediaBrowser.Providers/Omdb/OmdbProvider.cs
index 397107c74..037931300 100644
--- a/MediaBrowser.Providers/Omdb/OmdbProvider.cs
+++ b/MediaBrowser.Providers/Omdb/OmdbProvider.cs
@@ -3,6 +3,7 @@ using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Serialization;
using System;
@@ -34,13 +35,16 @@ namespace MediaBrowser.Providers.Omdb
_configurationManager = configurationManager;
}
- public async Task Fetch(BaseItem item, string imdbId, string language, string country, CancellationToken cancellationToken)
+ public async Task Fetch<T>(MetadataResult<T> itemResult, string imdbId, string language, string country, CancellationToken cancellationToken)
+ where T :BaseItem
{
if (string.IsNullOrWhiteSpace(imdbId))
{
throw new ArgumentNullException("imdbId");
}
+ T item = itemResult.Item;
+
var result = await GetRootObject(imdbId, cancellationToken);
// Only take the name and rating if the user's language is set to english, since Omdb has no localization
@@ -56,8 +60,8 @@ namespace MediaBrowser.Providers.Omdb
int year;
- if (!string.IsNullOrEmpty(result.Year)
- && int.TryParse(result.Year, NumberStyles.Number, _usCulture, out year)
+ if (!string.IsNullOrEmpty(result.Year) && result.Year.Length >= 4
+ && int.TryParse(result.Year.Substring(0, 4), NumberStyles.Number, _usCulture, out year)
&& year >= 0)
{
item.ProductionYear = year;
@@ -112,16 +116,19 @@ namespace MediaBrowser.Providers.Omdb
item.SetProviderId(MetadataProviders.Imdb, result.imdbID);
}
- ParseAdditionalMetadata(item, result);
+ ParseAdditionalMetadata(itemResult, result);
}
- public async Task<bool> FetchEpisodeData(BaseItem item, int episodeNumber, int seasonNumber, string imdbId, string language, string country, CancellationToken cancellationToken)
+ public async Task<bool> FetchEpisodeData<T>(MetadataResult<T> itemResult, int episodeNumber, int seasonNumber, string imdbId, string language, string country, CancellationToken cancellationToken)
+ where T : BaseItem
{
if (string.IsNullOrWhiteSpace(imdbId))
{
throw new ArgumentNullException("imdbId");
}
+ T item = itemResult.Item;
+
var seasonResult = await GetSeasonRootObject(imdbId, seasonNumber, cancellationToken);
RootObject result = null;
@@ -154,8 +161,8 @@ namespace MediaBrowser.Providers.Omdb
int year;
- if (!string.IsNullOrEmpty(result.Year)
- && int.TryParse(result.Year, NumberStyles.Number, _usCulture, out year)
+ if (!string.IsNullOrEmpty(result.Year) && result.Year.Length >= 4
+ && int.TryParse(result.Year.Substring(0, 4), NumberStyles.Number, _usCulture, out year)
&& year >= 0)
{
item.ProductionYear = year;
@@ -210,7 +217,7 @@ namespace MediaBrowser.Providers.Omdb
item.SetProviderId(MetadataProviders.Imdb, result.imdbID);
}
- ParseAdditionalMetadata(item, result);
+ ParseAdditionalMetadata(itemResult, result);
return true;
}
@@ -376,8 +383,11 @@ namespace MediaBrowser.Providers.Omdb
return Path.Combine(dataPath, filename);
}
- private void ParseAdditionalMetadata(BaseItem item, RootObject result)
+ private void ParseAdditionalMetadata<T>(MetadataResult<T> itemResult, RootObject result)
+ where T : BaseItem
{
+ T item = itemResult.Item;
+
// Grab series genres because imdb data is better than tvdb. Leave movies alone
// But only do it if english is the preferred language because this data will not be localized
if (ShouldFetchGenres(item) &&
@@ -417,6 +427,46 @@ namespace MediaBrowser.Providers.Omdb
// Imdb plots are usually pretty short
hasShortOverview.ShortOverview = result.Plot;
}
+
+ //if (!string.IsNullOrWhiteSpace(result.Director))
+ //{
+ // var person = new PersonInfo
+ // {
+ // Name = result.Director.Trim(),
+ // Type = PersonType.Director
+ // };
+
+ // itemResult.AddPerson(person);
+ //}
+
+ //if (!string.IsNullOrWhiteSpace(result.Writer))
+ //{
+ // var person = new PersonInfo
+ // {
+ // Name = result.Director.Trim(),
+ // Type = PersonType.Writer
+ // };
+
+ // itemResult.AddPerson(person);
+ //}
+
+ //if (!string.IsNullOrWhiteSpace(result.Actors))
+ //{
+ // var actorList = result.Actors.Split(',');
+ // foreach (var actor in actorList)
+ // {
+ // if (!string.IsNullOrWhiteSpace(actor))
+ // {
+ // var person = new PersonInfo
+ // {
+ // Name = actor.Trim(),
+ // Type = PersonType.Actor
+ // };
+
+ // itemResult.AddPerson(person);
+ // }
+ // }
+ //}
}
private bool ShouldFetchGenres(BaseItem item)
diff --git a/MediaBrowser.Providers/TV/Omdb/OmdbEpisodeProvider.cs b/MediaBrowser.Providers/TV/Omdb/OmdbEpisodeProvider.cs
index 21668f014..64e30f47f 100644
--- a/MediaBrowser.Providers/TV/Omdb/OmdbEpisodeProvider.cs
+++ b/MediaBrowser.Providers/TV/Omdb/OmdbEpisodeProvider.cs
@@ -57,7 +57,7 @@ namespace MediaBrowser.Providers.TV
{
var seriesImdbId = info.SeriesProviderIds[MetadataProviders.Imdb.ToString()];
- result.HasMetadata = await new OmdbProvider(_jsonSerializer, _httpClient, _fileSystem, _configurationManager).FetchEpisodeData(result.Item, info.IndexNumber.Value, info.ParentIndexNumber.Value, seriesImdbId, info.MetadataLanguage, info.MetadataCountryCode, cancellationToken).ConfigureAwait(false);
+ result.HasMetadata = await new OmdbProvider(_jsonSerializer, _httpClient, _fileSystem, _configurationManager).FetchEpisodeData(result, info.IndexNumber.Value, info.ParentIndexNumber.Value, seriesImdbId, info.MetadataLanguage, info.MetadataCountryCode, cancellationToken).ConfigureAwait(false);
}
return result;
diff --git a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs
index 21879f6f4..5e428e6f0 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/EmbyTV/EncodedRecorder.cs
@@ -139,7 +139,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
UseShellExecute = false,
// Must consume both stdout and stderr or deadlocks may occur
- RedirectStandardOutput = true,
+ //RedirectStandardOutput = true,
RedirectStandardError = true,
RedirectStandardInput = true,
@@ -174,7 +174,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
cancellationToken.Register(Stop);
// MUST read both stdout and stderr asynchronously or a deadlock may occurr
- process.BeginOutputReadLine();
+ //process.BeginOutputReadLine();
onStarted();