Esempio n. 1
0
        public static DBSourceMovieInfo Get(DBMovieInfo movie, DBSourceInfo source)
        {
            foreach (DBSourceMovieInfo currInfo in movie.SourceMovieInfo)
            {
                if (currInfo.Source == source)
                {
                    return(currInfo);
                }
            }

            return(null);
        }
Esempio n. 2
0
        public static DBSourceMovieInfo GetOrCreate(DBMovieInfo movie, DBSourceInfo source)
        {
            DBSourceMovieInfo rtn = Get(movie, source);

            if (rtn != null)
            {
                return(rtn);
            }

            rtn        = new DBSourceMovieInfo();
            rtn.Movie  = movie;
            rtn.Source = source;

            // if this is the IMDb data source, populate the id with the imdb_id field
            if (rtn.ScriptID == 874902 && !string.IsNullOrEmpty(movie.ImdbID) && movie.ImdbID.Trim().Length == 9)
            {
                rtn.Identifier = movie.ImdbID;
            }

            movie.SourceMovieInfo.Add(rtn);
            return(rtn);
        }
Esempio n. 3
0
 public DBSourceMovieInfo GetSourceMovieInfo(DBSourceInfo source)
 {
     return(DBSourceMovieInfo.GetOrCreate(this, source));
 }
Esempio n. 4
0
 public static DBSourceMovieInfo Get(DBMovieInfo movie, int scriptID)
 {
     return(Get(movie, DBSourceInfo.GetFromScriptID(scriptID)));
 }