private JsonResponse <NamingSampleResource> GetExamples(NamingConfigResource config)
        {
            var nameSpec       = config.InjectTo <NamingConfig>();
            var sampleResource = new NamingSampleResource();

            var singleEpisodeSampleResult = _filenameSampleService.GetStandardSample(nameSpec);
            var multiEpisodeSampleResult  = _filenameSampleService.GetMultiEpisodeSample(nameSpec);
            var dailyEpisodeSampleResult  = _filenameSampleService.GetDailySample(nameSpec);

            sampleResource.SingleEpisodeExample = _filenameValidationService.ValidateStandardFilename(singleEpisodeSampleResult) != null
                    ? "Invalid format"
                    : singleEpisodeSampleResult.Filename;

            sampleResource.MultiEpisodeExample = _filenameValidationService.ValidateStandardFilename(multiEpisodeSampleResult) != null
                    ? "Invalid format"
                    : multiEpisodeSampleResult.Filename;

            sampleResource.DailyEpisodeExample = _filenameValidationService.ValidateDailyFilename(dailyEpisodeSampleResult) != null
                    ? "Invalid format"
                    : dailyEpisodeSampleResult.Filename;

            sampleResource.SeriesFolderExample = nameSpec.SeriesFolderFormat.IsNullOrWhiteSpace()
                ? "Invalid format"
                : _filenameSampleService.GetSeriesFolderSample(nameSpec);

            sampleResource.SeasonFolderExample = nameSpec.SeasonFolderFormat.IsNullOrWhiteSpace()
                ? "Invalid format"
                : _filenameSampleService.GetSeasonFolderSample(nameSpec);

            return(sampleResource.AsResponse());
        }
Beispiel #2
0
        private JsonResponse <NamingSampleResource> GetExamples(NamingConfigResource config)
        {
            var nameSpec       = config.ToModel();
            var sampleResource = new NamingSampleResource();

            //var singleEpisodeSampleResult = _filenameSampleService.GetStandardSample(nameSpec);
            //var multiEpisodeSampleResult = _filenameSampleService.GetMultiEpisodeSample(nameSpec);
            //var dailyEpisodeSampleResult = _filenameSampleService.GetDailySample(nameSpec);
            //var animeEpisodeSampleResult = _filenameSampleService.GetAnimeSample(nameSpec);
            //var animeMultiEpisodeSampleResult = _filenameSampleService.GetAnimeMultiEpisodeSample(nameSpec);

            var movieSampleResult = _filenameSampleService.GetMovieSample(nameSpec);


            //sampleResource.SingleEpisodeExample = _filenameValidationService.ValidateStandardFilename(singleEpisodeSampleResult) != null
            //        ? "Invalid format"
            //        : singleEpisodeSampleResult.FileName;

            //sampleResource.MultiEpisodeExample = _filenameValidationService.ValidateStandardFilename(multiEpisodeSampleResult) != null
            //        ? "Invalid format"
            //        : multiEpisodeSampleResult.FileName;

            //sampleResource.DailyEpisodeExample = _filenameValidationService.ValidateDailyFilename(dailyEpisodeSampleResult) != null
            //        ? "Invalid format"
            //        : dailyEpisodeSampleResult.FileName;

            //sampleResource.AnimeEpisodeExample = _filenameValidationService.ValidateAnimeFilename(animeEpisodeSampleResult) != null
            //        ? "Invalid format"
            //        : animeEpisodeSampleResult.FileName;

            //sampleResource.AnimeMultiEpisodeExample = _filenameValidationService.ValidateAnimeFilename(animeMultiEpisodeSampleResult) != null
            //        ? "Invalid format"
            //        : animeMultiEpisodeSampleResult.FileName;

            sampleResource.MovieExample = nameSpec.StandardMovieFormat.IsNullOrWhiteSpace()
                ? "Invalid Format"
                : movieSampleResult.FileName;

            //sampleResource.SeriesFolderExample = nameSpec.SeriesFolderFormat.IsNullOrWhiteSpace()
            //    ? "Invalid format"
            //    : _filenameSampleService.GetSeriesFolderSample(nameSpec);

            //sampleResource.SeasonFolderExample = nameSpec.SeasonFolderFormat.IsNullOrWhiteSpace()
            //    ? "Invalid format"
            //    : _filenameSampleService.GetSeasonFolderSample(nameSpec);

            sampleResource.MovieFolderExample = nameSpec.MovieFolderFormat.IsNullOrWhiteSpace()
                ? "Invalid format"
                : _filenameSampleService.GetMovieFolderSample(nameSpec);

            return(sampleResource.AsResponse());
        }
