Exemple #1
0
        /// <summary>
        /// Verifies if the movie being reimported matches the movie in the nfo file
        /// </summary>
        /// <param name="reader">Reader used read the movie information from the nfo file</param>
        /// <param name="reimport">The movie being reimported</param>
        /// <returns>Result of the verification</returns>
        protected bool VerifyMovieReimport(NfoMovieReader reader, MovieInfo reimport)
        {
            if (reimport == null)
            {
                return(true);
            }

            IDictionary <Guid, IList <MediaItemAspect> > aspectData = new Dictionary <Guid, IList <MediaItemAspect> >();

            if (reader.TryWriteMetadata(aspectData))
            {
                MovieInfo info = new MovieInfo();
                info.FromMetadata(aspectData);
                if (reimport.Equals(info))
                {
                    return(true);
                }
            }
            return(false);
        }
Exemple #2
0
        public bool TryMatch(IDictionary <Guid, IList <MediaItemAspect> > extractedAspects, IDictionary <Guid, IList <MediaItemAspect> > existingAspects)
        {
            if (!existingAspects.ContainsKey(MovieAspect.ASPECT_ID))
            {
                return(false);
            }

            MovieInfo linkedMovie = new MovieInfo();

            if (!linkedMovie.FromMetadata(extractedAspects))
            {
                return(false);
            }

            MovieInfo existingMovie = new MovieInfo();

            if (!existingMovie.FromMetadata(existingAspects))
            {
                return(false);
            }

            return(linkedMovie.Equals(existingMovie));
        }