listenTo instead of on

pull/3113/head
Mark McDowall 11 years ago
parent 6a9993fa70
commit 83207a0baf

@ -73,8 +73,9 @@ namespace NzbDrone.Core.MediaFiles
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();
if (!episodesInFile.Any())
@ -95,18 +96,13 @@ namespace NzbDrone.Core.MediaFiles
SeasonNumber = seasonNumber,
EpisodeNumbers = episodesInFile.Select(e => e.EpisodeNumber).ToList(),
EpisodeFileId = file.Id,
ExistingPath = GetRelativePath(series.Path, file.Path),
NewPath = GetRelativePath(series.Path, newPath)
ExistingPath = series.Path.GetRelativePath(file.Path),
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)
{
var renamed = new List<EpisodeFile>();

@ -55,7 +55,7 @@ define(
_importSeries: function () {
this.rootFolderLayout = new RootFolderLayout();
this.rootFolderLayout.on('folderSelected', this._folderSelected, this);
this.listenTo(this.rootFolderLayout, 'folderSelected', this._folderSelected);
AppLayout.modalRegion.show(this.rootFolderLayout);
},

Loading…
Cancel
Save