parent
ff4a550cbb
commit
9af57c6786
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
|
@ -30,6 +30,7 @@ namespace NzbDrone.Api.Episodes
|
|||
public bool UnverifiedSceneNumbering { get; set; }
|
||||
public string SeriesTitle { get; set; }
|
||||
public SeriesResource Series { get; set; }
|
||||
public DateTime? LastSearchTime { get; set; }
|
||||
|
||||
//Hiding this so people don't think its usable (only used to set the initial state)
|
||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
|
@ -65,6 +66,7 @@ namespace NzbDrone.Api.Episodes
|
|||
UnverifiedSceneNumbering = model.UnverifiedSceneNumbering,
|
||||
SeriesTitle = model.SeriesTitle,
|
||||
//Series = model.Series.MapToResource(),
|
||||
LastSearchTime = model.LastSearchTime
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
using FluentMigrator;
|
||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Datastore.Migration
|
||||
{
|
||||
[Migration(130)]
|
||||
public class episode_last_searched_time : NzbDroneMigrationBase
|
||||
{
|
||||
protected override void MainDbUpgrade()
|
||||
{
|
||||
Alter.Table("Episodes").AddColumn("LastSearchTime").AsDateTime().Nullable();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Threading.Tasks;
|
||||
|
@ -314,6 +314,16 @@ namespace NzbDrone.Core.IndexerSearch
|
|||
|
||||
_logger.Debug("Total of {0} reports were found for {1} from {2} indexers", reports.Count, criteriaBase, indexers.Count);
|
||||
|
||||
// Update the last search time for all episodes if at least 1 indexer was searched.
|
||||
if (indexers.Any())
|
||||
{
|
||||
var lastSearchTime = DateTime.UtcNow;
|
||||
_logger.Debug("Setting last search time to: {0}", lastSearchTime);
|
||||
|
||||
criteriaBase.Episodes.ForEach(e => e.LastSearchTime = lastSearchTime);
|
||||
_episodeService.UpdateEpisodes(criteriaBase.Episodes);
|
||||
}
|
||||
|
||||
return _makeDownloadDecision.GetSearchDecision(reports, criteriaBase).ToList();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -143,6 +143,7 @@
|
|||
<Compile Include="Configuration\IConfigService.cs" />
|
||||
<Compile Include="Configuration\InvalidConfigFileException.cs" />
|
||||
<Compile Include="Configuration\ResetApiKeyCommand.cs" />
|
||||
<Compile Include="Datastore\Migration\130_episode_last_searched_time.cs" />
|
||||
<Compile Include="Datastore\Migration\129_add_relative_original_path_to_episode_file.cs" />
|
||||
<Compile Include="DecisionEngine\Specifications\AlreadyImportedSpecification.cs" />
|
||||
<Compile Include="Indexers\SeedConfigProvider.cs" />
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Marr.Data;
|
||||
using NzbDrone.Common.Extensions;
|
||||
|
@ -32,6 +32,7 @@ namespace NzbDrone.Core.Tv
|
|||
public bool UnverifiedSceneNumbering { get; set; }
|
||||
public Ratings Ratings { get; set; }
|
||||
public List<MediaCover.MediaCover> Images { get; set; }
|
||||
public DateTime? LastSearchTime { get; set; }
|
||||
|
||||
public string SeriesTitle { get; private set; }
|
||||
|
||||
|
@ -46,4 +47,4 @@ namespace NzbDrone.Core.Tv
|
|||
return string.Format("[{0}]{1}", Id, Title.NullSafe());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue