public void GetInfoFromWeb(IMyCollectionsData item) { string search = string.Empty; try { bool bFind = false; Hashtable objResults = null; Movie objEntity = item as Movie; if (objEntity == null) { return; } if (objEntity.IsComplete == false) { string strSearch = objEntity.Title; search = strSearch; search = Util.CleanExtensions(search); Task.Factory.StartNew(() => Util.NotifyEvent("getInfoFromWeb: Movie : " + search)); #region TMDB if (MySettings.EnableTMDBMovies == true) { strSearch = objEntity.Title; if (MySettings.CleanTitle == true) { strSearch = Util.CleanExtensions(strSearch); } if (string.IsNullOrEmpty(objEntity.OriginalTitle) == false) { strSearch = objEntity.OriginalTitle; } Collection <PartialMatche> results = TheMovieDbServices.Search(strSearch, LanguageType.EN); if (results != null && results.Any()) { objResults = TheMovieDbServices.Parse(results[0].Link, LanguageType.EN); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } if (bFind == false && MySettings.EnableTMDBFrMovies == true) { strSearch = objEntity.Title; if (MySettings.CleanTitle == true) { strSearch = Util.CleanExtensions(strSearch); } if (string.IsNullOrEmpty(objEntity.OriginalTitle) == false) { strSearch = objEntity.OriginalTitle; } Collection <PartialMatche> results = TheMovieDbServices.Search(strSearch, LanguageType.FR); if (results != null && results.Any()) { objResults = TheMovieDbServices.Parse(results[0].Link, LanguageType.FR); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } if (bFind == false && MySettings.EnableTMDBDeMovies == true) { strSearch = objEntity.Title; if (MySettings.CleanTitle == true) { strSearch = Util.CleanExtensions(strSearch); } if (string.IsNullOrEmpty(objEntity.OriginalTitle) == false) { strSearch = objEntity.OriginalTitle; } Collection <PartialMatche> results = TheMovieDbServices.Search(strSearch, LanguageType.DE); if (results != null && results.Any()) { objResults = TheMovieDbServices.Parse(results[0].Link, LanguageType.DE); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } if (bFind == false && MySettings.EnableTMDBItMovies == true) { strSearch = objEntity.Title; if (MySettings.CleanTitle == true) { strSearch = Util.CleanExtensions(strSearch); } if (string.IsNullOrEmpty(objEntity.OriginalTitle) == false) { strSearch = objEntity.OriginalTitle; } Collection <PartialMatche> results = TheMovieDbServices.Search(strSearch, LanguageType.IT); if (results != null && results.Any()) { objResults = TheMovieDbServices.Parse(results[0].Link, LanguageType.IT); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } if (bFind == false && MySettings.EnableTMDBCnMovies == true) { strSearch = objEntity.Title; if (MySettings.CleanTitle == true) { strSearch = Util.CleanExtensions(strSearch); } if (string.IsNullOrEmpty(objEntity.OriginalTitle) == false) { strSearch = objEntity.OriginalTitle; } Collection <PartialMatche> results = TheMovieDbServices.Search(strSearch, LanguageType.CN); if (results != null && results.Any()) { objResults = TheMovieDbServices.Parse(results[0].Link, LanguageType.CN); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } if (bFind == false && MySettings.EnableTMDBSpMovies == true) { strSearch = objEntity.Title; if (MySettings.CleanTitle == true) { strSearch = Util.CleanExtensions(strSearch); } if (string.IsNullOrEmpty(objEntity.OriginalTitle) == false) { strSearch = objEntity.OriginalTitle; } Collection <PartialMatche> results = TheMovieDbServices.Search(strSearch, LanguageType.ES); if (results != null && results.Any()) { objResults = TheMovieDbServices.Parse(results[0].Link, LanguageType.ES); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } if (bFind == false && MySettings.EnableTMDBPtMovies == true) { strSearch = objEntity.Title; if (MySettings.CleanTitle == true) { strSearch = Util.CleanExtensions(strSearch); } if (string.IsNullOrEmpty(objEntity.OriginalTitle) == false) { strSearch = objEntity.OriginalTitle; } Collection <PartialMatche> results = TheMovieDbServices.Search(strSearch, LanguageType.PT); if (results != null && results.Any()) { objResults = TheMovieDbServices.Parse(results[0].Link, LanguageType.PT); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } #endregion #region Allocine if (bFind == false && MySettings.EnableAlloCineMovies == true) { strSearch = objEntity.Title; if (MySettings.CleanTitle == true) { strSearch = Util.CleanExtensions(strSearch); } if (string.IsNullOrEmpty(objEntity.OriginalTitle) == false) { strSearch = objEntity.OriginalTitle; } Collection <PartialMatche> results = AlloCineServices.Search(strSearch, LanguageType.FR); if (results != null && results.Any()) { objResults = AlloCineServices.Parse(results[0].Link, LanguageType.FR); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } if (bFind == false && MySettings.EnableAdoroCinemaMovies == true) { strSearch = objEntity.Title; if (MySettings.CleanTitle == true) { strSearch = Util.CleanExtensions(strSearch); } if (string.IsNullOrEmpty(objEntity.OriginalTitle) == false) { strSearch = objEntity.OriginalTitle; } Collection <PartialMatche> results = AlloCineServices.Search(strSearch, LanguageType.BR); if (results != null && results.Any()) { objResults = AlloCineServices.Parse(results[0].Link, LanguageType.BR); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } if (bFind == false && MySettings.EnableFilmStartsMovies == true) { strSearch = objEntity.Title; if (MySettings.CleanTitle == true) { strSearch = Util.CleanExtensions(strSearch); } if (string.IsNullOrEmpty(objEntity.OriginalTitle) == false) { strSearch = objEntity.OriginalTitle; } Collection <PartialMatche> results = AlloCineServices.Search(strSearch, LanguageType.DE); if (results != null && results.Any()) { objResults = AlloCineServices.Parse(results[0].Link, LanguageType.DE); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } #endregion #region IMDB if (bFind == false && MySettings.EnableIMDBMovies == true) { strSearch = objEntity.Title; if (MySettings.CleanTitle == true) { strSearch = Util.CleanExtensions(strSearch); } if (string.IsNullOrEmpty(objEntity.OriginalTitle) == false) { strSearch = objEntity.OriginalTitle; } Collection <PartialMatche> results = ImdbServices.Search(strSearch); if (results != null && results.Any()) { objResults = ImdbServices.Parse(results[0].Link, true, strSearch); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } #endregion #region Amazon US if (bFind == false && MySettings.EnableAmazonMovie == true) { strSearch = objEntity.Title; if (MySettings.CleanTitle == true) { strSearch = Util.CleanExtensions(strSearch); } if (string.IsNullOrEmpty(objEntity.OriginalTitle) == false) { strSearch = objEntity.OriginalTitle; } Collection <PartialMatche> results = AmazonServices.Search(strSearch, string.Empty, AmazonIndex.DVD, AmazonCountry.com, AmazonBrowserNode.None); if (results != null && results.Any()) { objResults = AmazonServices.Parse(results[0].Link, AmazonCountry.com, !string.IsNullOrWhiteSpace(objEntity.BarCode), AmazonIndex.DVD, string.Empty); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } #endregion #region Amazon FR if (bFind == false && MySettings.EnableAmazonFrMovie == true) { strSearch = objEntity.Title; if (MySettings.CleanTitle == true) { strSearch = Util.CleanExtensions(strSearch); } if (string.IsNullOrEmpty(objEntity.OriginalTitle) == false) { strSearch = objEntity.OriginalTitle; } Collection <PartialMatche> results = AmazonServices.Search(strSearch, string.Empty, AmazonIndex.DVD, AmazonCountry.fr, AmazonBrowserNode.None); if (results != null && results.Any()) { objResults = AmazonServices.Parse(results[0].Link, AmazonCountry.fr, !string.IsNullOrWhiteSpace(objEntity.BarCode), AmazonIndex.DVD, string.Empty); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } #endregion #region Amazon DE if (bFind == false && MySettings.EnableAmazonDeMovie == true) { strSearch = objEntity.Title; if (MySettings.CleanTitle == true) { strSearch = Util.CleanExtensions(strSearch); } if (string.IsNullOrEmpty(objEntity.OriginalTitle) == false) { strSearch = objEntity.OriginalTitle; } Collection <PartialMatche> results = AmazonServices.Search(strSearch, string.Empty, AmazonIndex.DVD, AmazonCountry.de, AmazonBrowserNode.None); if (results != null && results.Any()) { objResults = AmazonServices.Parse(results[0].Link, AmazonCountry.de, !string.IsNullOrWhiteSpace(objEntity.BarCode), AmazonIndex.DVD, string.Empty); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } #endregion #region Amazon IT if (bFind == false && MySettings.EnableAmazonItMovie == true) { strSearch = objEntity.Title; if (MySettings.CleanTitle == true) { strSearch = Util.CleanExtensions(strSearch); } if (string.IsNullOrEmpty(objEntity.OriginalTitle) == false) { strSearch = objEntity.OriginalTitle; } Collection <PartialMatche> results = AmazonServices.Search(strSearch, string.Empty, AmazonIndex.DVD, AmazonCountry.it, AmazonBrowserNode.None); if (results != null && results.Any()) { objResults = AmazonServices.Parse(results[0].Link, AmazonCountry.it, !string.IsNullOrWhiteSpace(objEntity.BarCode), AmazonIndex.DVD, string.Empty); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } #endregion #region Amazon CN if (bFind == false && MySettings.EnableAmazonCnMovie == true) { strSearch = objEntity.Title; if (MySettings.CleanTitle == true) { strSearch = Util.CleanExtensions(strSearch); } if (string.IsNullOrEmpty(objEntity.OriginalTitle) == false) { strSearch = objEntity.OriginalTitle; } Collection <PartialMatche> results = AmazonServices.Search(strSearch, string.Empty, AmazonIndex.DVD, AmazonCountry.cn, AmazonBrowserNode.None); if (results != null && results.Any()) { objResults = AmazonServices.Parse(results[0].Link, AmazonCountry.cn, !string.IsNullOrWhiteSpace(objEntity.BarCode), AmazonIndex.DVD, string.Empty); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } #endregion #region Amazon ES if (bFind == false && MySettings.EnableAmazonSpMovie == true) { strSearch = objEntity.Title; if (MySettings.CleanTitle == true) { strSearch = Util.CleanExtensions(strSearch); } if (string.IsNullOrEmpty(objEntity.OriginalTitle) == false) { strSearch = objEntity.OriginalTitle; } Collection <PartialMatche> results = AmazonServices.Search(strSearch, string.Empty, AmazonIndex.DVD, AmazonCountry.es, AmazonBrowserNode.None); if (results != null && results.Any()) { objResults = AmazonServices.Parse(results[0].Link, AmazonCountry.es, !string.IsNullOrWhiteSpace(objEntity.BarCode), AmazonIndex.DVD, string.Empty); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } #endregion CommonServices.Update(objEntity); } } catch (Exception exception) { Util.LogException(exception, search); throw; } }
public void GetInfoFromWeb(IMyCollectionsData item) { bool bFind = false; XXX objEntity = item as XXX; if (objEntity == null) { return; } if (objEntity.IsComplete == false) { string strSearch = objEntity.Title; if (MySettings.CleanTitle == true) { strSearch = Util.CleanExtensions(strSearch); } string search = strSearch; Task.Factory.StartNew(() => Util.NotifyEvent("getInfoFromWeb: XXX : " + search)); Hashtable objResults = null; #region AdultDvdEmpire if (MySettings.EnableAdultDvdEmpire == true) { Collection <PartialMatche> results = AdultdvdempireServices.Search(strSearch); if (results != null && results.Any()) { objResults = AdultdvdempireServices.Parse(results[0].Link, true, strSearch); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } #endregion #region HotMovies if (bFind == false && MySettings.EnableHotMovies == true) { Collection <PartialMatche> results = HotMoviesServices.Search(strSearch); if (results != null && results.Any()) { objResults = HotMoviesServices.Parse(results[0].Link, true); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } #endregion #region SugarVod if (bFind == false && MySettings.EnableSugardVod == true) { Collection <PartialMatche> results = SugarVodServices.Search(strSearch); if (results != null && results.Any()) { objResults = SugarVodServices.Parse(results[0].Link, true, strSearch); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } #endregion SugarVod #region CdUniverse if (bFind == false && MySettings.EnableCdUniverse == true) { Collection <PartialMatche> results = CdUniverseServices.Search(strSearch); if (results != null && results.Any()) { objResults = CdUniverseServices.Parse(results[0].Link, true, strSearch); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } #endregion #region Orgazmik if (bFind == false && MySettings.EnableOrgazmik == true) { Collection <PartialMatche> results = OrgazmikServices.Search(strSearch); if (results != null && results.Any()) { objResults = OrgazmikServices.Parse(results[0].Link, true, strSearch); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } #endregion #region AdultBluRayHdDvd if (bFind == false && MySettings.EnableAdultBluRayHdDvd == true) { Collection <PartialMatche> results = AdultBluRayHdDvdServices.Search(strSearch); if (results != null && results.Any()) { objResults = AdultBluRayHdDvdServices.Parse(results[0].Link, true); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } #endregion #region DorcelShop if (bFind == false && MySettings.EnableDorcelShop == true) { Collection <PartialMatche> results = DorcelServices.Search(strSearch); if (results != null && results.Any()) { objResults = DorcelServices.Parse(results[0].Link, true, strSearch); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } #endregion #region Amazon FR if (bFind == false && MySettings.EnableAmazonFrXXX == true) { strSearch = objEntity.Title; if (MySettings.CleanTitle == true) { strSearch = Util.CleanExtensions(strSearch); } Collection <PartialMatche> results = AmazonServices.Search(strSearch, string.Empty, AmazonIndex.DVD, AmazonCountry.fr, AmazonBrowserNode.None); if (results != null && results.Any()) { objResults = AmazonServices.Parse(results[0].Link, AmazonCountry.fr, !string.IsNullOrWhiteSpace(objEntity.BarCode), AmazonIndex.DVD, string.Empty); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } #endregion #region TMDB if (bFind == false && MySettings.EnableTMDBXXX == true) { Collection <PartialMatche> results = TheMovieDbServices.Search(strSearch, LanguageType.EN); if (results != null && results.Any()) { objResults = TheMovieDbServices.Parse(results[0].Link, LanguageType.EN); } if (objResults != null) { bFind = Fill(objResults, objEntity); } } #endregion CommonServices.Update(objEntity); } }