Beispiel #3
0
        private JsonResponse <NamingSampleResource> GetExamples(NamingConfigResource config)
        {
            var nameSpec = config.InjectTo <NamingConfig>();

            var series = new Core.Tv.Series
            {
                SeriesType = SeriesTypes.Standard,
                Title      = "Series Title"
            };

            var episode1 = new Episode
            {
                SeasonNumber  = 1,
                EpisodeNumber = 1,
                Title         = "Episode Title (1)"
            };

            var episode2 = new Episode
            {
                SeasonNumber  = 1,
                EpisodeNumber = 2,
                Title         = "Episode Title (2)"
            };

            var episodeFile = new EpisodeFile
            {
                Quality = new QualityModel(Quality.HDTV720p),
                Path    = @"C:\Test\Series.Title.S01E01.720p.HDTV.x264-EVOLVE.mkv"
            };

            var sampleResource = new NamingSampleResource();

            sampleResource.SingleEpisodeExample = _buildFileNames.BuildFilename(new List <Episode> {
                episode1
            },
                                                                                series,
                                                                                episodeFile,
                                                                                nameSpec);

            episodeFile.Path = @"C:\Test\Series.Title.S01E01-E02.720p.HDTV.x264-EVOLVE.mkv";

            sampleResource.MultiEpisodeExample = _buildFileNames.BuildFilename(new List <Episode> {
                episode1, episode2
            },
                                                                               series,
                                                                               episodeFile,
                                                                               nameSpec);

            return(sampleResource.AsResponse());
        }
Beispiel #4
0
        private JsonResponse <NamingSampleResource> GetExamples(NamingConfigResource config)
        {
            var nameSpec       = config.ToModel();
            var sampleResource = new NamingSampleResource();

            var movieSampleResult = _filenameSampleService.GetMovieSample(nameSpec);

            sampleResource.MovieExample = nameSpec.StandardMovieFormat.IsNullOrWhiteSpace()
                ? "Invalid Format"
                : movieSampleResult.FileName;

            sampleResource.MovieFolderExample = nameSpec.MovieFolderFormat.IsNullOrWhiteSpace()
                ? "Invalid format"
                : _filenameSampleService.GetMovieFolderSample(nameSpec);

            return(sampleResource.AsResponse());
        }
Beispiel #5
0
        private object GetExamples(NamingConfigResource config)
        {
            var nameSpec       = config.ToModel();
            var sampleResource = new NamingSampleResource();

            var singleEpisodeSampleResult     = _filenameSampleService.GetStandardSample(nameSpec);
            var multiEpisodeSampleResult      = _filenameSampleService.GetMultiEpisodeSample(nameSpec);
            var dailyEpisodeSampleResult      = _filenameSampleService.GetDailySample(nameSpec);
            var animeEpisodeSampleResult      = _filenameSampleService.GetAnimeSample(nameSpec);
            var animeMultiEpisodeSampleResult = _filenameSampleService.GetAnimeMultiEpisodeSample(nameSpec);

            sampleResource.SingleEpisodeExample = _filenameValidationService.ValidateStandardFilename(singleEpisodeSampleResult) != null
                    ? "Invalid format"
                    : singleEpisodeSampleResult.FileName;

            sampleResource.MultiEpisodeExample = _filenameValidationService.ValidateStandardFilename(multiEpisodeSampleResult) != null
                    ? "Invalid format"
                    : multiEpisodeSampleResult.FileName;

            sampleResource.DailyEpisodeExample = _filenameValidationService.ValidateDailyFilename(dailyEpisodeSampleResult) != null
                    ? "Invalid format"
                    : dailyEpisodeSampleResult.FileName;

            sampleResource.AnimeEpisodeExample = _filenameValidationService.ValidateAnimeFilename(animeEpisodeSampleResult) != null
                    ? "Invalid format"
                    : animeEpisodeSampleResult.FileName;

            sampleResource.AnimeMultiEpisodeExample = _filenameValidationService.ValidateAnimeFilename(animeMultiEpisodeSampleResult) != null
                    ? "Invalid format"
                    : animeMultiEpisodeSampleResult.FileName;

            sampleResource.SeriesFolderExample = nameSpec.SeriesFolderFormat.IsNullOrWhiteSpace()
                ? "Invalid format"
                : _filenameSampleService.GetSeriesFolderSample(nameSpec);

            sampleResource.SeasonFolderExample = nameSpec.SeasonFolderFormat.IsNullOrWhiteSpace()
                ? "Invalid format"
                : _filenameSampleService.GetSeasonFolderSample(nameSpec);

            sampleResource.SpecialsFolderExample = nameSpec.SpecialsFolderFormat.IsNullOrWhiteSpace()
                ? "Invalid format"
                : _filenameSampleService.GetSpecialsFolderSample(nameSpec);

            return(sampleResource);
        }