mirror of
https://github.com/Sonarr/Sonarr
synced 2026-05-07 12:30:56 +02:00
Add method to update tags for existing series in queue during Import List sync
This commit is contained in:
parent
68e666137f
commit
5db833d59b
1 changed files with 16 additions and 1 deletions
|
|
@ -230,6 +230,8 @@ private void ProcessListItems(List<ImportListItemInfo> items)
|
|||
continue;
|
||||
}
|
||||
|
||||
UpdateExistingTagSeriesRecord(seriesToAdd, item, importList);
|
||||
|
||||
// Append Series if not already in DB or already on add list
|
||||
if (seriesToAdd.All(s => s.TvdbId != item.TvdbId))
|
||||
{
|
||||
|
|
@ -264,6 +266,19 @@ private void ProcessListItems(List<ImportListItemInfo> items)
|
|||
_logger.ProgressInfo("Import List Sync Completed. Items found: {0}, Series added: {1}", items.Count, seriesToAdd.Count);
|
||||
}
|
||||
|
||||
private void UpdateExistingTagSeriesRecord(List<Series> existingList, ImportListItemInfo item, ImportListDefinition importList)
|
||||
{
|
||||
var existing = existingList.FirstOrDefault(s => s.TvdbId == item.TvdbId);
|
||||
|
||||
if (existing != null)
|
||||
{
|
||||
foreach (var tag in importList.Tags)
|
||||
{
|
||||
existing.Tags.Add(tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void TagExisting(ImportListDefinition importList, ImportListItemInfo report)
|
||||
{
|
||||
if (importList.TagExisting)
|
||||
|
|
@ -279,7 +294,7 @@ private void TagExisting(ImportListDefinition importList, ImportListItemInfo rep
|
|||
if (preCount != series.Tags.Count)
|
||||
{
|
||||
_seriesService.UpdateSeries(series);
|
||||
_logger.Debug("{0} [{1}] Retroactively added tags to series", report.TmdbId, report.Title);
|
||||
_logger.Debug("{0} [{1}] tagged existing series", report.TmdbId, report.Title);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue