public static List <Raw_AniDB_Episode> ProcessEpisodes(XmlDocument docAnime, int animeID) { List <Raw_AniDB_Episode> eps = new List <Raw_AniDB_Episode>(); XmlNodeList episodeItems = docAnime?["anime"]?["episodes"]?.GetElementsByTagName("episode"); if (episodeItems == null) { return(eps); } foreach (XmlNode node in episodeItems) { try { Raw_AniDB_Episode ep = new Raw_AniDB_Episode(); if (!ep.ProcessEpisodeSource(node, animeID)) { logger.Error($"AniDB Episode raw data had invalid return data:\n {node}"); continue; } eps.Add(ep); } catch (Exception exc) { logger.Error(exc, $"Error in ProcessEpisodes: {exc}"); } } return(eps); }
public static List <Raw_AniDB_Episode> ProcessEpisodes(XmlDocument docAnime, int animeID) { List <Raw_AniDB_Episode> eps = new List <Raw_AniDB_Episode>(); try { if (docAnime != null && docAnime["anime"] != null && docAnime["anime"]["episodes"] != null) { XmlNodeList episodeItems = docAnime["anime"]["episodes"].GetElementsByTagName("episode"); foreach (XmlNode node in episodeItems) { try { Raw_AniDB_Episode ep = new Raw_AniDB_Episode(); ep.ProcessEpisodeSource(node, animeID); eps.Add(ep); } catch (Exception ex) { //BaseConfig.MyAnimeLog.Write("Error in ProcessEpisodes: {0}", ex); } } } } catch (Exception ex) { logger.ErrorException("Error in AniDBHTTPHelper.ProcessEpisodes: {0}", ex); return(null); } return(eps); }
public static List<Raw_AniDB_Episode> ProcessEpisodes(XmlDocument docAnime, int animeID) { List<Raw_AniDB_Episode> eps = new List<Raw_AniDB_Episode>(); try { if (docAnime != null && docAnime["anime"] != null && docAnime["anime"]["episodes"] != null) { XmlNodeList episodeItems = docAnime["anime"]["episodes"].GetElementsByTagName("episode"); foreach (XmlNode node in episodeItems) { try { Raw_AniDB_Episode ep = new Raw_AniDB_Episode(); ep.ProcessEpisodeSource(node, animeID); eps.Add(ep); } catch (Exception ex) { //BaseConfig.MyAnimeLog.Write("Error in ProcessEpisodes: {0}", ex); } } } } catch (Exception ex) { logger.ErrorException("Error in AniDBHTTPHelper.ProcessEpisodes: {0}", ex); return null; } return eps; }