Exemplo n.º 1
0
        public static bool IsFilmValidImdbMatch(Film film, ImdbObject imdbObject)
        {

            if (imdbObject == null)
                return false;

            if (string.IsNullOrEmpty(imdbObject.Poster) || imdbObject.Poster.Equals("N/A"))
                return false;

            foreach (var person in film.InvolvedPersons)
            {
                if (string.IsNullOrEmpty(person.Name))
                    continue;

                var personNames = person.Name.Split(',');
                string personName;
                if (personNames.Length > 1)
                    personName = personNames[1] + " " + personNames[0];
                else
                    personName = personNames[0];

                personName = personName.Trim();

                if (imdbObject.Director.Split(',').Any(director => director.Trim().Equals(personName)))
                    return true;

                if (imdbObject.Writer.Split(',').Any(writer => writer.Trim().Equals(personName)))
                    return true;

            }

            return false;
        }
Exemplo n.º 2
0
        public static DocumentDto Map(Film film)
        {
            var filmDto = new FilmDto();
            
            if(null != film.Actors) filmDto.ActorNames = film.Actors.Select(a => a.Name).ToArray();
            
            filmDto.AgeLimit = film.AgeLimit;
            
            if(null != film.Genre) filmDto.Genres = film.Genre.ToArray();
            
            filmDto.MediaInfo = film.TypeAndNumberOfDiscs;
            
            if(null != film.ReferredPersons) filmDto.ReferredPeopleNames = film.ReferredPersons.Select(p => p.Name).ToArray();
            if(null != film.ReferencedPlaces) filmDto.ReferencedPlaces = film.ReferencedPlaces.ToArray();
            if(null != film.SubtitleLanguage) filmDto.SubtitleLanguages = film.SubtitleLanguage.ToArray();
            if(null != film.InvolvedPersons) filmDto.InvolvedPersonNames = film.InvolvedPersons.Select(p => string.Format("{0} ({1})", p.Name, p.Role)).ToArray();
            if(null != film.ResponsiblePersons) filmDto.ResponsiblePersonNames = film.ResponsiblePersons.ToArray();

            return filmDto;
        }
Exemplo n.º 3
0
 public static string GetFilmSearchQuery(Film film)
 {
     var searchTitle = film.SeriesTitle + " " + film.SeriesNumber + " " + film.Title + " " + film.SubTitle;
     searchTitle = searchTitle.Replace("null", "").Trim();
     return searchTitle;
 }
Exemplo n.º 4
0
        public new static Film GetObjectFromFindDocXmlBsMarcLight(string xml)
        {
            var film = new Film();

            film.FillPropertiesLight(xml);

            return film;
        }