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; }
private static void AddSearchQuery(DiscMetadata.RawMetadata raw, DiscMetadata.DerivedMetadata derived) { 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 }); } } }
private static void Lookup(ProgressToken token, DiscMetadata.RawMetadata raw, DiscMetadata.DerivedMetadata derived) { var provider = new IsanMetadataProvider(token); provider.Populate(raw.V_ISAN); }
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 }); } } }