ToString() публичный Метод

public ToString ( ) : string
Результат string
        public MatchResult GetMatchResult(DBMovieInfo movie)
        {
            // Create a new score card
            MatchResult result = new MatchResult();

            // Get the default scores for this movie
            result.TitleScore = matchTitle(movie.Title);
            result.YearScore = matchYear(movie.Year);
            result.ImdbMatch = matchImdb(movie.ImdbID);

            // check if this match came from our #1 details provider
            ReadOnlyCollection<DBSourceInfo> detailSources = MovingPicturesCore.DataProviderManager.MovieDetailSources;
            if (detailSources.Count > 0 && detailSources[0] == movie.PrimarySource)
                result.FromTopSource = true;
            else
                result.FromTopSource = false;

            // If we don't have a perfect score on the original title
            // iterate through the available alternate titles and check
            // them to lower the score if possible
            if (result.TitleScore > 0) {
                foreach (string alternateTitle in movie.AlternateTitles.ToArray()) {
                    int score = matchTitle(alternateTitle);
                    // if this match is better than the previous one save the score
                    if (score < result.TitleScore) {
                        result.TitleScore = score;
                        result.AlternateTitle = alternateTitle;
                    }
                    // if the best score is 0 (the best possible score) then stop score checking
                    if (result.TitleScore == 0) break;
                }
            }

            // return the result
            logger.Debug("MATCHING: '{0}' WITH: '{1}' RESULT: {2}", this.baseTitle, movie.Title, result.ToString());
            return result;
        }
Пример #2
0
        public MatchResult GetMatchResult(DBMovieInfo movie)
        {
            // Create a new score card
            MatchResult result = new MatchResult();

            // Get the default scores for this movie
            result.TitleScore = matchTitle(movie.Title);
            result.YearScore  = matchYear(movie.Year);
            result.ImdbMatch  = matchImdb(movie.ImdbID);

            // check if this match came from our #1 details provider
            ReadOnlyCollection <DBSourceInfo> detailSources = MovingPicturesCore.DataProviderManager.MovieDetailSources;

            if (detailSources.Count > 0 && detailSources[0] == movie.PrimarySource)
            {
                result.FromTopSource = true;
            }
            else
            {
                result.FromTopSource = false;
            }

            // If we don't have a perfect score on the original title
            // iterate through the available alternate titles and check
            // them to lower the score if possible
            if (result.TitleScore > 0)
            {
                foreach (string alternateTitle in movie.AlternateTitles.ToArray())
                {
                    int score = matchTitle(alternateTitle);
                    // if this match is better than the previous one save the score
                    if (score < result.TitleScore)
                    {
                        result.TitleScore     = score;
                        result.AlternateTitle = alternateTitle;
                    }
                    // if the best score is 0 (the best possible score) then stop score checking
                    if (result.TitleScore == 0)
                    {
                        break;
                    }
                }
            }

            // return the result
            logger.Debug("MATCHING: '{0}' WITH: '{1}' RESULT: {2}", this.baseTitle, movie.Title, result.ToString());
            return(result);
        }