mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-27 02:07:41 +00:00
updated around import episodes, update series.
This commit is contained in:
parent
53bfd43fba
commit
48bf793746
4 changed files with 15 additions and 13 deletions
|
@ -89,7 +89,7 @@ namespace NzbDrone.Core.MediaFiles
|
||||||
|
|
||||||
if (series == null)
|
if (series == null)
|
||||||
{
|
{
|
||||||
_logger.Trace("Unknown Series for file: {0}", videoFile);
|
_logger.Debug("Unknown Series for file: {0}", videoFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessVideoFile(videoFile, series);
|
ProcessVideoFile(videoFile, series);
|
||||||
|
@ -107,7 +107,7 @@ namespace NzbDrone.Core.MediaFiles
|
||||||
|
|
||||||
if (series == null)
|
if (series == null)
|
||||||
{
|
{
|
||||||
_logger.Trace("Unknown Series {0}", subfolderInfo.Name);
|
_logger.Debug("Unknown Series {0}", subfolderInfo.Name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ namespace NzbDrone.Core.MediaFiles
|
||||||
{
|
{
|
||||||
if (_diskProvider.IsFileLocked(new FileInfo(videoFile)))
|
if (_diskProvider.IsFileLocked(new FileInfo(videoFile)))
|
||||||
{
|
{
|
||||||
_logger.Trace("[{0}] is currently locked by another process, skipping", videoFile);
|
_logger.Debug("[{0}] is currently locked by another process, skipping", videoFile);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
_logger.ErrorException("Couldn't process report.", e);
|
_logger.ErrorException("Couldn't import file." + file, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (decision != null)
|
if (decision != null)
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
using Marr.Data;
|
using Marr.Data;
|
||||||
using NzbDrone.Core.Datastore;
|
using NzbDrone.Core.Datastore;
|
||||||
using NzbDrone.Core.MediaFiles;
|
using NzbDrone.Core.MediaFiles;
|
||||||
|
using NzbDrone.Common;
|
||||||
|
|
||||||
|
|
||||||
namespace NzbDrone.Core.Tv
|
namespace NzbDrone.Core.Tv
|
||||||
|
@ -32,5 +33,10 @@ namespace NzbDrone.Core.Tv
|
||||||
{
|
{
|
||||||
get { return EpisodeFileId > 0; }
|
get { return EpisodeFileId > 0; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
return string.Format("[0]{1}", TvDbEpisodeId, Title.NullSafe());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -100,12 +100,9 @@ namespace NzbDrone.Core.Tv
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var episodeToUpdate = seriesEpisodes.SingleOrDefault(e => e.TvDbEpisodeId == episode.TvDbEpisodeId);
|
var episodeToUpdate = seriesEpisodes.SingleOrDefault(e => e.TvDbEpisodeId == episode.TvDbEpisodeId) ??
|
||||||
|
seriesEpisodes.SingleOrDefault(e => e.SeasonNumber == episode.SeasonNumber && e.EpisodeNumber == episode.EpisodeNumber);
|
||||||
|
|
||||||
if (episodeToUpdate == null)
|
|
||||||
{
|
|
||||||
episodeToUpdate = seriesEpisodes.SingleOrDefault(e => e.SeasonNumber == episode.SeasonNumber && e.EpisodeNumber == episode.EpisodeNumber);
|
|
||||||
}
|
|
||||||
if (episodeToUpdate == null)
|
if (episodeToUpdate == null)
|
||||||
{
|
{
|
||||||
episodeToUpdate = new Episode();
|
episodeToUpdate = new Episode();
|
||||||
|
@ -119,8 +116,7 @@ namespace NzbDrone.Core.Tv
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var season = seasons.FirstOrDefault(c => c.SeasonNumber == episode.SeasonNumber);
|
var season = seasons.FirstOrDefault(c => c.SeasonNumber == episode.SeasonNumber);
|
||||||
|
episodeToUpdate.Monitored = season == null || season.Monitored;
|
||||||
episodeToUpdate.Monitored = season != null ? season.Monitored : true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -148,7 +144,7 @@ namespace NzbDrone.Core.Tv
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
_logger.FatalException(String.Format("An error has occurred while updating episode info for series {0}", series), e);
|
_logger.FatalException(String.Format("An error has occurred while updating episode info for series {0}. {1}", series, episode), e);
|
||||||
failCount++;
|
failCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue