本文整理汇总了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);
}
}
}
示例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;
}
示例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)
示例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);
}
}
}
示例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);
}
}
示例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);
}
}