private string Produce() { try { // dirty try/catch to "fix" the problem that a share can disappear during a sleep/resume, and // when windows restarts, the share isn't "back" before this timer times out and fires // windows explorer tends to lose explorer windows on shares when slept/resumed, too, so its not // just me :P MemoryStream ms = new MemoryStream(); //duplicated the IF statement one for RSS and one for XML so that both can be generated. List <ProcessedEpisode> lpe = mDoc.NextNShows(TVSettings.Instance.ExportRSSMaxShows, TVSettings.Instance.ExportRSSDaysPast, TVSettings.Instance.ExportRSSMaxDays); if (lpe != null) { if (this.Generate(ms, lpe)) { return(System.Text.Encoding.ASCII.GetString(ms.ToArray())); } } } catch (Exception e) { Logger.Error(e, "Failed to produce records to put into Export file at: {0}", Location()); } return(""); }
public string ProcessLine(string line, TVDoc doc) { string[] parts = line.Split(' '); if (parts.Length != 3) { return(""); } if (parts[0].ToUpper() != "GET") { return(""); } if (parts[1].EndsWith("/upcoming.xml")) { MemoryStream ms = new MemoryStream(); doc.GenerateUpcomingXML(ms, doc.NextNShows(doc.Settings.ExportRSSMaxShows, doc.Settings.ExportRSSDaysPast, doc.Settings.ExportRSSMaxDays)); return(System.Text.Encoding.ASCII.GetString(ms.ToArray())); } return(Err()); }
public string ProcessLine(string line, TVDoc doc) { string[] parts = line.Split(' '); if (parts.Length != 3) return ""; if (parts[0].ToUpper() != "GET") return ""; if (parts[1].EndsWith("/upcoming.xml")) { MemoryStream ms = new MemoryStream(); doc.GenerateUpcomingXML(ms, doc.NextNShows(doc.Settings.ExportRSSMaxShows, doc.Settings.ExportRSSDaysPast, doc.Settings.ExportRSSMaxDays)); return System.Text.Encoding.ASCII.GetString(ms.ToArray()); } return Err(); }