当前位置: 首页>>代码示例>>C#>>正文


C# IMDBFetcher.FetchNfo方法代码示例

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


在下文中一共展示了IMDBFetcher.FetchNfo方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnSearchNew

    protected override void OnSearchNew()
    {
      if (_doNotUseDatabase)
      {
        GUIDialogOK dlgOk = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK);
        dlgOk.SetHeading(string.Empty);
        dlgOk.SetLine(1, GUILocalizeStrings.Get(416)); // Not available
        dlgOk.DoModal(GUIWindowManager.ActiveWindow);
        return;
      }

      int maximumShares = 128;
      ArrayList availablePaths = new ArrayList();

      using (Profile.Settings xmlreader = new MPSettings())
      {
        for (int index = 0; index < maximumShares; index++)
        {
          string sharePath = String.Format("sharepath{0}", index);
          string shareDir = xmlreader.GetValueAsString("movies", sharePath, "");
          string shareScan = String.Format("sharescan{0}", index);
          bool shareScanData = xmlreader.GetValueAsBool("movies", shareScan, true);

          if (shareScanData && shareDir != string.Empty)
          {
            availablePaths.Add(shareDir);
          }
        }

        ArrayList nfoFiles = new ArrayList();

        foreach (string availablePath in availablePaths)
        {
          GetNfoFiles(availablePath, ref nfoFiles);
        }

        if (!_useOnlyNfoScraper) // Normal scraper
        {
          // First try nfo files
          IMDBFetcher fetcher = new IMDBFetcher(this);
          fetcher.FetchNfo(nfoFiles, true, false);
          // Then video files without nfo
          IMDBFetcher.ScanIMDB(this, availablePaths, true, true, true, false);
        }
        else
        {
          // Only nfo files
          IMDBFetcher fetcher = new IMDBFetcher(this);
          fetcher.FetchNfo(nfoFiles, true, false);
        }
        
        // Send global message that movie is refreshed/scanned
        GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_VIDEOINFO_REFRESH, 0, 0, 0, 0, 0, null);
        GUIWindowManager.SendMessage(msg);

        _currentSelectedItem = facadeLayout.SelectedListItemIndex;

        if (_currentSelectedItem > 0)
        {
          _currentSelectedItem--;
        }

        LoadDirectory(_currentFolder);

        if (_currentSelectedItem >= 0)
        {
          GUIControl.SelectItemControl(GetID, facadeLayout.GetID, _currentSelectedItem);
        }
      }
    }
开发者ID:gayancc,项目名称:MediaPortal-1,代码行数:70,代码来源:GUIVideoFiles.cs

示例2: OnShowContextMenu


//.........这里部分代码省略.........
            dlgOk.SetHeading(string.Empty);
            dlgOk.SetLine(1, GUILocalizeStrings.Get(416)); // Not available
            dlgOk.DoModal(GUIWindowManager.ActiveWindow);
            return;
          }

          if (facadeLayout.Focus)
          {
            if (item.IsFolder)
            {
              if (item.Label == "..")
              {
                return;
              }
              if (item.IsRemote)
              {
                return;
              }
            }
          }

          if (!_virtualDirectory.RequestPin(item.Path))
          {
            return;
          }
          
          int currentIndex = facadeLayout.SelectedListItemIndex;
          ArrayList scanNfoFiles = new ArrayList();
          GetNfoFiles(item.Path, ref scanNfoFiles);

          if (_useOnlyNfoScraper)
          {
            IMDBFetcher scanFetcher = new IMDBFetcher(this);
            scanFetcher.FetchNfo(scanNfoFiles, true, false);
            // Send global message that movie is refreshed/scanned
            GUIMessage scanNfoMsg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_VIDEOINFO_REFRESH, 0, 0, 0, 0, 0, null);
            GUIWindowManager.SendMessage(scanNfoMsg);
            LoadDirectory(_currentFolder);
            facadeLayout.SelectedListItemIndex = currentIndex;
          }
          else
          {
            // Try nfo files first
            IMDBFetcher scanFetcher = new IMDBFetcher(this);
            scanFetcher.FetchNfo(scanNfoFiles, true, false);
            // Then the rest
            ArrayList availablePaths = new ArrayList();
            availablePaths.Add(item.Path);
            IMDBFetcher.ScanIMDB(this, availablePaths, _isFuzzyMatching, true, _getActors, false);
            // Send global message that movie is refreshed/scanned
            GUIMessage scanMsg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_VIDEOINFO_REFRESH, 0, 0, 0, 0, 0, null);
            GUIWindowManager.SendMessage(scanMsg);
            LoadDirectory(_currentFolder);
            facadeLayout.SelectedListItemIndex = currentIndex;
          }
          break;

        case 1280: //Scan using nfo files
          if (_doNotUseDatabase)
          {
            GUIDialogOK dlgOk = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK);
            dlgOk.SetHeading(string.Empty);
            dlgOk.SetLine(1, GUILocalizeStrings.Get(416)); // Not available
            dlgOk.DoModal(GUIWindowManager.ActiveWindow);
            return;
          }
