don't organize with unknown episode name

This commit is contained in:
Luke Pulverenti 2016-01-29 13:29:09 -05:00
parent 933a166424
commit 0361b8b0e8

View File

@ -189,15 +189,6 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
return Task.FromResult(true); return Task.FromResult(true);
} }
if (!series.ProviderIds.Any())
{
var msg = string.Format("Series has not yet been identified: {0}. If you just added the series, please run a library scan or use the identify feature to identify it.", seriesName);
result.Status = FileSortingStatus.Failure;
result.StatusMessage = msg;
_logger.Warn(msg);
return Task.FromResult(true);
}
return OrganizeEpisode(sourcePath, return OrganizeEpisode(sourcePath,
series, series,
seasonNumber, seasonNumber,
@ -471,7 +462,9 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
/// <param name="seasonNumber">The season number.</param> /// <param name="seasonNumber">The season number.</param>
/// <param name="episodeNumber">The episode number.</param> /// <param name="episodeNumber">The episode number.</param>
/// <param name="endingEpisodeNumber">The ending episode number.</param> /// <param name="endingEpisodeNumber">The ending episode number.</param>
/// <param name="premiereDate">The premiere date.</param>
/// <param name="options">The options.</param> /// <param name="options">The options.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>System.String.</returns> /// <returns>System.String.</returns>
private async Task<string> GetNewPath(string sourcePath, private async Task<string> GetNewPath(string sourcePath,
Series series, Series series,
@ -501,17 +494,20 @@ namespace MediaBrowser.Server.Implementations.FileOrganization
var episode = searchResults.FirstOrDefault(); var episode = searchResults.FirstOrDefault();
string episodeName = string.Empty;
if (episode == null) if (episode == null)
{ {
var msg = string.Format("No provider metadata found for {0} season {1} episode {2}", series.Name, seasonNumber, episodeNumber); var msg = string.Format("No provider metadata found for {0} season {1} episode {2}", series.Name, seasonNumber, episodeNumber);
_logger.Warn(msg); _logger.Warn(msg);
//throw new Exception(msg); return null;
} }
else
var episodeName = episode.Name;
if (string.IsNullOrWhiteSpace(episodeName))
{ {
episodeName = episode.Name; var msg = string.Format("No provider metadata found for {0} season {1} episode {2}", series.Name, seasonNumber, episodeNumber);
_logger.Warn(msg);
return null;
} }
seasonNumber = seasonNumber ?? episode.ParentIndexNumber; seasonNumber = seasonNumber ?? episode.ParentIndexNumber;