/// <summary> /// Verifies if the episode being reimported matches the episode in the nfo file /// </summary> /// <param name="reader">Reader used read the episode information from the nfo file</param> /// <param name="reimport">The episode being reimported</param> /// <returns>Result of the verification</returns> protected bool VerifyEpisodeReimport(NfoSeriesEpisodeReader reader, EpisodeInfo reimport) { if (reimport == null) { return(true); } IDictionary <Guid, IList <MediaItemAspect> > aspectData = new Dictionary <Guid, IList <MediaItemAspect> >(); if (reader.TryWriteMetadata(aspectData)) { EpisodeInfo info = new EpisodeInfo(); info.FromMetadata(aspectData); if (reimport.Equals(info)) { return(true); } } return(false); }
public bool TryMatch(IDictionary <Guid, IList <MediaItemAspect> > extractedAspects, IDictionary <Guid, IList <MediaItemAspect> > existingAspects) { if (!existingAspects.ContainsKey(EpisodeAspect.ASPECT_ID)) { return(false); } EpisodeInfo linkedEpisode = new EpisodeInfo(); if (!linkedEpisode.FromMetadata(extractedAspects)) { return(false); } EpisodeInfo existingEpisode = new EpisodeInfo(); if (!existingEpisode.FromMetadata(existingAspects)) { return(false); } return(linkedEpisode.Equals(existingEpisode)); }