private void setSeriesDataTheTVDB(string path, string lan) { XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(path); XmlDocument xmlDocBanner = new XmlDocument(); xmlDocBanner.Load(path.Replace("de.xml", "banners.xml")); XmlNodeList xmlList = xmlDoc.SelectNodes("//Data/Series"); foreach (XmlNode node in xmlList) { //Xml Felder: Actors, Airs_DayOfWeek, Airs_Time, ContentRating, Genre, Network, NetworkID, SeriesID, added, addedBy //banner, tms_wanted_old, lastupdated csSER oSER = new csSER(); oSER.SER_theTVDB_ID = xmlNodeInnerText(node, "id"); oSER.SER_FirstAired_English = vDateTime(xmlNodeInnerText(node, "FirstAired")); oSER.SER_imdb_ID = xmlNodeInnerText(node, "IMDB_ID"); oSER.SER_Languages = xmlNodeInnerText(node, "Language"); oSER.SER_DescriptionShort_German = xmlNodeInnerText(node, "Overview"); oSER.SER_Description_German = xmlNodeInnerText(node, "Overview"); oSER.SER_RunTime = vInt(xmlNodeInnerText(node, "Runtime")); oSER.SER_Name_German = xmlNodeInnerText(node, "SeriesName"); oSER.SER_State = xmlNodeInnerText(node, "Status"); oSER.SER_Zap2It_ID = xmlNodeInnerText(node, "zap2it_id"); oSER.LastChanged = vDateTimeUTC(xmlNodeInnerText(node, "lastupdated")); string fanart = xmlNodeInnerText(node, "fanart"); string poster = xmlNodeInnerText(node, "poster"); oSER.updateSerie(); oSER.SER_ImageLink = downloadImage(poster, oSER.SER_theTVDB_ID, "serie", "SER", oSER.SER_theTVDB_ID + ".jpg"); oSER.SER_ImageLink = downloadImage(fanart, oSER.SER_theTVDB_ID, "serie", "SER_Wide", oSER.SER_theTVDB_ID + "_wide.jpg"); setEpisodesDataTheTVDB(xmlDoc, lan, oSER, xmlDocBanner); txtLog.Text += Environment.NewLine + "ID: " + oSER.SER_theTVDB_ID + " Name: " + oSER.SER_Name_German + " - " + DateTime.Now.ToLongTimeString(); Console.WriteLine("ID: " + oSER.SER_theTVDB_ID + " Name: " + oSER.SER_Name_German + " - " + DateTime.Now.ToLongTimeString()); } }
public csSER getSerie() { csSER ser = new csSER(); dtSER.FillByID(ds.SER_Series, ser_ID); if (ds.SER_Series.Count > 0) ser = (csSER)getClassFromDataRow(ds.SER_Series.Rows[0], ser); return ser; }
public string insertSerie() { csSER ser = new csSER(); ser.ser_theTVDB_ID = ser_theTVDB_ID; ser_ID = ser.getSER_IDwithTheTVDB_ID(); if (!string.IsNullOrEmpty(ser_ID)) return ser_ID; ser_ID = Guid.NewGuid().ToString(); dtSER.Insert(ser_ID, DateTime.Now, DateTime.Now, null, ser_theTVDB_ID, ser_Zap2It_ID, ser_imdb_ID, ser_Name_German, ser_Name_English, ser_DescriptionShort_German, ser_DescriptionShort_English, ser_Description_German, ser_Description_English, ser_FirstAired_German, ser_FirstAired_English, ser_Rate, ser_RateCount, ser_imdb_Rate, ser_imdb_RateCount, ser_RunTime, ser_State, ser_Soundtrack, ser_Trailer, ser_ProductionDateFrom, ser_ProductionDateTo, ser_Country, ser_Languages, ser_Awards, ser_Website, ser_Facebook, ser_Twitter, ser_ImageLink, ser_SeasonCount, ser_EpisodesCount, ser_FavouritesCount, ser_DIR); return ser_ID; }
private void setEpisodesDataTheTVDB(XmlDocument xmlDoc, string lan, csSER oSER, XmlDocument xmlDocBanner) { XmlNodeList xmlList = xmlDoc.SelectNodes("//Data/Episode"); foreach (XmlNode node in xmlList) { //XML Felder: Combined_episodenumber, Combined_season, DVD_chapter, DVD_discid, DVD_episodenumber, DVD_season, Director, EpImgFlag //GuestStars, ProductionCode, Writer, airsafter_season, airsbefore_episode, airsbefore_season, filename, lastupdated //thumb_added, thumb_height, thumb_width, Rating, RatingCount if (oSER == null) return; csSEA oSEA = new csSEA(); oSEA.SEA_theTVDB_ID = xmlNodeInnerText(node, "seasonid"); oSEA.SEA_SER = oSER.SER_ID; oSEA.SEA_NumberText = xmlNodeInnerText(node, "SeasonNumber"); oSEA.SEA_Number = vInt(xmlNodeInnerText(node, "SeasonNumber")); oSEA.LastChanged = vDateTimeUTC(xmlNodeInnerText(node, "lastupdated")); oSEA.updateSeason(); if (!setBannersTheTVDB(xmlDocBanner, oSER.SER_theTVDB_ID, oSEA.SEA_NumberText, oSEA.SEA_theTVDB_ID, false)) { setBannersTheTVDB(xmlDocBanner, oSER.SER_theTVDB_ID, oSEA.SEA_NumberText, oSEA.SEA_theTVDB_ID, true); } if (string.IsNullOrEmpty(oSEA.SEA_ID)) return; csEPI epi = new csEPI(); epi.EPI_theTVDB_ID = xmlNodeInnerText(node, "id"); epi.EPI_SEA = oSEA.SEA_ID; epi.EPI_Name_German = xmlNodeInnerText(node, "EpisodeName"); epi.EPI_NumberOfSeason = vInt(xmlNodeInnerText(node, "EpisodeNumber")); epi.EPI_FirstAired_English = vDateTime(xmlNodeInnerText(node, "FirstAired")); epi.EPI_imdb_ID = xmlNodeInnerText(node, "IMDB_ID"); epi.EPI_Languages = xmlNodeInnerText(node, "Language"); epi.EPI_DescriptionShort_German = xmlNodeInnerText(node, "Overview"); epi.EPI_Description_German = xmlNodeInnerText(node, "Overview"); epi.EPI_Number = vInt(xmlNodeInnerText(node, "absolute_number")); epi.EPI_NumberText = xmlNodeInnerText(node, "absolute_number"); epi.LastChanged = vDateTimeUTC(xmlNodeInnerText(node, "lastupdated")); epi.updateEpisode(); } }