Пример #1
0
        public void Post(OrganizeMovie request)
        {
            // Don't await this
            var task = InternalFileOrganizationService.PerformOrganization(new MovieFileOrganizationRequest
            {
                ResultId            = request.Id,
                MovieId             = request.MovieId,
                NewMovieName        = request.NewMovieName,
                NewMovieYear        = request.NewMovieYear,
                NewMovieProviderIds = request.NewMovieProviderIds ?? new Dictionary <string, string>(),
                TargetFolder        = request.TargetFolder
            });

            // Async processing (close dialog early instead of waiting until the file has been copied)
            // Wait 2s for exceptions that may occur to have them forwarded to the client for immediate error display
            task.Wait(2000);
        }
Пример #2
0
        public void Post(OrganizeMovie request)
        {
            var dicNewProviderIds = new ProviderIdDictionary();

            if (request.NewMovieProviderIds != null)
            {
                dicNewProviderIds = request.NewMovieProviderIds;
            }

            // Don't await this
            InternalFileOrganizationService.PerformOrganization(new MovieFileOrganizationRequest
            {
                ResultId            = request.Id,
                MovieId             = request.MovieId,
                NewMovieName        = request.NewMovieName,
                NewMovieYear        = request.NewMovieYear,
                NewMovieProviderIds = dicNewProviderIds,
                TargetFolder        = request.TargetFolder
            });
        }