Пример #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
 private static string GetVolumeLabelSanitized(DiscMetadata.RawMetadata raw)
 {
     return SanitizeVolumeLabel(GetVolumeLabel(raw));
 }
Пример #4
0
 private static string GetVolumeLabel(DiscMetadata.RawMetadata raw)
 {
     return raw.DiscInf != null ? raw.DiscInf.VolumeLabel : raw.HardwareVolumeLabel;
 }
Пример #5
0
 private static string GetDboxTitleSanitized(DiscMetadata.RawMetadata raw)
 {
     return SanitizeTitle(raw.DboxTitle);
 }
Пример #6
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;
 }
Пример #7
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;
 }
Пример #8
0
        private static void Lookup(ProgressToken token, DiscMetadata.RawMetadata raw, DiscMetadata.DerivedMetadata derived)
        {
            var provider = new IsanMetadataProvider(token);

            provider.Populate(raw.V_ISAN);

            var isan = raw.ISAN;
            if (isan != null && !string.IsNullOrWhiteSpace(isan.Title))
            {
                // TODO: Get language from isan.org
                // Don't insert twice
                if (!derived.SearchQueries.Any(query => query.Title == isan.Title && query.Year == isan.Year))
                    derived.SearchQueries.Insert(0, new SearchQuery { Title = isan.Title, Year = isan.Year });
            }
        }