To fix, I modified the script to add in "previously-shown" flag if "New" is never found.
My fix looks like:
#Handle Flags
#KMM - Added this isNew variable did this for Jellyfin guide
isNew = False;
for flag in event["flag"]:
if flag == "New":
programEl.appendChild(self.guideXML.createElement("New"))
isNew = True
#KMM - set is new above when new flag found.
if flag == "Finale":
programEl.appendChild(self.guideXML.createElement("Finale"))
if flag == "Premiere":
programEl.appendChild(self.guideXML.createElement("Premiere"))
#KMM- I then check if new flag was found and if not I add in the previously-show flag ... for jellyfin..
if isNew == False:
programEl.appendChild(self.guideXML.createElement("previously-shown"))
To fix, I modified the script to add in "previously-shown" flag if "New" is never found. My fix looks like: