listenTo instead of on
This commit is contained in:
parent
6a9993fa70
commit
83207a0baf
|
@ -73,8 +73,9 @@ namespace NzbDrone.Core.MediaFiles
|
||||||
|
|
||||||
private IEnumerable<RenameEpisodeFilePreview> GetPreviews(Series series, List<Episode> episodes, List<EpisodeFile> files)
|
private IEnumerable<RenameEpisodeFilePreview> GetPreviews(Series series, List<Episode> episodes, List<EpisodeFile> files)
|
||||||
{
|
{
|
||||||
foreach (var file in files)
|
foreach (var f in files)
|
||||||
{
|
{
|
||||||
|
var file = f;
|
||||||
var episodesInFile = episodes.Where(e => e.EpisodeFileId == file.Id).ToList();
|
var episodesInFile = episodes.Where(e => e.EpisodeFileId == file.Id).ToList();
|
||||||
|
|
||||||
if (!episodesInFile.Any())
|
if (!episodesInFile.Any())
|
||||||
|
@ -95,18 +96,13 @@ namespace NzbDrone.Core.MediaFiles
|
||||||
SeasonNumber = seasonNumber,
|
SeasonNumber = seasonNumber,
|
||||||
EpisodeNumbers = episodesInFile.Select(e => e.EpisodeNumber).ToList(),
|
EpisodeNumbers = episodesInFile.Select(e => e.EpisodeNumber).ToList(),
|
||||||
EpisodeFileId = file.Id,
|
EpisodeFileId = file.Id,
|
||||||
ExistingPath = GetRelativePath(series.Path, file.Path),
|
ExistingPath = series.Path.GetRelativePath(file.Path),
|
||||||
NewPath = GetRelativePath(series.Path, newPath)
|
NewPath = series.Path.GetRelativePath(newPath)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetRelativePath(string seriesPath, string path)
|
|
||||||
{
|
|
||||||
return path.Substring(seriesPath.Length + 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void RenameFiles(List<EpisodeFile> episodeFiles, Series series)
|
private void RenameFiles(List<EpisodeFile> episodeFiles, Series series)
|
||||||
{
|
{
|
||||||
var renamed = new List<EpisodeFile>();
|
var renamed = new List<EpisodeFile>();
|
||||||
|
|
|
@ -55,7 +55,7 @@ define(
|
||||||
|
|
||||||
_importSeries: function () {
|
_importSeries: function () {
|
||||||
this.rootFolderLayout = new RootFolderLayout();
|
this.rootFolderLayout = new RootFolderLayout();
|
||||||
this.rootFolderLayout.on('folderSelected', this._folderSelected, this);
|
this.listenTo(this.rootFolderLayout, 'folderSelected', this._folderSelected);
|
||||||
AppLayout.modalRegion.show(this.rootFolderLayout);
|
AppLayout.modalRegion.show(this.rootFolderLayout);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue