本文整理汇总了C#中MediaPortal.Video.Database.IMDBFetcher类的典型用法代码示例。如果您正苦于以下问题:C# IMDBFetcher类的具体用法?C# IMDBFetcher怎么用?C# IMDBFetcher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IMDBFetcher类属于MediaPortal.Video.Database命名空间,在下文中一共展示了IMDBFetcher类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnDetailsNotFound
public bool OnDetailsNotFound(IMDBFetcher fetcher)
{
if (_progress != null)
{
return _progress.OnDetailsNotFound(fetcher);
}
return false;
}
示例2: OnDetailsNotFound
public bool OnDetailsNotFound(IMDBFetcher fetcher)
{
if (_scanning)
{
_conflictFiles.Add(fetcher.Movie);
return false;
}
// show dialog...
GUIDialogOK pDlgOk = (GUIDialogOK) GUIWindowManager.GetWindow((int) Window.WINDOW_DIALOG_OK);
// show dialog...
pDlgOk.SetHeading(195);
pDlgOk.SetLine(1, fetcher.MovieName);
pDlgOk.SetLine(2, string.Empty);
pDlgOk.DoModal(GUIWindowManager.ActiveWindow);
return false;
}
示例3: OnSelectMovie
public bool OnSelectMovie(IMDBFetcher fetcher, out int selectedMovie)
{
if (_scanning)
{
_conflictFiles.Add(fetcher.Movie);
selectedMovie = -1;
return false;
}
GUIDialogSelect pDlgSelect = (GUIDialogSelect) GUIWindowManager.GetWindow((int) Window.WINDOW_DIALOG_SELECT);
// more then 1 movie found
// ask user to select 1
string filename = string.Empty;
if (!string.IsNullOrEmpty(_selectedFilename))
{
if (_selectedFilename.ToUpperInvariant().Contains(@"VIDEO_TS\VIDEO_TS.IFO"))
{
filename = _selectedFilename.ToUpperInvariant().Replace(@"\VIDEO_TS\VIDEO_TS.IFO", string.Empty);
int iIndex = 0;
iIndex = filename.LastIndexOf(@"\");
filename = filename.Substring(iIndex + 1);
}
else if (_selectedFilename.ToUpperInvariant().Contains(@"BDMV\INDEX.BDMV"))
{
filename = _selectedFilename.ToUpperInvariant().Replace(@"\BDMV\INDEX.BDMV", string.Empty);
int iIndex = 0;
iIndex = filename.LastIndexOf(@"\");
filename = filename.Substring(iIndex + 1);
}
else
{
filename = Path.GetFileNameWithoutExtension(_selectedFilename);
Util.Utils.RemoveStackEndings(ref filename);
}
}
string strHeading = GUILocalizeStrings.Get(196);
if (!string.IsNullOrEmpty(filename))
{
GUIPropertyManager.SetProperty("#selecteditem", filename);
}
pDlgSelect.SetHeading(strHeading);
pDlgSelect.Reset();
for (int i = 0; i < fetcher.Count; ++i)
{
pDlgSelect.Add(fetcher[i].Title);
}
pDlgSelect.EnableButton(true);
pDlgSelect.SetButtonLabel(413); // manual
pDlgSelect.DoModal(GUIWindowManager.ActiveWindow);
// and wait till user selects one
selectedMovie = pDlgSelect.SelectedLabel;
if (pDlgSelect.IsButtonPressed)
{
return true;
}
if (selectedMovie == -1)
{
return false;
}
return true;
}
示例4: OnDetailsEnd
public bool OnDetailsEnd(IMDBFetcher fetcher)
{
GUIDialogProgress pDlgProgress =
(GUIDialogProgress) GUIWindowManager.GetWindow((int) Window.WINDOW_DIALOG_PROGRESS);
if ((pDlgProgress != null) && (pDlgProgress.IsInstance(fetcher)))
{
pDlgProgress.Close();
}
return true;
}
示例5: OnActorsStarted
public bool OnActorsStarted(IMDBFetcher fetcher)
{
GUIDialogProgress pDlgProgress =
(GUIDialogProgress) GUIWindowManager.GetWindow((int) Window.WINDOW_DIALOG_PROGRESS);
pDlgProgress.SetObject(fetcher);
pDlgProgress.DoModal(GUIWindowManager.ActiveWindow);
if (pDlgProgress.IsCanceled)
{
return false;
}
return true;
}
示例6: OnShowContextMenu
//.........这里部分代码省略.........
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)
{
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;
示例7: OnDisableCancel
public bool OnDisableCancel(IMDBFetcher fetcher)
{
GUIDialogProgress pDlgProgress =
(GUIDialogProgress) GUIWindowManager.GetWindow((int) Window.WINDOW_DIALOG_PROGRESS);
if (pDlgProgress.IsInstance(fetcher))
{
pDlgProgress.DisableCancel(true);
}
return true;
}
示例8: 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);
}
}
}
示例9: OnRequestMovieTitle
public bool OnRequestMovieTitle(IMDBFetcher fetcher, out string movieName)
{
if (_scanning)
{
_conflictFiles.Add(fetcher.Movie);
movieName = string.Empty;
return false;
}
movieName = fetcher.MovieName;
if (VirtualKeyboard.GetKeyboard(ref movieName, GetID))
{
if (movieName == string.Empty)
{
return false;
}
return true;
}
movieName = string.Empty;
return false;
}
示例10: FetchMovieActors
public static bool FetchMovieActors(IMDB.IProgress progress, IMDBMovie details)
{
IMDBFetcher fetcher = new IMDBFetcher(progress);
fetcher._movieDetails = details;
return fetcher.FetchActors();
}
示例11: FetchMovieActor
/// <summary>
/// Downloads actor info.
/// Movie details can be empty (it is used to help update role for movie if role is empty)
/// </summary>
/// <param name="progress"></param>
/// <param name="details"></param>
/// <param name="actor"></param>
/// <param name="actorId"></param>
public static IMDBActor FetchMovieActor(IMDB.IProgress progress, IMDBMovie details, string actor, int actorId)
{
if (actor == string.Empty)
return null;
IMDBFetcher fetcher = new IMDBFetcher(progress);
fetcher._movieDetails = details;
// Find actor
IMDB imdb = new IMDB();
// Don't search for actor if name is IMDBactorId (little speed up)
if (!VideoDatabase.CheckActorImdbId(actor))
{
imdb = fetcher.FindActor(actor);
// Check for results
if (imdb.Count > 0)
{
int i = 0;
// If more than 1, invoke selection
if (imdb.Count > 1)
{
if (!fetcher.OnSelectActor(fetcher, out i))
{
return null;
}
}
// Fetch actor details
return fetcher.FetchActorDetails(actor, actorId, i);
}
}
else // Direct get actor details (by actorImdbId) as name
{
fetcher._imdb.SetIMDBActor("http://www.imdb.com/name/" + actor, actor);
return fetcher.FetchActorDetails(actor, actorId, 0);
}
return null;
}
示例12: RefreshIMDB
//.........这里部分代码省略.........
{
strMovieName = Path.GetFileNameWithoutExtension(strFileName);
}
// Test pattern (CD, DISC(K), Part, X-Y...) and remove it from filename
var pattern = Util.Utils.StackExpression();
for (int i = 0; i < pattern.Length; i++)
{
if (_foldercheck == false && pattern[i].IsMatch(strMovieName))
{
strMovieName = pattern[i].Replace(strMovieName, "");
}
}
}
}
}
if ((strMovieName == string.Empty) || (strMovieName == Strings.Unknown))
{
return true;
}
}
if (currentMovie.ID == -1 && addToDatabase)
{
currentMovie.ID = VideoDatabase.AddMovieFile(strFileName);
}
currentMovie.SearchString = strMovieName;
if (currentMovie.ID >= 0 || !addToDatabase)
{
if (!Win32API.IsConnectedToInternet())
{
return false;
}
IMDBFetcher fetcher = new IMDBFetcher(progress);
fetcher.Movie = currentMovie;
fetcher._getActors = getActors;
int selectedMovie = -1;
do
{
if (!fetcher.Fetch(strMovieName))
{
return false;
}
if (fuzzyMatching)
{
IMDB tmpImdb = new IMDB();
selectedMovie = fetcher.FuzzyMatch(tmpImdb.GetSearchString(fetcher.MovieName));
if (selectedMovie == -1 && fetcher.Count > 0)
{
if (!fetcher.OnSelectMovie(fetcher, out selectedMovie))
{
return false;
}
if (selectedMovie == -1)
{
if (!fetcher.OnRequestMovieTitle(fetcher, out strMovieName))
{
return false;
}
if (strMovieName == string.Empty)
{
return false;
}
}
}
else if (selectedMovie == -1)
示例13: OnSelectActor
public bool OnSelectActor(IMDBFetcher fetcher, out int selected)
{
if (_progress != null)
{
return _progress.OnSelectActor(fetcher, out selected);
}
selected = -1;
return false;
}
示例14: OnRequestMovieTitle
public bool OnRequestMovieTitle(IMDBFetcher fetcher, out string movieName)
{
if (_progress != null)
{
return _progress.OnRequestMovieTitle(fetcher, out movieName);
}
movieName = string.Empty;
return false;
}
示例15: OnRequestMovieTitle
public bool OnRequestMovieTitle(IMDBFetcher fetcher, out string movieName)
{
// won't occure
movieName = "";
return true;
}