Пример #1
0
        public static void Transform(Disc disc)
        {
            var raw = new DiscMetadata.RawMetadata
            {
                HardwareVolumeLabel = GetHardwareVolumeLabel(disc),
                DiscInf             = GetAnyDVDDiscInf(disc),
                AllBdmtTitles       = GetAllBdmtTitles(disc),
                DboxTitle           = GetDboxTitle(disc),
                V_ISAN = GetVISAN(disc)
            };

            var derived = new DiscMetadata.DerivedMetadata
            {
                VolumeLabel          = GetVolumeLabel(raw),
                VolumeLabelSanitized = GetVolumeLabelSanitized(raw),
                ValidBdmtTitles      = GetValidBdmtTitles(raw.AllBdmtTitles),
                DboxTitleSanitized   = GetDboxTitleSanitized(raw),
                SearchQueries        = new List <SearchQuery>() /* populated by DiscTransformer */
            };

            var metadata = new DiscMetadata
            {
                Raw     = raw,
                Derived = derived
            };

            disc.Metadata = metadata;
        }
Пример #2
0
        private static string GenerateQuickSummary(DiscMetadata metadata, DiscFileSystem fs)
        {
            var volumeLabel = metadata.Derived.VolumeLabel;
            var fullPath    = fs.Directories.Root.FullName;

            if (fullPath.EndsWith(volumeLabel))
            {
                return(fullPath);
            }
            return(string.Format("{0} ({1})", fullPath, volumeLabel));
        }
Пример #3
0
        internal static Job CreateMovieJob()
        {
            var metadata = new DiscMetadata
            {
                Derived = new DiscMetadata.DerivedMetadata
                {
                    VolumeLabel = "EMPIRE_STRIKES_BACK"
                }
            };
            var disc = new Disc
            {
                Metadata  = metadata,
                Playlists = new List <Playlist>
                {
                    new Playlist
                    {
                        Tracks = new List <Track>
                        {
                            new Track
                            {
                                IsVideo     = true,
                                Codec       = Codec.AVC,
                                Type        = TrackType.MainFeature,
                                VideoFormat = TSVideoFormat.VIDEOFORMAT_1080p,
                                AspectRatio = TSAspectRatio.ASPECT_16_9,
                                Index       = 0,
                                IndexOfType = 0,
                                IsBestGuess = true,
                                Keep        = true,
                                Language    = Language.English
                            },
                            new Track
                            {
                                IsAudio      = true,
                                Codec        = Codec.DTSHDMA,
                                Type         = TrackType.MainFeature,
                                ChannelCount = 6.1,
                                Index        = 1,
                                IndexOfType  = 0,
                                IsBestGuess  = true,
                                Keep         = true,
                                Language     = Language.English
                            },
                            new Track
                            {
                                IsSubtitle  = true,
                                Codec       = Codec.PGS,
                                Type        = TrackType.MainFeature,
                                Index       = 2,
                                IndexOfType = 0,
                                IsBestGuess = true,
                                Keep        = true,
                                Language    = Language.English
                            },
                        }
                    }
                }
            };
            var job = new Job(disc)
            {
                ReleaseMediumType = ReleaseMediumType.Movie,
                SearchQuery       = new SearchQuery
                {
                    Title    = "Star Wars: Episode V - The Empire Strikes Back",
                    Year     = 1980,
                    Language = Language.English
                }
            };

            job.Movies.Add(new Movie
            {
                IsSelected  = true,
                Title       = "Star Wars: Episode V - The Empire Strikes Back",
                ReleaseYear = 1980,
                Id          = 1891,
                Url         = "http://www.themoviedb.org/movie/1891-star-wars-episode-v-the-empire-strikes-back"
            });
            return(job);
        }
Пример #4
0
        internal static Job CreateTVShowJob()
        {
            var metadata = new DiscMetadata
            {
                Derived = new DiscMetadata.DerivedMetadata
                {
                    VolumeLabel = "SCRUBS_S1_D1"
                }
            };
            var disc = new Disc
            {
                Metadata  = metadata,
                Playlists = new List <Playlist>
                {
                    new Playlist
                    {
                        Tracks = new List <Track>
                        {
                            new Track
                            {
                                IsVideo     = true,
                                Codec       = Codec.AVC,
                                Type        = TrackType.MainFeature,
                                VideoFormat = TSVideoFormat.VIDEOFORMAT_1080p,
                                AspectRatio = TSAspectRatio.ASPECT_16_9,
                                Index       = 0,
                                IndexOfType = 0,
                                IsBestGuess = true,
                                Keep        = true,
                                Language    = Language.English
                            },
                            new Track
                            {
                                IsAudio      = true,
                                Codec        = Codec.DTSHDMA,
                                Type         = TrackType.MainFeature,
                                ChannelCount = 5.1,
                                Index        = 1,
                                IndexOfType  = 0,
                                IsBestGuess  = true,
                                Keep         = true,
                                Language     = Language.English
                            },
                            new Track
                            {
                                IsSubtitle  = true,
                                Codec       = Codec.PGS,
                                Type        = TrackType.MainFeature,
                                Index       = 2,
                                IndexOfType = 0,
                                IsBestGuess = true,
                                Keep        = true,
                                Language    = Language.English
                            },
                        }
                    }
                }
            };
            var job = new Job(disc)
            {
                ReleaseMediumType = ReleaseMediumType.TVShow,
                SearchQuery       = new SearchQuery
                {
                    Title    = "Scrubs",
                    Year     = 2001,
                    Language = Language.English
                }
            };
            var tvShow = new TVShow
            {
                IsSelected           = true,
                Title                = "Scrubs",
                Id                   = 76156,
                Url                  = "http://thetvdb.com/?tab=series&id=76156&lid=7",
                SelectedEpisodeIndex = 0
            };

            tvShow.Episodes.AddRange(new[]
            {
                new TVShow.Episode
                {
                    SeasonNumber  = 1,
                    EpisodeNumber = 1,
                    Title         = "My First Day",
                    Id            = 184602,
                    ReleaseDate   = DateTime.Parse("2001-10-02")
                }
            });
            job.TVShows.Add(tvShow);
            return(job);
        }