Exemplo n.º 1
0
        public void WriteXml(XmlWriter writer)
        {
            writer.WriteStartElement("Episode");

            XMLHelper.WriteElementToXML(writer,"id",this.EpisodeID);
            XMLHelper.WriteElementToXML(writer,"seriesid",this.SeriesID);
            XMLHelper.WriteElementToXML(writer,"seasonid",this.SeasonID);
            XMLHelper.WriteElementToXML(writer,"EpisodeNumber",this.EpNum);
            XMLHelper.WriteElementToXML(writer,"SeasonNumber",this.SeasonNumber);
            XMLHelper.WriteElementToXML(writer,"lastupdated",this.Srv_LastUpdated);
            XMLHelper.WriteElementToXML(writer,"Overview",this.Overview);
            XMLHelper.WriteElementToXML(writer,"Rating",this.EpisodeRating);  
            XMLHelper.WriteElementToXML(writer,"GuestStars",this.EpisodeGuestStars);  
            XMLHelper.WriteElementToXML(writer,"EpisodeDirector",this.EpisodeDirector);  
            XMLHelper.WriteElementToXML(writer,"Writer",this.Writer);  
            XMLHelper.WriteElementToXML(writer,"EpisodeName",this.Name);

            if (this.FirstAired != null)
            {
                XMLHelper.WriteElementToXML(writer,"FirstAired",this.FirstAired.Value.ToString("yyyy-MM-dd"));
            }

            foreach (System.Collections.Generic.KeyValuePair<string, string> kvp in this.Items)
            {
                XMLHelper.WriteElementToXML(writer,kvp.Key,kvp.Value);
            }

            writer.WriteEndElement(); //Episode
        }
Exemplo n.º 2
0
        public bool Go(ref bool pause, TVRenameStats stats)
        {
            XmlWriterSettings settings = new XmlWriterSettings
            {
                Indent = true,
                NewLineOnAttributes = true
            };
            // "try" and silently fail.  eg. when file is use by other...
            XmlWriter writer;

            try
            {
                //                XmlWriter writer = XmlWriter.Create(this.Where.FullName, settings);
                writer = XmlWriter.Create(this.Where.FullName, settings);
                if (writer == null)
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                this.Done = true;
                return(true);
            }

            writer.WriteStartElement("FolderTag");
            XMLHelper.WriteElementToXML(writer, "ViewMode", "Movie");
            writer.WriteEndElement();

            writer.Close();
            this.Done = true;
            return(true);
        }
Exemplo n.º 3
0
        public void WriteXml(XmlWriter writer)
        {
            writer.WriteStartElement("Series");

            XMLHelper.WriteElementToXML(writer, "id", this.TVDBCode);
            XMLHelper.WriteElementToXML(writer, "SeriesName", this.Name);
            XMLHelper.WriteElementToXML(writer, "lastupdated", this.Srv_LastUpdated);
            XMLHelper.WriteElementToXML(writer, "LanguageId", this.LanguageId);
            XMLHelper.WriteElementToXML(writer, "Airs_Time", this.AirsTime);

            if (this.FirstAired != null)
            {
                XMLHelper.WriteElementToXML(writer, "FirstAired", this.FirstAired.Value.ToString("yyyy-MM-dd"));
            }

            List <string> skip = new List <String>
            {
                "Airs_Time",
                "lastupdated", "lastUpdated",
                "id", "seriesName", "seriesname", "SeriesName",
                "lastUpdated", "lastupdated",
                "FirstAired", "firstAired",
                "LanguageId", "TimeZone"
            };

            foreach (KeyValuePair <string, string> kvp in this.Items)
            {
                if (!skip.Contains(kvp.Key))
                {
                    XMLHelper.WriteElementToXML(writer, kvp.Key, kvp.Value);
                }
            }

            writer.WriteEndElement(); // series
        }
Exemplo n.º 4
0
        protected override bool generate(System.IO.Stream str, List <ProcessedEpisode> elist)
        {
            if (elist == null)
            {
                return(false);
            }

            try
            {
                XmlWriterSettings settings = new XmlWriterSettings
                {
                    Indent = true,
                    NewLineOnAttributes = true,
                    Encoding            = System.Text.Encoding.ASCII
                };
                using (XmlWriter writer = XmlWriter.Create(str, settings))
                {
                    writer.WriteStartDocument();
                    writer.WriteStartElement("rss");
                    XMLHelper.WriteAttributeToXML(writer, "version", "2.0");
                    writer.WriteStartElement("channel");
                    XMLHelper.WriteElementToXML(writer, "title", "Upcoming Shows");
                    XMLHelper.WriteElementToXML(writer, "title", "http://tvrename.com");
                    XMLHelper.WriteElementToXML(writer, "description", "Upcoming shows, exported by TVRename");

                    foreach (ProcessedEpisode ei in elist)
                    {
                        string niceName = TVSettings.Instance.NamingStyle.NameForExt(ei, null, 0);

                        writer.WriteStartElement("item");

                        XMLHelper.WriteElementToXML(writer, "title", ei.HowLong() + " " + ei.DayOfWeek() + " " + ei.TimeOfDay() + " " + niceName);
                        XMLHelper.WriteElementToXML(writer, "link", TheTVDB.Instance.WebsiteURL(ei.TheSeries.TVDBCode, ei.SeasonID, false));
                        XMLHelper.WriteElementToXML(writer, "description", niceName + "<br/>" + ei.Overview);

                        writer.WriteStartElement("pubDate");
                        DateTime?dt = ei.GetAirDateDT(true);
                        if (dt != null)
                        {
                            writer.WriteValue(dt.Value.ToString("r"));
                        }
                        writer.WriteEndElement(); //pubDate

                        writer.WriteEndElement(); // item
                    }
                    writer.WriteEndElement();     //channel
                    writer.WriteEndElement();     //rss
                    writer.WriteEndDocument();
                    writer.Close();
                }
                return(true);
            } // try
            catch (Exception e)
            {
                logger.Error(e);
                return(false);
            }
        }
Exemplo n.º 5
0
        public void WriteXML(XmlWriter writer)
        {
            writer.WriteStartElement("TheSearchers");
            XMLHelper.WriteElementToXML(writer, "Current", this.CurrentSearch);

            for (int i = 0; i < this.Count(); i++)
            {
                writer.WriteStartElement("Choice");
                XMLHelper.WriteAttributeToXML(writer, "Name", this.Choices[i].Name);
                XMLHelper.WriteAttributeToXML(writer, "URL2", this.Choices[i].URL2);
                writer.WriteEndElement();
            }
            writer.WriteEndElement(); // TheSearchers
        }
Exemplo n.º 6
0
        public bool Go(ref bool pause, TVRenameStats stats)
        {
            XmlWriterSettings settings = new XmlWriterSettings
            {
                Indent = true,
                NewLineOnAttributes = true
            };
            // "try" and silently fail.  eg. when file is use by other...
            XmlWriter writer;

            try
            {
                writer = XmlWriter.Create(this.Where.FullName, settings);
                if (writer == null)
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                this.Done = true;
                return(true);
            }

            writer.WriteStartElement("FolderTag");
            // is it a show or season folder
            if (snum >= 0)
            {
                // if episode thumbnails are generated, use ViewMode Photo, otherwise use List
                if (TVSettings.Instance.EpJPGs)
                {
                    XMLHelper.WriteElementToXML(writer, "ViewMode", "Photo");
                }
                else
                {
                    XMLHelper.WriteElementToXML(writer, "ViewMode", "List");
                }
                XMLHelper.WriteElementToXML(writer, "ViewType", "Video");
            }
            else
            {
                XMLHelper.WriteElementToXML(writer, "ViewMode", "Preview");
            }
            writer.WriteEndElement();

            writer.Close();
            this.Done = true;
            return(true);
        }
