|
|
@ -1,3 +1,4 @@
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using NLog;
|
|
|
|
using NLog;
|
|
|
@ -18,6 +19,7 @@ namespace NzbDrone.Core.MediaFiles
|
|
|
|
List<EpisodeFile> GetFilesBySeries(int seriesId);
|
|
|
|
List<EpisodeFile> GetFilesBySeries(int seriesId);
|
|
|
|
List<EpisodeFile> GetFilesBySeason(int seriesId, int seasonNumber);
|
|
|
|
List<EpisodeFile> GetFilesBySeason(int seriesId, int seasonNumber);
|
|
|
|
List<string> FilterExistingFiles(List<string> files, int seriesId);
|
|
|
|
List<string> FilterExistingFiles(List<string> files, int seriesId);
|
|
|
|
|
|
|
|
EpisodeFile Get(int id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class MediaFileService : IMediaFileService, IHandleAsync<SeriesDeletedEvent>
|
|
|
|
public class MediaFileService : IMediaFileService, IHandleAsync<SeriesDeletedEvent>
|
|
|
@ -81,6 +83,11 @@ namespace NzbDrone.Core.MediaFiles
|
|
|
|
return files.Select(f => f.CleanFilePath().ToLower()).Except(seriesFiles).ToList();
|
|
|
|
return files.Select(f => f.CleanFilePath().ToLower()).Except(seriesFiles).ToList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public EpisodeFile Get(int id)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return _mediaFileRepository.Get(id);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void HandleAsync(SeriesDeletedEvent message)
|
|
|
|
public void HandleAsync(SeriesDeletedEvent message)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var files = GetFilesBySeries(message.Series.Id);
|
|
|
|
var files = GetFilesBySeries(message.Series.Id);
|
|
|
|