diff --git a/MediaBrowser.Api/Library/FileOrganizationService.cs b/MediaBrowser.Api/Library/FileOrganizationService.cs index 3e40bc5da..f636b723e 100644 --- a/MediaBrowser.Api/Library/FileOrganizationService.cs +++ b/MediaBrowser.Api/Library/FileOrganizationService.cs @@ -157,6 +157,24 @@ namespace MediaBrowser.Api.Library public void Post(OrganizeEpisode request) { + var dicNewProviderIds = new Dictionary(); + + if (!string.IsNullOrEmpty(request.NewSeriesProviderIds)) + { + var str = request.NewSeriesProviderIds.Replace("{", "").Replace("}", "").Replace("\"", ""); + + foreach (var item in str.Split(',')) + { + var itemArr = item.Split(':'); + if (itemArr.Length > 1) + { + var key = itemArr[0].Trim(); + var val = itemArr[1].Trim(); + dicNewProviderIds.Add(key, val); + } + } + } + var task = _iFileOrganizationService.PerformEpisodeOrganization(new EpisodeFileOrganizationRequest { EndingEpisodeNumber = request.EndingEpisodeNumber, @@ -167,7 +185,7 @@ namespace MediaBrowser.Api.Library SeriesId = request.SeriesId, NewSeriesName = request.NewSeriesName, NewSeriesYear = request.NewSeriesYear, - NewSeriesProviderIds = request.NewSeriesProviderIds, + NewSeriesProviderIdsDictionary = dicNewProviderIds, TargetFolder = request.TargetFolder }); diff --git a/MediaBrowser.Model/FileOrganization/EpisodeFileOrganizationRequest.cs b/MediaBrowser.Model/FileOrganization/EpisodeFileOrganizationRequest.cs index 6a3e6c30d..307088b63 100644 --- a/MediaBrowser.Model/FileOrganization/EpisodeFileOrganizationRequest.cs +++ b/MediaBrowser.Model/FileOrganization/EpisodeFileOrganizationRequest.cs @@ -19,34 +19,8 @@ namespace MediaBrowser.Model.FileOrganization public string NewSeriesYear { get; set; } - public string NewSeriesProviderIds { get; set; } - public string TargetFolder { get; set; } - public Dictionary NewSeriesProviderIdsDictionary - { - get - { - var dic = new Dictionary(); - - if (!string.IsNullOrEmpty(NewSeriesProviderIds)) - { - var str = NewSeriesProviderIds.Replace("{", "").Replace("}", "").Replace("\"", ""); - - foreach (var item in str.Split(',')) - { - var itemArr = item.Split(':'); - if (itemArr.Length > 1) - { - var key = itemArr[0].Trim(); - var val = itemArr[1].Trim(); - dic.Add(key, val); - } - } - } - - return dic; - } - } + public Dictionary NewSeriesProviderIdsDictionary { get; set; } } } \ No newline at end of file