Exemplo n.º 7
0
        public override bool Go(ref bool pause, TVRenameStats stats)
        {
            XmlWriterSettings settings = new XmlWriterSettings
            {
                Indent = true,
                NewLineOnAttributes = true
            };

            try
            {
                using (XmlWriter writer = XmlWriter.Create(this.Where.FullName, settings))
                {
                    writer.WriteStartElement("FolderTag");
                    // is it a show or season folder
                    if (this.Snum >= 0)
                    {
                        // if episode thumbnails are generated, use ViewMode Photo, otherwise use List
                        XMLHelper.WriteElementToXML(writer, "ViewMode", TVSettings.Instance.EpJPGs ? "Photo" : "List");
                        XMLHelper.WriteElementToXML(writer, "ViewType", "Video");
                    }
                    else
                    {
                        XMLHelper.WriteElementToXML(writer, "ViewMode", "Preview");
                    }

                    writer.WriteEndElement();
                }
            }

            catch (Exception e)
            {
                this.Error     = true;
                this.ErrorText = e.Message;
                this.Done      = true;
                return(false);
            }

            this.Done = true;
            return(true);
        }
Exemplo n.º 8
0
        public void WriteXml(XmlWriter writer)
        {
            writer.WriteStartElement("Series");

            XMLHelper.WriteElementToXML(writer, "id", this.TVDBCode);
            XMLHelper.WriteElementToXML(writer, "SeriesName", this.Name);
            XMLHelper.WriteElementToXML(writer, "lastupdated", this.Srv_LastUpdated);
            XMLHelper.WriteElementToXML(writer, "Language", this.LanguageId);

            foreach (System.Collections.Generic.KeyValuePair <string, string> kvp in this.Items)
            {
                XMLHelper.WriteElementToXML(writer, kvp.Key, kvp.Value);
            }
            XMLHelper.WriteElementToXML(writer, "TimeZone", this.ShowTimeZone);

            if (this.FirstAired != null)
            {
                XMLHelper.WriteElementToXML(writer, "FirstAired", this.FirstAired.Value.ToString("yyyy-MM-dd"));
            }

            writer.WriteEndElement(); // series
        }
Exemplo n.º 9
0
        protected override bool  Generate(System.IO.Stream str, List <ProcessedEpisode> elist)
        {
            DirFilesCache dfc = new DirFilesCache();

            try
            {
                XmlWriterSettings settings = new XmlWriterSettings();
                settings.Indent = true;
                settings.NewLineOnAttributes = true;
                settings.Encoding            = System.Text.Encoding.ASCII;
                using (XmlWriter writer = XmlWriter.Create(str, settings))
                {
                    writer.WriteStartDocument();
                    writer.WriteStartElement("WhenToWatch");

                    foreach (ProcessedEpisode ei in elist)
                    {
                        string niceName = TVSettings.Instance.NamingStyle.NameForExt(ei, null, 0);

                        writer.WriteStartElement("item");
                        XMLHelper.WriteElementToXML(writer, "id", ei.TheSeries.TVDBCode);
                        XMLHelper.WriteElementToXML(writer, "SeriesName", ei.TheSeries.Name);
                        XMLHelper.WriteElementToXML(writer, "SeasonNumber", Helpers.pad(ei.SeasonNumber));
                        XMLHelper.WriteElementToXML(writer, "EpisodeNumber", Helpers.pad(ei.EpNum));
                        XMLHelper.WriteElementToXML(writer, "EpisodeName", ei.Name);

                        writer.WriteStartElement("available");
                        DateTime?airdt = ei.GetAirDateDT(true);

                        if (airdt.Value.CompareTo(DateTime.Now) < 0) // has aired
                        {
                            List <FileInfo> fl = mDoc.FindEpOnDisk(dfc, ei);
                            if ((fl != null) && (fl.Count > 0))
                            {
                                writer.WriteValue("true");
                            }
                            else if (ei.SI.DoMissingCheck)
                            {
                                writer.WriteValue("false");
                            }
                        }

                        writer.WriteEndElement();
                        XMLHelper.WriteElementToXML(writer, "Overview", ei.Overview);

                        writer.WriteStartElement("FirstAired");
                        DateTime?dt = ei.GetAirDateDT(true);
                        if (dt != null)
                        {
                            writer.WriteValue(dt.Value.ToString("F"));
                        }
                        writer.WriteEndElement();

                        XMLHelper.WriteElementToXML(writer, "Rating", ei.EpisodeRating);
                        XMLHelper.WriteElementToXML(writer, "filename", ei.GetFilename());

                        writer.WriteEndElement(); // item
                    }
                    writer.WriteEndElement();
                    writer.WriteEndDocument();
                    writer.Close();
                }
                return(true);
            } // try
            catch (Exception e)
            {
                if ((!this.mDoc.Args.Unattended) && (!this.mDoc.Args.Hide))
                {
                    MessageBox.Show(e.Message);
                }
                Logger.Error(e);
                return(false);
            }
        }
