• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Database.IMDBMovie类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MediaPortal.Video.Database.IMDBMovie的典型用法代码示例。如果您正苦于以下问题:C# IMDBMovie类的具体用法?C# IMDBMovie怎么用?C# IMDBMovie使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IMDBMovie类属于MediaPortal.Video.Database命名空间,在下文中一共展示了IMDBMovie类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Select

 public void Select(IMDBMovie movie)
 {
   FilterDefinition definition = (FilterDefinition)currentView.Filters[CurrentLevel];
   definition.SelectedValue = GetFieldIdValue(movie, definition.Where).ToString();
   if (currentLevel + 1 < currentView.Filters.Count)
   {
     currentLevel++;
   }
 }
开发者ID:npcomplete111,项目名称:MediaPortal-1,代码行数:9,代码来源:VideoViewHandler.cs


示例2: NowPlayingVideo

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="aMovie">The currently playing movie</param>
        public NowPlayingVideo(IMDBMovie aMovie)
        {
            ItemId = aMovie.ID;
            Summary = aMovie.Plot;
            Title = aMovie.Title;
            Tagline = aMovie.TagLine;
            Directors = aMovie.Director;
            Writers = aMovie.WritingCredits;
            Actors = aMovie.Cast;
            Rating = aMovie.Rating.ToString();
            Year = aMovie.Year;
            Genres = aMovie.Genre;
            Certification = aMovie.MPARating;

            ImageUrl = aMovie.ThumbURL;
        }
开发者ID:johanj,项目名称:WifiRemote,代码行数:20,代码来源:NowPlayingVideo.cs


示例3: CreatePlaylistItemFromVideoFile

        /// <summary>
        /// Create playlist item from a file
        /// </summary>
        /// <param name="file">Path to file</param>
        /// <returns>Playlist item</returns>
        internal static MediaPortal.Playlists.PlayListItem CreatePlaylistItemFromVideoFile(string file)
        {
            FileInfo info = new FileInfo(file);
            MediaPortal.Playlists.PlayListItem item = new MediaPortal.Playlists.PlayListItem();
            item.Description = info.Name;
            item.FileName = info.FullName;
            item.Type = PlayListItem.PlayListItemType.Video;
            //item.Duration
            IMDBMovie movie = new IMDBMovie();
            int id = VideoDatabase.GetMovieInfo(file, ref movie);

            if (id > 0)
            {
                item.Duration = movie.RunTime;
            }

            return item;
        }
开发者ID:johanj,项目名称:WifiRemote,代码行数:23,代码来源:MpVideosHelper.cs


示例4: AddItemToPlaylist

        /// <summary>
        /// Adds a song to a playlist
        /// </summary>
        /// <param name="type">Type of the playlist</param>
        /// <param name="entry">Item that gets added</param>
        /// <param name="index">Index where the item should be added</param>
        /// <param name="refresh">Should the playlist be refreshed after the item is added</param>
        public static void AddItemToPlaylist(String type, PlaylistEntry entry, int index, bool refresh)
        {
            PlayListType plType = GetTypeFromString(type);
            PlayListPlayer playListPlayer = PlayListPlayer.SingletonPlayer;
            PlayList playList = playListPlayer.GetPlaylist(plType);
            PlayListItem item = null;

            //If it's a music item, try to find it in the db
            if (plType == PlayListType.PLAYLIST_MUSIC)
            {
                MusicDatabase mpMusicDb = MusicDatabase.Instance;
                Song song = new Song();
                bool inDb = mpMusicDb.GetSongByFileName(entry.FileName, ref song);

                if (inDb)
                {
                    item = ToPlayListItem(song);
                }
            }
            else if (plType == PlayListType.PLAYLIST_VIDEO)
            {
                IMDBMovie movie = new IMDBMovie();
                int id = VideoDatabase.GetMovieInfo(entry.FileName, ref movie);

                if (id > 0)
                {
                    item = ToPlayListItem(movie);
                }
            }

            if (item == null)
            {
                item = new PlayListItem(entry.Name, entry.FileName, entry.Duration);
            }

            playList.Insert(item, index);

            if (refresh)
            {
                RefreshPlaylistIfVisible();
            }
        }
开发者ID:Kucheek,项目名称:WifiRemote,代码行数:49,代码来源:PlaylistHelper.cs


