Skip to content

Commit

Permalink
Fix for #493
Browse files Browse the repository at this point in the history
  • Loading branch information
SirSparkles committed Sep 9, 2018
1 parent 2affa09 commit c79e63b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions TVRename/TVRename/TVDoc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1430,8 +1430,8 @@ private void RenameAndMissingCheck(ShowItem si, DirFilesCache dfc,bool fullscan)
{
// then add it as officially missing
TheActionList.Add(new ItemMissing(dbep, folder,
System.Web.HttpUtility.HtmlDecode(TVSettings.Instance.FilenameFriendly(
TVSettings.Instance.NamingStyle.NameFor(dbep, null, folder.Length)))));
TVSettings.Instance.FilenameFriendly(
TVSettings.Instance.NamingStyle.NameFor(dbep, null, folder.Length))));
}
}
else
Expand Down
14 changes: 6 additions & 8 deletions TVRename/TheTVDB/Episode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public Episode(XmlReader r)
else if (r.Name == "lastupdated")
SrvLastUpdated = r.ReadElementContentAsLong();
else if (r.Name == "Overview")
Overview = XmlHelper.ReadStringFixQuotesAndSpaces(r);
Overview = System.Web.HttpUtility.HtmlDecode(XmlHelper.ReadStringFixQuotesAndSpaces(r));
else if (r.Name == "Rating")
EpisodeRating = XmlHelper.ReadStringFixQuotesAndSpaces(r);
else if (r.Name == "GuestStars")
Expand All @@ -198,7 +198,7 @@ public Episode(XmlReader r)
else if (r.Name == "Writer")
Writer = XmlHelper.ReadStringFixQuotesAndSpaces(r);
else if (r.Name == "EpisodeName")
Name = XmlHelper.ReadStringFixQuotesAndSpaces(r);
Name = System.Web.HttpUtility.HtmlDecode(XmlHelper.ReadStringFixQuotesAndSpaces(r));
else if (r.Name == "FirstAired")
{
try
Expand Down Expand Up @@ -291,17 +291,15 @@ private void LoadJson(int seriesId, JObject bestLanguageR, JObject backupLanguag
if ((string.IsNullOrWhiteSpace((string) bestLanguageR["episodeName"]) &&
((string) backupLanguageR["episodeName"] != null)))
{
Name = (string) backupLanguageR["episodeName"];
Name = System.Web.HttpUtility.HtmlDecode((string) backupLanguageR["episodeName"]);
items["episodeName"] = Name;
}

if ((string.IsNullOrWhiteSpace(items["overview"]) && ((string) backupLanguageR["overview"] != null)))
{
items["overview"] = (string) backupLanguageR["overview"];
Overview = (string) backupLanguageR["overview"];
Overview = System.Web.HttpUtility.HtmlDecode((string)backupLanguageR["overview"]);
items["overview"] = Overview;
}

items["overview"] = System.Web.HttpUtility.HtmlDecode(items["overview"]);
}

private void LoadJson(int seriesId, JObject r)
Expand Down Expand Up @@ -417,7 +415,7 @@ public string Name
if (string.IsNullOrEmpty(mName))
return "Aired Episode " + AiredEpNum;

return System.Web.HttpUtility.HtmlDecode(mName);
return mName;
}
set => mName = System.Web.HttpUtility.HtmlDecode(value);
}
Expand Down
11 changes: 6 additions & 5 deletions TVRename/TheTVDB/SeriesInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ private void LoadXml(XmlReader r)
if (r.Name == "id")
TvdbCode = r.ReadElementContentAsInt();
else if (r.Name == "SeriesName")
Name = XmlHelper.ReadStringFixQuotesAndSpaces(r);
Name = System.Web.HttpUtility.HtmlDecode(XmlHelper.ReadStringFixQuotesAndSpaces(r));
else if (r.Name == "lastupdated")
SrvLastUpdated = r.ReadElementContentAsLong();
else if ((r.Name == "Language") || (r.Name == "language"))
Expand Down Expand Up @@ -375,6 +375,8 @@ private void LoadJson(JObject r)
{
if (seriesItems.Name == "aliases") Items[seriesItems.Name] = JsonHelper.Flatten(seriesItems.Value, "|");
else if (seriesItems.Name == "genre") Items[seriesItems.Name] = JsonHelper.Flatten(seriesItems.Value, "|");
else if (seriesItems.Name == "overview")
Items[seriesItems.Name] = System.Web.HttpUtility.HtmlDecode((string)seriesItems.Value);
else try
{
if (seriesItems.Value != null) Items[seriesItems.Name] = (string)seriesItems.Value;
Expand Down Expand Up @@ -431,15 +433,13 @@ private void LoadJson(JObject bestLanguageR, JObject backupLanguageR)

if ((string.IsNullOrWhiteSpace(Name) && ((string)backupLanguageR["seriesName"] != null)) ){
Name = (string)backupLanguageR["seriesName"];
Items["seriesName"] = Name;
Items["seriesName"] = System.Web.HttpUtility.HtmlDecode(Name);
}

if ((string.IsNullOrWhiteSpace(Items["overview"]) && ((string)backupLanguageR["overview"] != null)) ){
Items["overview"] = (string)backupLanguageR["overview"];
Items["overview"] = System.Web.HttpUtility.HtmlDecode((string)backupLanguageR["overview"]);
}

Items["overview"] = System.Web.HttpUtility.HtmlDecode(Items["overview"]);

//Looking at the data then the aliases, banner and runtime are also different by language

if ((string.IsNullOrWhiteSpace(Items["aliases"])))
Expand All @@ -451,6 +451,7 @@ private void LoadJson(JObject bestLanguageR, JObject backupLanguageR)
{
Items["runtime"] = (string)backupLanguageR["runtime"];
}

if ((string.IsNullOrWhiteSpace(Items["banner"])))
{
Items["banner"] = (string)backupLanguageR["banner"];
Expand Down

0 comments on commit c79e63b

Please sign in to comment.