Exemplo n.º 10
0
        public bool Go(ref bool pause, TVRenameStats stats)
        {
            XmlWriterSettings settings = new XmlWriterSettings
            {
                Indent = true,
                NewLineOnAttributes = true
            };
            // "try" and silently fail.  eg. when file is use by other...
            XmlWriter writer;

            try
            {
                //                XmlWriter writer = XmlWriter.Create(this.Where.FullName, settings);
                writer = XmlWriter.Create(this.Where.FullName, settings);
                if (writer == null)
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                this.Done = true;
                return(true);
            }


            if (this.Episode != null) // specific episode
            {
                // See: http://xbmc.org/wiki/?title=Import_-_Export_Library#TV_Episodes
                writer.WriteStartElement("details");
                writer.WriteStartElement("movie");
                XMLHelper.WriteElementToXML(writer, "title", this.Episode.Name);
                XMLHelper.WriteElementToXML(writer, "season", this.Episode.SeasonNumber);
                XMLHelper.WriteElementToXML(writer, "episode", this.Episode.EpNum);

                writer.WriteStartElement("year");
                if (this.Episode.FirstAired != null)
                {
                    writer.WriteValue(this.Episode.FirstAired.Value.ToString("yyyy"));
                }
                writer.WriteEndElement();

                writer.WriteStartElement("rating");
                string rating = (this.Episode.EpisodeRating);
                if (!string.IsNullOrEmpty(rating))
                {
                    rating = rating.Trim('.');
                    rating = rating.Replace(".", "");
                    writer.WriteValue(rating);
                }
                writer.WriteEndElement();  // rating

                //Get the Series OverView
                string sov = this.Episode.SI.TheSeries().GetOverview();
                if (!string.IsNullOrEmpty(sov))
                {
                    XMLHelper.WriteElementToXML(writer, "plot", sov);
                }

                //Get the Episode overview
                XMLHelper.WriteElementToXML(writer, "episodeplot", this.Episode.Overview);

                if (this.Episode.SI != null)
                {
                    WriteInfo(writer, this.Episode.SI.TheSeries().GetRating(), "mpaa");
                }

                //Runtime...taken from overall Series, not episode specific due to thetvdb
                string rt = this.Episode.SI.TheSeries().GetRuntime();
                if (!string.IsNullOrEmpty(rt))
                {
                    XMLHelper.WriteElementToXML(writer, "runtime", rt + " min");
                }

                //Genres...taken from overall Series, not episode specific due to thetvdb
                writer.WriteStartElement("genres");
                string genre = String.Join(" / ", this.Episode.SI.TheSeries().GetGenres());
                if (!string.IsNullOrEmpty(genre))
                {
                    XMLHelper.WriteElementToXML(writer, "genre", genre);
                }
                writer.WriteEndElement();  // genres

                //Director(s)
                if (!String.IsNullOrEmpty(this.Episode.EpisodeDirector))
                {
                    string EpDirector = this.Episode.EpisodeDirector;
                    if (!string.IsNullOrEmpty(EpDirector))
                    {
                        foreach (string Daa in EpDirector.Split('|'))
                        {
                            if (string.IsNullOrEmpty(Daa))
                            {
                                continue;
                            }

                            XMLHelper.WriteElementToXML(writer, "director", Daa);
                        }
                    }
                }

                //Writers(s)
                if (!String.IsNullOrEmpty(this.Episode.Writer))
                {
                    string EpWriter = this.Episode.Writer;
                    if (!string.IsNullOrEmpty(EpWriter))
                    {
                        XMLHelper.WriteElementToXML(writer, "credits", EpWriter);
                    }
                }


                writer.WriteStartElement("cast");

                // actors...
                if (this.Episode.SI != null)
                {
                    foreach (string aa in this.Episode.SI.TheSeries().GetActors())
                    {
                        if (string.IsNullOrEmpty(aa))
                        {
                            continue;
                        }

                        XMLHelper.WriteElementToXML(writer, "actor", aa);
                    }
                }

                writer.WriteEndElement(); // cast
                writer.WriteEndElement(); // movie
                writer.WriteEndElement(); // details
            }
            else if (this.SI != null)     // show overview (Series.xml)
            {
                // http://www.xbmc.org/wiki/?title=Import_-_Export_Library#TV_Shows

                writer.WriteStartElement("details");
                writer.WriteStartElement("movie");

                XMLHelper.WriteElementToXML(writer, "title", this.SI.ShowName);

                writer.WriteStartElement("genres");
                string genre = String.Join(" / ", this.SI.TheSeries().GetGenres());
                if (!string.IsNullOrEmpty(genre))
                {
                    XMLHelper.WriteElementToXML(writer, "genre", genre);
                }
                writer.WriteEndElement();  // genres

                WriteInfo(writer, this.SI.TheSeries().GetFirstAired(), "premiered");
                WriteInfo(writer, this.SI.TheSeries().GetYear(), "year");

                writer.WriteStartElement("rating");
                string rating = this.SI.TheSeries().GetRating();
                if (!string.IsNullOrEmpty(rating))
                {
                    rating = rating.Trim('.');
                    rating = rating.Replace(".", "");
                    writer.WriteValue(rating);
                }
                writer.WriteEndElement();  // rating

                WriteInfo(writer, this.SI.TheSeries().getStatus(), "status");

                WriteInfo(writer, this.SI.TheSeries().GetRating(), "mpaa");
                WriteInfo(writer, this.SI.TheSeries().GetIMDB(), "id", "moviedb", "imdb");

                XMLHelper.WriteElementToXML(writer, "tvdbid", this.SI.TheSeries().TVDBCode);

                string rt = this.SI.TheSeries().GetRuntime();
                if (!string.IsNullOrEmpty(rt))
                {
                    XMLHelper.WriteElementToXML(writer, "runtime", rt + " min");
                }

                WriteInfo(writer, this.SI.TheSeries().GetOverview(), "plot");

                writer.WriteStartElement("cast");

                // actors...

                foreach (string aa in this.SI.TheSeries().GetActors())
                {
                    if (string.IsNullOrEmpty(aa))
                    {
                        continue;
                    }
                    XMLHelper.WriteElementToXML(writer, "actor", aa);
                }

                writer.WriteEndElement(); // cast
                writer.WriteEndElement(); // movie
                writer.WriteEndElement(); // tvshow
            }

            writer.Close();
            this.Done = true;
            return(true);
        }