开发者ID:gayancc,项目名称:MediaPortal-1,代码行数:67,代码来源:GUIVideoFiles.cs

示例3: OnShowContextMenu


//.........这里部分代码省略.........
            dlgOk.SetHeading(string.Empty);
            dlgOk.SetLine(1, GUILocalizeStrings.Get(416)); // Not available
            dlgOk.DoModal(GUIWindowManager.ActiveWindow);
            return;
          }

          if (facadeLayout.Focus)
          {
            if (item.IsFolder)
            {
              if (item.Label == "..")
              {
                return;
              }
              if (item.IsRemote)
              {
                return;
              }
            }
          }

          if (!_virtualDirectory.RequestPin(item.Path))
          {
            return;
          }
          
          int currentIndex = facadeLayout.SelectedListItemIndex;

          if (_useOnlyNfoScraper)
          {
            ArrayList scanNfoFiles = new ArrayList();
            GetNfoFiles(item.Path, ref scanNfoFiles);
            IMDBFetcher scanFetcher = new IMDBFetcher(this);
            scanFetcher.FetchNfo(scanNfoFiles, true, false);
            // Send global message that movie is refreshed/scanned
            GUIMessage scanNfoMsg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_VIDEOINFO_REFRESH, 0, 0, 0, 0, 0, null);
            GUIWindowManager.SendMessage(scanNfoMsg);
            LoadDirectory(_currentFolder);
            facadeLayout.SelectedListItemIndex = currentIndex;
          }
          else
          {
            ArrayList availablePaths = new ArrayList();
            availablePaths.Add(item.Path);
            IMDBFetcher.ScanIMDB(this, availablePaths, _isFuzzyMatching, _scanSkipExisting, _getActors, false);
            // Send global message that movie is refreshed/scanned
            GUIMessage scanMsg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_VIDEOINFO_REFRESH, 0, 0, 0, 0, 0, null);
            GUIWindowManager.SendMessage(scanMsg);
            LoadDirectory(_currentFolder);
            facadeLayout.SelectedListItemIndex = currentIndex;
          }
          break;

        case 1280: //Scan using nfo files
          if (_doNotUseDatabase)
          {
            GUIDialogOK dlgOk = (GUIDialogOK)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_OK);
            dlgOk.SetHeading(string.Empty);
            dlgOk.SetLine(1, GUILocalizeStrings.Get(416)); // Not available
            dlgOk.DoModal(GUIWindowManager.ActiveWindow);
            return;
          }

          if (facadeLayout.Focus)
          {
            if (item.IsFolder)
开发者ID:NJK125,项目名称:MediaPortal-1,代码行数:67,代码来源:GUIVideoFiles.cs

示例4: OnSearchNew

    // Scan for new movies for selected folder in configuration
    protected override void OnSearchNew()
    {
      int maximumShares = 128;
      ArrayList availablePaths = new ArrayList();
      bool _useOnlyNfoScraper = false;

      using (Profile.Settings xmlreader = new MPSettings())
      {
        _useOnlyNfoScraper = xmlreader.GetValueAsBool("moviedatabase", "useonlynfoscraper", false);

        for (int index = 0; index < maximumShares; index++)
        {
          string sharePath = String.Format("sharepath{0}", index);
          string shareDir = xmlreader.GetValueAsString("movies", sharePath, "");
          string shareScan = String.Format("sharescan{0}", index);
          bool shareScanData = xmlreader.GetValueAsBool("movies", shareScan, true);

          if (shareScanData && shareDir != string.Empty)
          {
            availablePaths.Add(shareDir);
          }
        }

        if (!_useOnlyNfoScraper)
        {
          IMDBFetcher.ScanIMDB(this, availablePaths, true, true, true, false);
        }
        else
        {
          ArrayList nfoFiles = new ArrayList();
          
          foreach (string availablePath in availablePaths)
          {
            GetNfoFiles(availablePath, ref nfoFiles);
          }
          
          IMDBFetcher fetcher = new IMDBFetcher(this);
          fetcher.FetchNfo(nfoFiles, true, false);
        }
        // Send global message that movie is refreshed/scanned
        GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_VIDEOINFO_REFRESH, 0, 0, 0, 0, 0, null);
        GUIWindowManager.SendMessage(msg);
        currentSelectedItem = facadeLayout.SelectedListItemIndex;

        if (currentSelectedItem > 0)
        {
          currentSelectedItem--;
        }

        LoadDirectory(currentFolder);

        if (currentSelectedItem >= 0)
        {
          GUIControl.SelectItemControl(GetID, facadeLayout.GetID, currentSelectedItem);
        }
      }
    }
开发者ID:edalex86,项目名称:MediaPortal-1,代码行数:58,代码来源:GUIVideoTitle.cs

示例5: OnScanDatabase

    // need change for 1.3.0
    private void OnScanDatabase()
    {
      SaveSettings();
      
      ArrayList availablePaths = new ArrayList();
      ArrayList scanShares = new ArrayList();

      foreach (GUIListItem item in lcFolders.ListItems)
      {
        if (item.IsPlayed)
        {
          scanShares.Add(item);
        }
      }

      for (int index = 0; index < _scanShare; index++)
      {
        GUIListItem item = (GUIListItem)scanShares[index];
        string path = item.Path;
        availablePaths.Add(path);
      }
      
      // Clean covers and fanarts (only if refreshexisting cb is checked)
      if (btnRefreshexistingonly.Selected)
      {
        ArrayList movies = new ArrayList();
        VideoDatabase.GetMovies(ref movies);

        foreach (IMDBMovie movie in movies)
        {
          string strFilenameAndPath = string.Empty;

          ArrayList files = new ArrayList();
          VideoDatabase.GetFilesForMovie(movie.ID, ref files);
          strFilenameAndPath = files[0].ToString();
          
          // Delete covers
          FanArt.DeleteCovers(movie.Title, movie.ID);
          // Delete fanarts
          FanArt.DeleteFanarts(movie.ID);
        }
      }
      _conflictFiles = new ArrayList();

      if (!btnUseNfoScraper.Selected)
      {
        IMDBFetcher.ScanIMDB(this, availablePaths, btnNearestmatch.Selected, btnSkipalreadyexisting.Selected, false,
                             btnRefreshexistingonly.Selected);
      }
      else
      {
        ArrayList nfoFiles = new ArrayList();

        foreach (string availablePath in availablePaths)
        {
          GetNfoFiles(availablePath, ref nfoFiles);
        }

        IMDBFetcher fetcher = new IMDBFetcher(this);
        fetcher.FetchNfo(nfoFiles, btnSkipalreadyexisting.Selected, btnRefreshexistingonly.Selected);
      }
    }
开发者ID:doskabouter,项目名称:MediaPortal-1,代码行数:63,代码来源:GUISettingsMyVideos_Database.cs

示例6: OnScanDatabase

    // need change for 1.3.0
    private void OnScanDatabase()
    {
      SaveSettings();
      
      ArrayList availablePaths = new ArrayList();
      ArrayList scanShares = new ArrayList();

      foreach (GUIListItem item in lcFolders.ListItems)
      {
        if (item.IsPlayed)
        {
          scanShares.Add(item);
        }
      }

      for (int index = 0; index < _scanShare; index++)
      {
        GUIListItem item = (GUIListItem)scanShares[index];
        string path = item.Path;
        availablePaths.Add(path);
      }
      
      // Clean covers and fanarts (only if refreshexisting cb is checked)
      if (btnRefreshexistingonly.Selected)
      {
        ArrayList movies = new ArrayList();
        VideoDatabase.GetMovies(ref movies);

        foreach (IMDBMovie movie in movies)
        {
          string strFilenameAndPath = string.Empty;

          ArrayList files = new ArrayList();
          VideoDatabase.GetFilesForMovie(movie.ID, ref files);
          strFilenameAndPath = files[0].ToString();
          
          // Delete covers
          FanArt.DeleteCovers(movie.Title, movie.ID);
          // Delete fanarts
          FanArt.DeleteFanarts(movie.ID);
        }
      }
      _conflictFiles = new ArrayList();
      ArrayList nfoFiles = new ArrayList();

      foreach (string availablePath in availablePaths)
      {
        GetNfoFiles(availablePath, ref nfoFiles);
      }

      if (!btnUseNfoScraper.Selected)
      {
        // Scan only new movies (skip scan existing movies or not refreshing existing)
        if (btnSkipalreadyexisting.Selected && !btnRefreshexistingonly.Selected)
        {
          // First nfo (can speed up scan time)
          IMDBFetcher fetcher = new IMDBFetcher(this);
          fetcher.FetchNfo(nfoFiles, true, false);
          // Then video files (for movies not added by nfo)
          IMDBFetcher.ScanIMDB(this, availablePaths, btnNearestmatch.Selected, true, false, false);

        }
        else // User wants to scan no matter if movies are already in the database (do not use nfo here, user must set that option)
        {
          IMDBFetcher.ScanIMDB(this, availablePaths, btnNearestmatch.Selected, btnSkipalreadyexisting.Selected, false,
                             btnRefreshexistingonly.Selected);
        }
      }
      else // Use only nfo files
      {
        IMDBFetcher fetcher = new IMDBFetcher(this);
        fetcher.FetchNfo(nfoFiles, btnSkipalreadyexisting.Selected, btnRefreshexistingonly.Selected);
      }
    }
开发者ID:arangas,项目名称:MediaPortal-1,代码行数:75,代码来源:GUISettingsMyVideos_Database.cs


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