Exemplo n.º 1
0
        protected override void Do()
        {
            using (System.IO.StreamWriter file = new System.IO.StreamWriter(Location()))
            {
                file.WriteLine("Show Name,Season,Episode,Episode Name,Air Date,Folder,Nice Name,thetvdb.com Code");

                foreach (ItemMissing im in TheActionList.MissingItems().ToList())
                {
                    ProcessedEpisode pe = im.Episode;
                    DateTime?        dt = pe.GetAirDateDt(true);
                    file.WriteLine(
                        $"\"{pe.TheSeries.Name}\",{pe.AppropriateSeasonNumber},{pe.NumsAsString()},\"{pe.Name}\",{dt:G},\"{im.TargetFolder}\",\"{im.Filename}\",{pe.SeriesId}");
                }
            }
        }
Exemplo n.º 2
0
        protected override void Do()
        {
            XmlWriterSettings settings = new XmlWriterSettings
            {
                Indent = true,
                NewLineOnAttributes = true,
                Encoding            = Encoding.ASCII
            };

            using (XmlWriter writer = XmlWriter.Create(Location(), settings))
            {
                writer.WriteStartDocument();

                writer.WriteStartElement("TVRename");
                writer.WriteAttributeToXml("Version", "2.1");
                writer.WriteStartElement("MissingItems");

                foreach (ItemMissing missing in TheActionList.MissingItems().ToList())
                {
                    writer.WriteStartElement("MissingItem");

                    writer.WriteElement("id", missing.Episode.Show.TvdbCode);
                    writer.WriteElement("title", missing.Episode.TheSeries.Name);
                    writer.WriteElement("season", Helpers.Pad(missing.Episode.AppropriateSeasonNumber));
                    writer.WriteElement("episode", Helpers.Pad(missing.Episode.AppropriateEpNum));
                    writer.WriteElement("episodeName", missing.Episode.Name);
                    writer.WriteElement("description", missing.Episode.Overview);

                    writer.WriteStartElement("pubDate");
                    DateTime?dt = missing.Episode.GetAirDateDt(true);
                    if (dt != null)
                    {
                        writer.WriteValue(dt.Value.ToString("F"));
                    }

                    writer.WriteEndElement();

                    writer.WriteEndElement(); // MissingItem
                }

                writer.WriteEndElement(); // MissingItems
                writer.WriteEndElement(); // tvrename
                writer.WriteEndDocument();
            }
        }