Exemplo n.º 11
0
        private void writeEpisodeDetailsFor(Episode episode, XmlWriter writer)
        {
            // See: http://xbmc.org/wiki/?title=Import_-_Export_Library#TV_Episodes
            writer.WriteStartElement("episodedetails");

            XMLHelper.WriteElementToXML(writer, "title", episode.Name);
            XMLHelper.WriteElementToXML(writer, "rating", episode.EpisodeRating);
            XMLHelper.WriteElementToXML(writer, "season", episode.SeasonNumber);
            XMLHelper.WriteElementToXML(writer, "episode", episode.EpNum);
            XMLHelper.WriteElementToXML(writer, "plot", episode.Overview);

            writer.WriteStartElement("aired");
            if (episode.FirstAired != null)
            {
                writer.WriteValue(episode.FirstAired.Value.ToString("yyyy-MM-dd"));
            }
            writer.WriteEndElement();

            if (this.Episode.SI != null)
            {
                XMLHelper.WriteElementToXML(writer, "mpaa", this.Episode.SI.TheSeries().GetRating());
            }

            //Director(s)
            if (!String.IsNullOrEmpty(episode.EpisodeDirector))
            {
                string EpDirector = episode.EpisodeDirector;
                if (!string.IsNullOrEmpty(EpDirector))
                {
                    foreach (string Daa in EpDirector.Split('|'))
                    {
                        if (string.IsNullOrEmpty(Daa))
                        {
                            continue;
                        }

                        XMLHelper.WriteElementToXML(writer, "director", Daa);
                    }
                }
            }

            //Writers(s)
            if (!String.IsNullOrEmpty(episode.Writer))
            {
                string EpWriter = episode.Writer;
                if (!string.IsNullOrEmpty(EpWriter))
                {
                    XMLHelper.WriteElementToXML(writer, "credits", EpWriter);
                }
            }

            // Guest Stars...
            if (!String.IsNullOrEmpty(episode.EpisodeGuestStars))
            {
                string RecurringActors = "";

                if (this.Episode.SI != null)
                {
                    RecurringActors = String.Join("|", this.Episode.SI.TheSeries().GetActors());
                }

                string GuestActors = episode.EpisodeGuestStars;
                if (!string.IsNullOrEmpty(GuestActors))
                {
                    foreach (string Gaa in GuestActors.Split('|'))
                    {
                        if (string.IsNullOrEmpty(Gaa))
                        {
                            continue;
                        }

                        // Skip if the guest actor is also in the overal recurring list
                        if (!string.IsNullOrEmpty(RecurringActors) && RecurringActors.Contains(Gaa))
                        {
                            continue;
                        }

                        writer.WriteStartElement("actor");
                        XMLHelper.WriteElementToXML(writer, "name", Gaa);
                        writer.WriteEndElement(); // actor
                    }
                }
            }

            // actors...
            if (this.Episode.SI != null)
            {
                foreach (string aa in this.Episode.SI.TheSeries().GetActors())
                {
                    if (string.IsNullOrEmpty(aa))
                    {
                        continue;
                    }

                    writer.WriteStartElement("actor");
                    XMLHelper.WriteElementToXML(writer, "name", aa);
                    writer.WriteEndElement(); // actor
                }
            }

            writer.WriteEndElement(); // episodedetails
        }
