mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-17 07:49:45 +02:00
New: Store last search time for MovieSearch
(cherry picked from commit 9af57c6786
)
This commit is contained in:
parent
03dec07cbe
commit
7f11659d95
@ -0,0 +1,14 @@
|
|||||||
|
using FluentMigrator;
|
||||||
|
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||||
|
|
||||||
|
namespace NzbDrone.Core.Datastore.Migration
|
||||||
|
{
|
||||||
|
[Migration(234)]
|
||||||
|
public class movie_last_searched_time : NzbDroneMigrationBase
|
||||||
|
{
|
||||||
|
protected override void MainDbUpgrade()
|
||||||
|
{
|
||||||
|
Alter.Table("Movies").AddColumn("LastSearchTime").AsDateTimeOffset().Nullable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -114,6 +114,16 @@ private async Task<List<DownloadDecision>> Dispatch(Func<IIndexer, Task<IList<Re
|
|||||||
|
|
||||||
_logger.Debug("Total of {0} reports were found for {1} from {2} indexers", reports.Count, criteriaBase, indexers.Count);
|
_logger.Debug("Total of {0} reports were found for {1} from {2} indexers", reports.Count, criteriaBase, indexers.Count);
|
||||||
|
|
||||||
|
// Update the last search time for movie if at least 1 indexer was searched.
|
||||||
|
if (indexers.Any())
|
||||||
|
{
|
||||||
|
var lastSearchTime = DateTime.UtcNow;
|
||||||
|
_logger.Debug("Setting last search time to: {0}", lastSearchTime);
|
||||||
|
|
||||||
|
criteriaBase.Movie.LastSearchTime = lastSearchTime;
|
||||||
|
_movieService.UpdateMovie(criteriaBase.Movie);
|
||||||
|
}
|
||||||
|
|
||||||
return _makeDownloadDecision.GetSearchDecision(reports, criteriaBase).ToList();
|
return _makeDownloadDecision.GetSearchDecision(reports, criteriaBase).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ public Movie()
|
|||||||
public QualityProfile QualityProfile { get; set; }
|
public QualityProfile QualityProfile { get; set; }
|
||||||
public HashSet<int> Tags { get; set; }
|
public HashSet<int> Tags { get; set; }
|
||||||
public AddMovieOptions AddOptions { get; set; }
|
public AddMovieOptions AddOptions { get; set; }
|
||||||
|
public DateTime? LastSearchTime { get; set; }
|
||||||
public MovieFile MovieFile { get; set; }
|
public MovieFile MovieFile { get; set; }
|
||||||
public int MovieFileId { get; set; }
|
public int MovieFileId { get; set; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user