/// <summary> /// this method switches between the different databases to fetche the search result into movieDetails /// </summary> public bool GetDetails(IMDBUrl url, ref IMDBMovie movieDetails) { try { MovieInfoDatabase currentDB = null; foreach (MovieInfoDatabase db in _databaseList) { if (db.ID == url.Database) { currentDB = db; } } if (currentDB == null) { return(false); } if (currentDB.Grabber == null) { return(false); } currentDB.Grabber.GetDetails(url, ref movieDetails); return(true); } catch (Exception ex) { Log.Error("Movie database lookup GetDetails() - grabber: {0}, message : {1}", url.Database, ex.Message); return(false); } }
/// <summary> /// this method switches between the different databases to fetche the search result into movieDetails /// </summary> public bool GetDetails(IMDBUrl url, ref IMDBMovie movieDetails) { try { /* * // extract host from url, to find out which mezhod should be called * int iStart = url.URL.IndexOf(".")+1; * int iEnd = url.URL.IndexOf(".",iStart); * if ((iStart<0) || (iEnd<0)) * { * // could not extract hostname! * Log.Info("Movie DB lookup GetDetails(): could not extract hostname from {0}",url.URL); * return false; * } * string strHost = url.URL.Substring(iStart,iEnd-iStart).ToUpper();*/ MovieInfoDatabase currentDB = null; foreach (MovieInfoDatabase db in _databaseList) { if (db.ID == url.Database) { currentDB = db; } } if (currentDB == null) { return(false); } if (currentDB.Grabber == null) { return(false); } currentDB.Grabber.GetDetails(url, ref movieDetails); return(true); } catch (Exception ex) { Log.Error("Movie database lookup GetDetails() - grabber: {0}, message : {1}", url.Database, ex.Message); return(false); } }