示例5: CreateScrobbleData

        /// <summary>
        /// Creates Scrobble data based on a IMDBMovie object
        /// </summary>
        /// <param name="movie">The movie to base the object on</param>
        /// <returns>The Trakt scrobble data to send</returns>
        public static TraktMovieScrobble CreateScrobbleData(IMDBMovie movie)
        {
            string username = TraktSettings.Username;
            string password = TraktSettings.Password;

            if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password))
                return null;

            TraktMovieScrobble scrobbleData = new TraktMovieScrobble
            {
                Title = movie.Title,
                Year = movie.Year.ToString(),
                IMDBID = movie.IMDBNumber,
                PluginVersion = TraktSettings.Version,
                MediaCenter = "Mediaportal",
                MediaCenterVersion = Assembly.GetEntryAssembly().GetName().Version.ToString(),
                MediaCenterBuildDate = String.Empty,
                UserName = username,
                Password = password
            };
            return scrobbleData;
        }
开发者ID:MichelZ,项目名称:Trakt-for-Mediaportal,代码行数:27,代码来源:MyVideos.cs


示例6: SetDurationProperty

    public void SetDurationProperty(int movieId) 
    {
      if (RunTime <= 0)
      {
        IMDBMovie movie = new IMDBMovie();
        VideoDatabase.GetMovieInfoById(movieId, ref movie);
        RunTime = movie.RunTime;
      }
      GUIPropertyManager.SetProperty("#runtime", RunTime + 
                              " " +
                              GUILocalizeStrings.Get(2998) +
                              " (" + Util.Utils.SecondsToHMString(RunTime * 60) + ")");

      int duration = VideoDatabase.GetMovieDuration(movieId);

      if (duration <= 0)
      {
        GUIPropertyManager.SetProperty("#videoruntime", string.Empty);
      }
      else
      {
        GUIPropertyManager.SetProperty("#videoruntime", Util.Utils.SecondsToHMSString(duration));
      }
    }
开发者ID:elliottmc,项目名称:MediaPortal-1,代码行数:24,代码来源:IMDBMovie.cs