Exemplo n.º 12
0
        public bool Go(ref bool pause, TVRenameStats stats)
        {
            XmlWriterSettings settings = new XmlWriterSettings
            {
                Indent = true,
                NewLineOnAttributes = true
            };
            // "try" and silently fail.  eg. when file is use by other...
            XmlWriter writer;

            try
            {
                //                XmlWriter writer = XmlWriter.Create(this.Where.FullName, settings);
                writer = XmlWriter.Create(this.Where.FullName, settings);
                if (writer == null)
                {
                    return(false);
                }
            }
            catch (Exception)
            {
                this.Done = true;
                return(true);
            }

            if (this.Episode != null) // specific episode
            {
                // See: http://xbmc.org/wiki/?title=Import_-_Export_Library#TV_Episodes
                writer.WriteStartElement("episodedetails");

                XMLHelper.WriteElementToXML(writer, "title", this.Episode.Name);
                XMLHelper.WriteElementToXML(writer, "rating", this.Episode.EpisodeRating);
                XMLHelper.WriteElementToXML(writer, "season", this.Episode.SeasonNumber);
                XMLHelper.WriteElementToXML(writer, "episode", this.Episode.EpNum);
                XMLHelper.WriteElementToXML(writer, "plot", this.Episode.Overview);

                writer.WriteStartElement("aired");
                if (this.Episode.FirstAired != null)
                {
                    writer.WriteValue(this.Episode.FirstAired.Value.ToString("yyyy-MM-dd"));
                }
                writer.WriteEndElement();

                if (this.Episode.SI != null)
                {
                    WriteInfo(writer, this.Episode.SI, "ContentRating", "mpaa");
                }

                //Director(s)
                if (!String.IsNullOrEmpty(this.Episode.EpisodeDirector))
                {
                    string EpDirector = this.Episode.EpisodeDirector;
                    if (!string.IsNullOrEmpty(EpDirector))
                    {
                        foreach (string Daa in EpDirector.Split('|'))
                        {
                            if (string.IsNullOrEmpty(Daa))
                            {
                                continue;
                            }

                            XMLHelper.WriteElementToXML(writer, "director", Daa);
                        }
                    }
                }

                //Writers(s)
                if (!String.IsNullOrEmpty(this.Episode.Writer))
                {
                    string EpWriter = this.Episode.Writer;
                    if (!string.IsNullOrEmpty(EpWriter))
                    {
                        XMLHelper.WriteElementToXML(writer, "credits", EpWriter);
                    }
                }

                // Guest Stars...
                if (!String.IsNullOrEmpty(this.Episode.EpisodeGuestStars))
                {
                    string RecurringActors = "";

                    if (this.Episode.SI != null)
                    {
                        RecurringActors = this.Episode.SI.TheSeries().GetItem("Actors");
                    }

                    string GuestActors = this.Episode.EpisodeGuestStars;
                    if (!string.IsNullOrEmpty(GuestActors))
                    {
                        foreach (string Gaa in GuestActors.Split('|'))
                        {
                            if (string.IsNullOrEmpty(Gaa))
                            {
                                continue;
                            }

                            // Skip if the guest actor is also in the overal recurring list
                            if (!string.IsNullOrEmpty(RecurringActors) && RecurringActors.Contains(Gaa))
                            {
                                continue;
                            }

                            writer.WriteStartElement("actor");
                            XMLHelper.WriteElementToXML(writer, "name", Gaa);
                            writer.WriteEndElement(); // actor
                        }
                    }
                }

                // actors...
                if (this.Episode.SI != null)
                {
                    string actors = this.Episode.SI.TheSeries().GetItem("Actors");
                    if (!string.IsNullOrEmpty(actors))
                    {
                        foreach (string aa in actors.Split('|'))
                        {
                            if (string.IsNullOrEmpty(aa))
                            {
                                continue;
                            }

                            writer.WriteStartElement("actor");
                            XMLHelper.WriteElementToXML(writer, "name", aa);
                            writer.WriteEndElement(); // actor
                        }
                    }
                }

                writer.WriteEndElement(); // episodedetails
            }
            else if (this.SI != null)     // show overview (tvshow.nfo)
            {
                // http://www.xbmc.org/wiki/?title=Import_-_Export_Library#TV_Shows

                writer.WriteStartElement("tvshow");

                XMLHelper.WriteElementToXML(writer, "title", this.SI.ShowName);

                XMLHelper.WriteElementToXML(writer, "episodeguideurl", TheTVDB.BuildURL(true, true, this.SI.TVDBCode, TheTVDB.Instance.RequestLanguage));

                WriteInfo(writer, this.SI, "Overview", "plot");

                string genre = this.SI.TheSeries().GetItem("Genre");
                if (!string.IsNullOrEmpty(genre))
                {
                    genre = genre.Trim('|');
                    genre = genre.Replace("|", " / ");
                    XMLHelper.WriteElementToXML(writer, "genre", genre);
                }

                WriteInfo(writer, this.SI, "FirstAired", "premiered");
                WriteInfo(writer, this.SI, "Year", "year");
                WriteInfo(writer, this.SI, "Rating", "rating");
                WriteInfo(writer, this.SI, "Status", "status");

                // actors...
                string actors = this.SI.TheSeries().GetItem("Actors");
                if (!string.IsNullOrEmpty(actors))
                {
                    foreach (string aa in actors.Split('|'))
                    {
                        if (string.IsNullOrEmpty(aa))
                        {
                            continue;
                        }

                        writer.WriteStartElement("actor");
                        XMLHelper.WriteElementToXML(writer, "name", aa);
                        writer.WriteEndElement(); // actor
                    }
                }

                WriteInfo(writer, this.SI, "ContentRating", "mpaa");
                WriteInfo(writer, this.SI, "IMDB_ID", "id", "moviedb", "imdb");

                XMLHelper.WriteElementToXML(writer, "tvdbid", this.SI.TheSeries().TVDBCode);

                string rt = this.SI.TheSeries().GetItem("Runtime");
                if (!string.IsNullOrEmpty(rt))
                {
                    XMLHelper.WriteElementToXML(writer, "runtime", rt + " minutes");
                }

                writer.WriteEndElement(); // tvshow
            }

            try
            {
                writer.Close();
            }
            catch (Exception e)
            {
                this.ErrorText = e.Message;
                this.Error     = true;
                this.Done      = true;
                return(false);
            }

            this.Done = true;
            return(true);
        }