mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-18 21:35:51 -04:00
Movie updates already done in MovieControllerWithSignalR
This commit is contained in:
@@ -20,6 +20,7 @@ namespace NzbDrone.Core.MediaFiles.Events
|
|||||||
ImportedMovie = importedMovie;
|
ImportedMovie = importedMovie;
|
||||||
OldFiles = oldFiles;
|
OldFiles = oldFiles;
|
||||||
NewDownload = newDownload;
|
NewDownload = newDownload;
|
||||||
|
|
||||||
if (downloadClientItem != null)
|
if (downloadClientItem != null)
|
||||||
{
|
{
|
||||||
DownloadClientInfo = downloadClientItem.DownloadClientInfo;
|
DownloadClientInfo = downloadClientItem.DownloadClientInfo;
|
||||||
|
|||||||
@@ -5,14 +5,12 @@ using System.Linq;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using NLog;
|
|
||||||
using NzbDrone.Common.Extensions;
|
using NzbDrone.Common.Extensions;
|
||||||
using NzbDrone.Core.Configuration;
|
using NzbDrone.Core.Configuration;
|
||||||
using NzbDrone.Core.Datastore.Events;
|
using NzbDrone.Core.Datastore.Events;
|
||||||
using NzbDrone.Core.DecisionEngine.Specifications;
|
using NzbDrone.Core.DecisionEngine.Specifications;
|
||||||
using NzbDrone.Core.Languages;
|
using NzbDrone.Core.Languages;
|
||||||
using NzbDrone.Core.MediaCover;
|
using NzbDrone.Core.MediaCover;
|
||||||
using NzbDrone.Core.MediaFiles;
|
|
||||||
using NzbDrone.Core.MediaFiles.Events;
|
using NzbDrone.Core.MediaFiles.Events;
|
||||||
using NzbDrone.Core.Messaging.Commands;
|
using NzbDrone.Core.Messaging.Commands;
|
||||||
using NzbDrone.Core.Messaging.Events;
|
using NzbDrone.Core.Messaging.Events;
|
||||||
@@ -33,8 +31,6 @@ namespace Radarr.Api.V3.Movies
|
|||||||
{
|
{
|
||||||
[V3ApiController]
|
[V3ApiController]
|
||||||
public class MovieController : RestControllerWithSignalR<MovieResource, Movie>,
|
public class MovieController : RestControllerWithSignalR<MovieResource, Movie>,
|
||||||
IHandle<MovieFileImportedEvent>,
|
|
||||||
IHandle<MovieFileDeletedEvent>,
|
|
||||||
IHandle<MovieUpdatedEvent>,
|
IHandle<MovieUpdatedEvent>,
|
||||||
IHandle<MovieEditedEvent>,
|
IHandle<MovieEditedEvent>,
|
||||||
IHandle<MoviesDeletedEvent>,
|
IHandle<MoviesDeletedEvent>,
|
||||||
@@ -51,7 +47,6 @@ namespace Radarr.Api.V3.Movies
|
|||||||
private readonly IRootFolderService _rootFolderService;
|
private readonly IRootFolderService _rootFolderService;
|
||||||
private readonly IUpgradableSpecification _qualityUpgradableSpecification;
|
private readonly IUpgradableSpecification _qualityUpgradableSpecification;
|
||||||
private readonly IConfigService _configService;
|
private readonly IConfigService _configService;
|
||||||
private readonly Logger _logger;
|
|
||||||
|
|
||||||
public MovieController(IBroadcastSignalRMessage signalRBroadcaster,
|
public MovieController(IBroadcastSignalRMessage signalRBroadcaster,
|
||||||
IMovieService moviesService,
|
IMovieService moviesService,
|
||||||
@@ -72,8 +67,7 @@ namespace Radarr.Api.V3.Movies
|
|||||||
SystemFolderValidator systemFolderValidator,
|
SystemFolderValidator systemFolderValidator,
|
||||||
QualityProfileExistsValidator qualityProfileExistsValidator,
|
QualityProfileExistsValidator qualityProfileExistsValidator,
|
||||||
RootFolderExistsValidator rootFolderExistsValidator,
|
RootFolderExistsValidator rootFolderExistsValidator,
|
||||||
MovieFolderAsRootFolderValidator movieFolderAsRootFolderValidator,
|
MovieFolderAsRootFolderValidator movieFolderAsRootFolderValidator)
|
||||||
Logger logger)
|
|
||||||
: base(signalRBroadcaster)
|
: base(signalRBroadcaster)
|
||||||
{
|
{
|
||||||
_moviesService = moviesService;
|
_moviesService = moviesService;
|
||||||
@@ -85,7 +79,6 @@ namespace Radarr.Api.V3.Movies
|
|||||||
_coverMapper = coverMapper;
|
_coverMapper = coverMapper;
|
||||||
_commandQueueManager = commandQueueManager;
|
_commandQueueManager = commandQueueManager;
|
||||||
_rootFolderService = rootFolderService;
|
_rootFolderService = rootFolderService;
|
||||||
_logger = logger;
|
|
||||||
|
|
||||||
SharedValidator.RuleFor(s => s.Path).Cascade(CascadeMode.Stop)
|
SharedValidator.RuleFor(s => s.Path).Cascade(CascadeMode.Stop)
|
||||||
.IsValidPath()
|
.IsValidPath()
|
||||||
@@ -327,23 +320,6 @@ namespace Radarr.Api.V3.Movies
|
|||||||
resource.SizeOnDisk = movieStatistics.SizeOnDisk;
|
resource.SizeOnDisk = movieStatistics.SizeOnDisk;
|
||||||
}
|
}
|
||||||
|
|
||||||
[NonAction]
|
|
||||||
public void Handle(MovieFileImportedEvent message)
|
|
||||||
{
|
|
||||||
BroadcastResourceChange(ModelAction.Updated, message.MovieInfo.Movie.Id);
|
|
||||||
}
|
|
||||||
|
|
||||||
[NonAction]
|
|
||||||
public void Handle(MovieFileDeletedEvent message)
|
|
||||||
{
|
|
||||||
if (message.Reason == DeleteMediaFileReason.Upgrade)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
BroadcastResourceChange(ModelAction.Updated, message.MovieFile.MovieId);
|
|
||||||
}
|
|
||||||
|
|
||||||
[NonAction]
|
[NonAction]
|
||||||
public void Handle(MovieUpdatedEvent message)
|
public void Handle(MovieUpdatedEvent message)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ namespace Radarr.Api.V3.Movies
|
|||||||
[NonAction]
|
[NonAction]
|
||||||
public void Handle(MovieFileImportedEvent message)
|
public void Handle(MovieFileImportedEvent message)
|
||||||
{
|
{
|
||||||
BroadcastResourceChange(ModelAction.Updated, message.MovieInfo.Movie.Id);
|
BroadcastResourceChange(ModelAction.Updated, message.ImportedMovie.Movie.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
[NonAction]
|
[NonAction]
|
||||||
|
|||||||
Reference in New Issue
Block a user