Plex is not displaying the correct number unwatched episodes for some tv shows recorded by the dvr.
For example, I only have one episode of Flash on my server, but plex is showing two unwatched episodes on the main show page:
I’m using plex server v1.13.9.5439 on ubuntu 18.04 and here is the XML for the show:
<?xml version="1.0" encoding="UTF-8"?>
<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="2" librarySectionTitle="TV Shows" librarySectionUUID="5449069d-efe0-4690-ac3b-7ca99fa73ac9" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1539020086">
<Directory ratingKey="933" key="/library/metadata/933/children" guid="com.plexapp.agents.thetvdb://78650?lang=en" librarySectionTitle="TV Shows" librarySectionID="2" librarySectionKey="/library/sections/2" studio="CBS" type="show" title="The Flash" titleSort="Flash" contentRating="TV-PG" summary="Central City Police forensic scientist Barry Allen's crime lab is struck by lightning. Allen's electrified body is flung into and shatters a cabinet of chemicals, which are both electrified and forced to interact with each other and with his physiology when they come into physical contact with his body. He soon discovers that the accident has changed his body's metabolism and as a result he has gained the ability to move at superhuman speed. 
Barry Allen has become the Flash." index="1" rating="7.2" year="1990" thumb="/library/metadata/933/thumb/1539738467" art="/library/metadata/933/art/1539738467" banner="/library/metadata/933/banner/1539738467" theme="/library/metadata/933/theme/1539738467" duration="3600000" originallyAvailableAt="1990-09-20" leafCount="1" viewedLeafCount="0" childCount="1" addedAt="1539738445" updatedAt="1539738467" autoDeletionItemPolicyUnwatchedLibrary="5" autoDeletionItemPolicyWatchedLibrary="7" leafCount="2" viewedLeafCount="0">
<Genre id="20" filter="genre=20" tag="Action" />
<Genre id="321" filter="genre=321" tag="Adventure" />
<Channel id="12877" filter="channel=12877" tag="503 WDCWDT (CW)" />
<Location path="/mnt/media/tv/The Flash (2014)" />
</Directory>
</MediaContainer>