示例7: SetLatestMovieProperties

    private void SetLatestMovieProperties()
    {
      string strSQL = "SELECT * FROM movieinfo ORDER BY dateAdded DESC LIMIT 3";
      ArrayList movies = new ArrayList();
      GetMoviesByFilter(strSQL, out movies, false, true, false, false);
      
      IMDBMovie movie1 = new IMDBMovie();
      IMDBMovie movie2 = new IMDBMovie();
      IMDBMovie movie3 = new IMDBMovie();

      GUIPropertyManager.SetProperty("#myvideos.latest1.enabled", "false");
      GUIPropertyManager.SetProperty("#myvideos.latest2.enabled", "false");
      GUIPropertyManager.SetProperty("#myvideos.latest3.enabled", "false");

      if (movies.Count > 0)
      {
        movie1 = (IMDBMovie) movies[0];
        // Movie 1
        GUIPropertyManager.SetProperty("#myvideos.latest1.genre", movie1.Genre.Replace(" /", ","));
        //
        string poster = string.Empty;
        string titleExt = movie1.Title + "{" + movie1.ID + "}";
        poster = Util.Utils.GetLargeCoverArtName(Thumbs.MovieTitle, titleExt);
        GUIPropertyManager.SetProperty("#myvideos.latest1.thumb", poster);
        //
        GUIPropertyManager.SetProperty("#myvideos.latest1.title", movie1.Title);
        GUIPropertyManager.SetProperty("#myvideos.latest1.year", movie1.Year.ToString());
        //
        DateTime dateAdded;
        DateTime.TryParseExact(movie1.DateAdded, "yyyy-MM-dd HH:mm:ss", CultureInfo.CurrentCulture, DateTimeStyles.None, out dateAdded);
        GUIPropertyManager.SetProperty("#myvideos.latest1.dateAdded", dateAdded.ToShortDateString());
        //
        GUIPropertyManager.SetProperty("#myvideos.latest1.runtime", movie1.RunTime +
                                " " +
                                GUILocalizeStrings.Get(2998) +
                                " (" + Util.Utils.SecondsToHMString(movie1.RunTime * 60) + ")");
        GUIPropertyManager.SetProperty("#myvideos.latest1.enabled", "true");

        if (movies.Count > 1)
        {
          movie2 = (IMDBMovie) movies[1];
          // Movie 2
          GUIPropertyManager.SetProperty("#myvideos.latest2.genre", movie2.Genre.Replace(" /", ","));
          //
          poster = string.Empty;
          titleExt = movie2.Title + "{" + movie2.ID + "}";
          poster = Util.Utils.GetLargeCoverArtName(Thumbs.MovieTitle, titleExt);
          GUIPropertyManager.SetProperty("#myvideos.latest2.thumb", poster);
          //
          GUIPropertyManager.SetProperty("#myvideos.latest2.title", movie2.Title);
          GUIPropertyManager.SetProperty("#myvideos.latest2.year", movie2.Year.ToString());
          //
          DateTime.TryParseExact(movie2.DateAdded, "yyyy-MM-dd HH:mm:ss", CultureInfo.CurrentCulture, DateTimeStyles.None, out dateAdded);
          GUIPropertyManager.SetProperty("#myvideos.latest2.dateAdded", dateAdded.ToShortDateString());
          //
          GUIPropertyManager.SetProperty("#myvideos.latest2.runtime", movie2.RunTime +
                                  " " +
                                  GUILocalizeStrings.Get(2998) +
                                  " (" + Util.Utils.SecondsToHMString(movie2.RunTime * 60) + ")");
          GUIPropertyManager.SetProperty("#myvideos.latest2.enabled", "true");
        }

        if (movies.Count > 2)
        {
          movie3 = (IMDBMovie) movies[2];
          // Movie 3
          GUIPropertyManager.SetProperty("#myvideos.latest3.genre", movie3.Genre.Replace(" /", ","));
          //
          poster = string.Empty;
          titleExt = movie3.Title + "{" + movie3.ID + "}";
          poster = Util.Utils.GetLargeCoverArtName(Thumbs.MovieTitle, titleExt);
          GUIPropertyManager.SetProperty("#myvideos.latest3.thumb", poster);
          //
          GUIPropertyManager.SetProperty("#myvideos.latest3.title", movie3.Title);
          GUIPropertyManager.SetProperty("#myvideos.latest3.year", movie3.Year.ToString());
          //
          DateTime.TryParseExact(movie3.DateAdded, "yyyy-MM-dd HH:mm:ss", CultureInfo.CurrentCulture, DateTimeStyles.None, out dateAdded);
          GUIPropertyManager.SetProperty("#myvideos.latest3.dateAdded", dateAdded.ToShortDateString());
          //
          GUIPropertyManager.SetProperty("#myvideos.latest3.runtime", movie3.RunTime +
                                  " " +
                                  GUILocalizeStrings.Get(2998) +
                                  " (" + Util.Utils.SecondsToHMString(movie3.RunTime * 60) + ")");
          GUIPropertyManager.SetProperty("#myvideos.latest3.enabled", "true");
        }
      }
    }
开发者ID:akhilgt,项目名称:MediaPortal-1,代码行数:87,代码来源:VideoDatabaseSqlLite.cs


示例8: MakeNfo

    public bool MakeNfo (int movieId)
    {
      string moviePath = string.Empty;
      string movieFile = string.Empty;
      ArrayList movieFiles = new ArrayList();
      ArrayList nfoFiles = new ArrayList();
      string nfoFile = string.Empty;
      int fileCounter = 0;

      try
      {
        // Get files
        GetFilesForMovie(movieId, ref movieFiles);

        foreach (string file in movieFiles)
        {
          if (!File.Exists(file))
          {
            return false;
          }

          movieFile = file;
          Util.Utils.Split(movieFile, out moviePath, out movieFile);

          // Check for DVD folder
          if (movieFile.ToUpperInvariant() == "VIDEO_TS.IFO" || movieFile.ToUpperInvariant() == "INDEX.BDMV")
          {
            // Remove \VIDEO_TS from directory structure
            string directoryDVD = moviePath.Substring(0, moviePath.LastIndexOf(@"\"));

            if (Directory.Exists(directoryDVD))
            {
              moviePath = directoryDVD;
              movieFile = directoryDVD;
            }
          }
          else
          {
            if (fileCounter > 0)
            {
              return true;
            }
          }
          // remove stack endings (CDx..) form filename
          Util.Utils.RemoveStackEndings(ref movieFile);
          // Remove file extension
          movieFile = Util.Utils.GetFilename(movieFile, true).Trim();
          // Add nfo extension
          nfoFile = moviePath + @"\" + movieFile + ".nfo";
          Util.Utils.FileDelete(nfoFile);
          nfoFiles.Add(nfoFile);
          //}

          IMDBMovie movieDetails = new IMDBMovie();
          GetMovieInfoById(movieId, ref movieDetails);
          // Prepare XML
          XmlDocument doc = new XmlDocument();
          XmlDeclaration xmldecl = doc.CreateXmlDeclaration("1.0", "UTF-8", null);

          // Main tag
          XmlNode mainNode = doc.CreateElement("movie");
          XmlNode subNode;

          #region Movie fields

          // Filenames
          foreach (string strMovieFile in movieFiles)
          {
            CreateXmlNode(mainNode, doc, "filenameandpath", strMovieFile);
          }

          // Title
          CreateXmlNode(mainNode, doc, "title", movieDetails.Title);
          // Sort Title
          if (!string.IsNullOrEmpty(movieDetails.SortTitle))
          {
            CreateXmlNode(mainNode, doc, "sorttitle", movieDetails.SortTitle);
          }
          else
          {
            CreateXmlNode(mainNode, doc, "sorttitle", movieDetails.Title);
          }

          //  movie IMDB number
          CreateXmlNode(mainNode, doc, "imdb", movieDetails.IMDBNumber);
          CreateXmlNode(mainNode, doc, "id", movieDetails.IMDBNumber);
          //  Language
          CreateXmlNode(mainNode, doc, "language", movieDetails.Language);
          //  Country
          CreateXmlNode(mainNode, doc, "country", movieDetails.Country);
          //  Year
          CreateXmlNode(mainNode, doc, "year", movieDetails.Year.ToString());
          //  Rating
          CreateXmlNode(mainNode, doc, "rating", movieDetails.Rating.ToString().Replace(",", "."));
          //  Runtime
          CreateXmlNode(mainNode, doc, "runtime", movieDetails.RunTime.ToString());
          // MPAA
          CreateXmlNode(mainNode, doc, "mpaa", movieDetails.MPARating);
          // Votes
          CreateXmlNode(mainNode, doc, "votes", movieDetails.Votes);
//.........这里部分代码省略.........
开发者ID:akhilgt,项目名称:MediaPortal-1,代码行数:101,代码来源:VideoDatabaseSqlLite.cs


示例9: ImportNfoUsingVideoFile

    public void ImportNfoUsingVideoFile(string videoFile, bool skipExisting, bool refreshdbOnly)
    {
      try
      {
        string nfoFile = string.Empty;
        string path = string.Empty;
        bool isbdDvd = false;
        string nfoExt = ".nfo";

        if (videoFile.ToUpper().IndexOf(@"\VIDEO_TS\VIDEO_TS.IFO", StringComparison.InvariantCultureIgnoreCase) >= 0)
        {
          //DVD folder
          path = videoFile.Substring(0, videoFile.ToUpper().IndexOf(@"\VIDEO_TS\VIDEO_TS.IFO", StringComparison.InvariantCultureIgnoreCase));
          isbdDvd = true;
        }
        else if (videoFile.ToUpper().IndexOf(@"\BDMV\INDEX.BDMV", StringComparison.InvariantCultureIgnoreCase) >= 0)
        {
          //BD folder
          path = videoFile.Substring(0, videoFile.ToUpper().IndexOf(@"\BDMV\INDEX.BDMV", StringComparison.InvariantCultureIgnoreCase));
          isbdDvd = true;
        }

        if (isbdDvd)
        {
          string cleanFile = string.Empty;
          cleanFile = Path.GetFileNameWithoutExtension(videoFile);
          Util.Utils.RemoveStackEndings(ref cleanFile);
          nfoFile = path + @"\" + cleanFile + nfoExt;

          if (!File.Exists(nfoFile))
          {
            cleanFile = Path.GetFileNameWithoutExtension(path);
            Util.Utils.RemoveStackEndings(ref cleanFile);
            nfoFile = path + @"\" + cleanFile + nfoExt;
          }
        }
        else
        {
          string cleanFile = string.Empty;
          string strPath, strFilename;
          DatabaseUtility.Split(videoFile, out strPath, out strFilename);
          cleanFile = strFilename;
          Util.Utils.RemoveStackEndings(ref cleanFile);
          cleanFile = strPath + cleanFile;
          nfoFile = Path.ChangeExtension(cleanFile, nfoExt);
        }

        Log.Debug("Importing nfo:{0} using video file:{1}", nfoFile, videoFile);

        if (!File.Exists(nfoFile))
        {
          return;
        }

        IMDBMovie movie = new IMDBMovie();
        int id = GetMovieInfo(videoFile, ref movie);
        
        if (skipExisting && id > 0)
        {
          movie = null;
          return;
        }

        ImportNfo(nfoFile, skipExisting, refreshdbOnly);
        movie = null;
      }
      catch (Exception ex)
      {
        Log.Error("Error importing nfo for file {0} Error:{1} ", videoFile, ex);
      }
    }
开发者ID:akhilgt,项目名称:MediaPortal-1,代码行数:71,代码来源:VideoDatabaseSqlLite.cs


示例10: GetIndexByFilter

    public void GetIndexByFilter(string sql, bool filterNonWordChar, out ArrayList movieList)
    {
      movieList = new ArrayList();
      try
      {
        if (null == m_db)
        {
          return;
        }

        SQLiteResultSet results = GetResults(sql);
        bool nonWordCharFound = false;
        int nwCount = 0;

        // Count nowWord items
        if (filterNonWordChar)
        {
          for (int i = 0; i < results.Rows.Count; i++)
          {
            SQLiteResultSet.Row fields = results.Rows[i];

            if (Regex.Match(fields.fields[0], @"\W|\d").Success)
            {
              int iCount = Convert.ToInt32(fields.fields[1]);
              nwCount = nwCount + iCount;
            }
          }
        }

        for (int i = 0; i < results.Rows.Count; i++)
        {
          IMDBMovie movie = new IMDBMovie();
          SQLiteResultSet.Row fields = results.Rows[i];
          string value = fields.fields[0];
          int countN = Convert.ToInt32(fields.fields[1]);

          if (filterNonWordChar && Regex.Match(fields.fields[0], @"\W|\d").Success)
          {
            if (!nonWordCharFound)
            {
              value = "#";
              nonWordCharFound = true;
              countN = nwCount;
            }
            else
            {
              continue;
            }
          }

          movie.Title = value;
          movie.RunTime = countN;
          movieList.Add(movie);
        }
      }
      catch (Exception ex)
      {
        Log.Error("videodatabase exception err:{0} stack:{1}", ex.Message, ex.StackTrace);
        Open();
      }
    }
开发者ID:akhilgt,项目名称:MediaPortal-1,代码行数:61,代码来源:VideoDatabaseSqlLite.cs


示例11: GetRandomMoviesByPath

    public void GetRandomMoviesByPath(string strPath1, ref ArrayList movies, int limit)
    {
      try
      {
        string strPath = strPath1;

        if (strPath.Length > 0)
        {
          if (strPath[strPath.Length - 1] == '/' || strPath[strPath.Length - 1] == '\\')
          {
            strPath = strPath.Substring(0, strPath.Length - 1);
          }
        }

        DatabaseUtility.RemoveInvalidChars(ref strPath);
        movies.Clear();

        if (null == m_db)
        {
          return;
        }

        int lPathId = GetPath(strPath);

        if (lPathId < 0)
        {
          return;
        }

        string strSQL =
          String.Format("SELECT * FROM files,movieinfo WHERE files.idpath={0} AND files.idMovie=movieinfo.idMovie ORDER BY RANDOM() LIMIT {1}",
                        lPathId, limit);
        SQLiteResultSet results = m_db.Execute(strSQL);

        if (results.Rows.Count == 0)
        {
          return;
        }

        for (int iRow = 0; iRow < results.Rows.Count; iRow++)
        {
          IMDBMovie details = new IMDBMovie();
          SetMovieDetails(ref details, iRow, results);
          movies.Add(details);
        }
      }
      catch (ThreadAbortException)
      {
        // Will be logged in thread main code
      }
      catch (Exception ex)
      {
        Log.Error("videodatabase exception err:{0} stack:{1}", ex.Message, ex.StackTrace);
        Open();
      }
    }
开发者ID:akhilgt,项目名称:MediaPortal-1,代码行数:56,代码来源:VideoDatabaseSqlLite.cs


示例12: DeleteMovieInfoById

    public void DeleteMovieInfoById(long lMovieId)
    {
      try
      {
        if (null == m_db)
        {
          return;
        }
        
        if (lMovieId == -1)
        {
          return;
        }
        
        Log.Info("Removing movie:{0}", lMovieId);
        // Delete movie file stop time data
        ArrayList files = new ArrayList();
        VideoDatabase.GetFilesForMovie((int)lMovieId, ref files);

        foreach (string file in files)
        {
          int fileId = VideoDatabase.GetFileId(file);
          VideoDatabase.DeleteMovieStopTime(fileId);
        }

        IMDBMovie movie = new IMDBMovie();
        GetMovieInfoById((int) lMovieId, ref movie);

        // Delete movie cover
        FanArt.DeleteCovers(movie.Title, (int) lMovieId);
        // Delete movie fanart
        FanArt.DeleteFanarts((int) lMovieId);
        // Delete user groups for movie
        RemoveUserGroupsForMovie((int) lMovieId);

        string strSQL = String.Format("DELETE FROM genrelinkmovie WHERE idmovie={0}", lMovieId);
        m_db.Execute(strSQL);

        strSQL = String.Format("DELETE FROM actorlinkmovie WHERE idmovie={0}", lMovieId);
        m_db.Execute(strSQL);

        strSQL = String.Format("DELETE FROM movieinfo WHERE idmovie={0}", lMovieId);
        m_db.Execute(strSQL);

        strSQL = String.Format("DELETE FROM files WHERE idMovie={0}", lMovieId);
        m_db.Execute(strSQL);

        strSQL = String.Format("DELETE FROM movie WHERE idMovie={0}", lMovieId);
        m_db.Execute(strSQL);

        // Update latest movies
        SetLatestMovieProperties();
      }
      catch (Exception ex)
      {
        Log.Error("videodatabase exception err:{0} stack:{1}", ex.Message, ex.StackTrace);
        Open();
      }
    }
开发者ID:akhilgt,项目名称:MediaPortal-1,代码行数:59,代码来源:VideoDatabaseSqlLite.cs


示例13: SetMovieInfoById

    public void SetMovieInfoById(int lMovieId, ref IMDBMovie details, bool updateTimeStamp)
    {
      try
      {
        details.ID = lMovieId;

        IMDBMovie details1 = details;
        IMDBMovie existingDetails = new IMDBMovie();
        VideoDatabase.GetMovieInfoById(details1.ID, ref existingDetails);
        // Cast
        string strLine = details1.Cast;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.Cast = strLine;
        // Director
        strLine = details1.Director;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.Director = strLine;
        // add director Id
        int lDirector = - 1;
        
        if (details1.DirectorID < 1 && !string.IsNullOrEmpty(details1.Director))
        {
          lDirector = AddActor("", details1.Director);
          AddActorToMovie(details1.ID, lDirector, GUILocalizeStrings.Get(199).Replace(":", string.Empty));
          
          if (!CheckMovieImdbId(details1.IMDBNumber))
          {
            // Add actors from cast
            ArrayList vecActors = new ArrayList();
            ArrayList vecRoles = new ArrayList();
            
            if (details1.Cast != Strings.Unknown)
            {
              string castFix = details1.Cast.Replace("''", "'");
              char[] splitter = { '\n', ',' };
              string[] actors = castFix.Split(splitter);

              for (int i = 0; i < actors.Length; ++i)
              {
                int pos = actors[i].IndexOf(" as ");
                string actor = actors[i];
                string role = string.Empty;
                
                if (pos >= 0)
                {
                  if (actor.Length >= pos + 4)
                  {
                    role = actor.Substring(pos + 4);
                  }
                  actor = actors[i].Substring(0, pos);
                }
                
                actor = actor.Trim();
                role = role.Trim();
                int lActorId = AddActor(string.Empty, actor);
                vecActors.Add(lActorId);
                vecRoles.Add(role);
              }
            }
            
            for (int i = 0; i < vecActors.Count; i++)
            {
              AddActorToMovie(lMovieId, (int)vecActors[i], (string)vecRoles[i]);
            }
          }
        }
        else
        {
          lDirector = details1.DirectorID;
        }
        // Plot
        strLine = details1.Plot;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.Plot = strLine;
        // User Review
        strLine = details1.UserReview;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.UserReview = strLine;
        // Plot outline
        strLine = details1.PlotOutline;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.PlotOutline = strLine;
        // Tagline
        strLine = details1.TagLine;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.TagLine = strLine;
        // Cover
        strLine = details1.ThumbURL;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.ThumbURL = strLine;
        // Fanart
        strLine = details1.FanartURL;
        DatabaseUtility.RemoveInvalidChars(ref strLine);
        details1.FanartURL = strLine;
        // Date Added
        details1.DateAdded = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
        // Date Watched
        if (details1.DateWatched == string.Empty && existingDetails.ID >= 0)
        {
          details1.DateWatched = existingDetails.DateWatched;
//.........这里部分代码省略.........
开发者ID:akhilgt,项目名称:MediaPortal-1,代码行数:101,代码来源:VideoDatabaseSqlLite.cs


示例14: SetMovieInfo

 public void SetMovieInfo(string strFilenameAndPath, ref IMDBMovie details)
 {
   if (strFilenameAndPath.Length == 0)
   {
     return;
   }
   
   int lMovieId = GetMovie(strFilenameAndPath, true);
   
   if (lMovieId < 0)
   {
     return;
   }
   
   details.ID = lMovieId;
   SetMovieInfoById(lMovieId, ref details);
   string strPath, strFileName;
   DatabaseUtility.Split(strFilenameAndPath, out strPath, out strFileName);
   details.Path = strPath;
   details.File = strFileName;
 }
开发者ID:akhilgt,项目名称:MediaPortal-1,代码行数:21,代码来源:VideoDatabaseSqlLite.cs


示例15: GetRandomMoviesByActor

    public void GetRandomMoviesByActor(string strActor1, ref ArrayList movies, int limit)
    {
      try
      {
        string strActor = strActor1;
        DatabaseUtility.RemoveInvalidChars(ref strActor);
        movies.Clear();

        if (null == m_db)
        {
          return;
        }

        string strSQL = String.Format(
          "SELECT * FROM actorlinkmovie,actors,movie,movieinfo,path WHERE path.idpath=movie.idpath AND actors.idActor=actorlinkmovie.idActor AND actorlinkmovie.idmovie=movie.idmovie AND movieinfo.idmovie=movie.idmovie AND actors.stractor='{0}' ORDER BY RANDOM() LIMIT {1}",
          strActor, limit);
        SQLiteResultSet results = m_db.Execute(strSQL);

        if (results.Rows.Count == 0)
        {
          return;
        }

        for (int iRow = 0; iRow < results.Rows.Count; iRow++)
        {
          IMDBMovie details = new IMDBMovie();
          SetMovieDetails(ref details, iRow, results);
          movies.Add(details);
        }
      }
      catch (Exception ex)
      {
        Log.Error("videodatabase exception err:{0} stack:{1}", ex.Message, ex.StackTrace);
        Open();
      }
    }
开发者ID:akhilgt,项目名称:MediaPortal-1,代码行数:36,代码来源:VideoDatabaseSqlLite.cs


示例16: GetRandomMoviesByYear

    public void GetRandomMoviesByYear(string strYear, ref ArrayList movies, int limit)
    {
      try
      {
        int iYear;
        Int32.TryParse(strYear, out iYear);
        movies.Clear();

        if (null == m_db)
        {
          return;
        }
        string strSQL = String.Format(
          "SELECT * FROM movie,movieinfo,path WHERE path.idpath=movie.idpath AND movieinfo.idmovie=movie.idmovie AND movieinfo.iYear={0} ORDER BY RANDOM() LIMIT {1}",
          iYear, limit);

        SQLiteResultSet results = m_db.Execute(strSQL);

        if (results.Rows.Count == 0)
        {
          return;
        }

        for (int iRow = 0; iRow < results.Rows.Count; iRow++)
        {
          IMDBMovie details = new IMDBMovie();
          SetMovieDetails(ref details, iRow, results);
          movies.Add(details);
        }
      }
      catch (Exception ex)
      {
        Log.Error("videodatabase exception err:{0} stack:{1}", ex.Message, ex.StackTrace);
        Open();
      }
    }
开发者ID:akhilgt,项目名称:MediaPortal-1,代码行数:36,代码来源:VideoDatabaseSqlLite.cs


示例17: GetMovieInfo

    public int GetMovieInfo(string strFilenameAndPath, ref IMDBMovie details)
    {
      int lMovieId = GetMovie(strFilenameAndPath, false);
      
      if (lMovieId < 0)
      {
        return -1;
      }

      if (!HasMovieInfo(strFilenameAndPath))
      {
        return -1;
      }
      
      GetMovieInfoById(lMovieId, ref details);
      return lMovieId;
    }
开发者ID:akhilgt,项目名称:MediaPortal-1,代码行数:17,代码来源:VideoDatabaseSqlLite.cs


示例18: GetMoviesByFilter

    // Changed - added user review
    public void GetMoviesByFilter(string sql, out ArrayList movies, bool actorTable, bool movieinfoTable,
                                  bool genreTable, bool usergroupTable)
    {
      movies = new ArrayList();
      
      try
      {
        if (null == m_db)
        {
          return;
        }

        SQLiteResultSet results = GetResults(sql);
        IMDBMovie movie;

        for (int i = 0; i < results.Rows.Count; i++)
        {
          movie = new IMDBMovie();
          SQLiteResultSet.Row fields = results.Rows[i];
          
          if (actorTable && !movieinfoTable)
          {
            movie.Actor = fields.fields[1];
            movie.ActorID = (int)Math.Floor(0.5d + Double.Parse(fields.fields[0]));
          }
          
          if (genreTable && !movieinfoTable)
          {
            movie.SingleGenre = fields.fields[1];
            movie.GenreID = (int)Math.Floor(0.5d + Double.Parse(fields.fields[0]));
          }
          
          if (usergroupTable && !movieinfoTable)
          {
            movie.SingleUserGroup = fields.fields[1];
            movie.UserGroupID = (int)Math.Floor(0.5d + Double.Parse(fields.fields[0]));
          }
          
          if (movieinfoTable)
          {
            SetMovieDetails(ref movie, i, results);
            // FanArt search need this (for database GUI view)
            // Share view is handled in GUIVideoFiles class)
            ArrayList files = new ArrayList();
            GetFilesForMovie(movie.ID, ref files);
            
            if (files.Count > 0)
            {
              // We need only first file if there is multiple files for one movie, fanart class will handle filename
              movie.File = files[0].ToString();
            }
          }
          movies.Add(movie);
        }
      }
      catch (Exception ex)
      {
        Log.Error("videodatabase exception err:{0} stack:{1}", ex.Message, ex.StackTrace);
        Open();
      }
    }
开发者ID:akhilgt,项目名称:MediaPortal-1,代码行数:62,代码来源:VideoDatabaseSqlLite.cs


示例19: GetMovieInfoById

 // Changed Added DirectorID, userrev, fanart
 public void GetMovieInfoById(int lMovieId, ref IMDBMovie details)
 {
   try
   {
     string strSQL = String.Format(
       "SELECT * FROM movieinfo,movie,path WHERE path.idpath=movie.idpath AND movie.idMovie=movieinfo.idMovie AND movieinfo.idmovie={0}",
       lMovieId);
     SQLiteResultSet results = m_db.Execute(strSQL);
     
     if (results.Rows.Count == 0)
     {
       return;
     }
     
     SetMovieDetails(ref details, 0, results);
   }
   catch (ThreadAbortException)
   {
     // Will be logged in thread main code
   }
   catch (Exception ex)
   {
     Log.Error("videodatabase exception err:{0} stack:{1}", ex.Message, ex.StackTrace);
     Open();
   }
 }
开发者ID:akhilgt,项目名称:MediaPortal-1,代码行数:27,代码来源:VideoDatabaseSqlLite.cs


示例20: UpdateCDLabel

 public void UpdateCDLabel(IMDBMovie movieDetails, string CDlabel)
 {
   if (movieDetails == null)
   {
     return;
   }
   
   try
   {
     string sql = String.Format("SELECT idPath FROM path WHERE cdlabel = '{0}'", movieDetails.CDLabel);
     SQLiteResultSet results = m_db.Execute(sql);
     int idPath;
     Int32.TryParse(DatabaseUtility.Get(results, 0, "idPath"), out idPath);
     sql = String.Format("UPDATE path SET cdlabel = '{0}' WHERE idPath = '{1}'", CDlabel, idPath);
     results = m_db.Execute(sql);
   }
   catch (Exception ex)
   {
     Log.Error("videodatabase exception err:{0} stack:{1}", ex.Message, ex.StackTrace);
     Open();
   }
 }
开发者ID:akhilgt,项目名称:MediaPortal-1,代码行数:22,代码来源:VideoDatabaseSqlLite.cs



注:本文中的MediaPortal.Video.Database.IMDBMovie类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SmartIrc4net.IrcClient类代码示例发布时间:2022-05-26
下一篇:
C# Database.IMDBFetcher类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap