Plex wrongly matching TV episodes with multiple versions

Server Version#: 1.30.0.6486
Player Version#: Any

For a daily TV show, I keep two versions: the original, and a manually sped-up version at 1.25x speed. (This whole issue would be moot if Plex added playback speed options!)

For example:

TV Shows/The Late Show with Stephen Colbert
└── Season 08
    ├── The Late Show with Stephen Colbert - 2022.12.05 - fast.mkv
    ├── The Late Show with Stephen Colbert - 2022.12.05.mkv
    ├── The Late Show with Stephen Colbert - 2022.12.06 - fast.mkv
    ├── The Late Show with Stephen Colbert - 2022.12.06.mkv
    ├── The Late Show with Stephen Colbert - 2022.12.07 - fast.mkv
    ├── The Late Show with Stephen Colbert - 2022.12.07.mkv
    ├── The Late Show with Stephen Colbert - 2022.12.08 - fast.mkv
    └── The Late Show with Stephen Colbert - 2022.12.08.mkv

You can see what those episodes should be here: List of The Late Show with Stephen Colbert episodes (2022) - Wikipedia

However, in Plex (any client, any version), they get wrongly matched like:

Additionally:

  1. If you “Get Info” on any of those 4 episodes, they are correctly matched to the episode files with their two versions each, just not the metadata about them, which is just the first two episodes repeated.

  2. Only the “real” first episode is partly watched (2022.12.05); the second episode shown here partly played is actually unwatched.

I don’t believe there’s a way to fix this.

I have two copies of this show. One in English and one in German with Subtitles in completely different libraries.
Screenshot (927)

If the show is matched with an agent, it carries the same xml info so Plex regards it as the same episode no matter what you do

I guess you could unmatch one of the episodes but I suspect that’s not the solution you’re looking for

@JaysPlex That’s a different issue and seems to be working correctly, although maybe not to your personal preference.

My issue isn’t that it’s showing two versions of the same episode; it’s showing the same episode for two different episodes.

In my screenshot where you visually see 2 episodes duplicated as 4, that’s actually 4 unique episodes getting shown as 2-but-duplicated.

Thanks for the post, I’ll take a look at this. It might be something weird happening with our matching against dates instead of episode numbers.

Thanks @drzoidberg33! Let me know if there’s any other information I can provide to assist with debugging.

Just tested with 2 episodes named the same as you have, and they matched properly for me.

Have you checked the metadata for your files to see if maybe they have the same title.

Same here

It must have something to do with the way the files are duplicated and named unless you’re using an old agent I suppose

I tried both naming by date and s08e46 method and both work, pulling the right show titles and descriptions for all the episodes listed in your screen shot

@JaysPlex It looks like you have the 4 episodes, but not the two versions of each (8 files total). This is only a problem with multiple versions.

unless you’re using an old agent I suppose

I’m using the “Plex TV Series” agent.

@anon18523487

Have you checked the metadata for your files to see if maybe they have the same title.

There’s no title metadata on the files themselves, and the wrong episode matching actually often changes as files are added/removed, implying it’s not the file itself.

For 2022.12.05 and 2022.12.06, which should be “John David Washington” and “Red, White, & Greenland” but are both showing as two entries for “John David Washington” for me, “Get Info” shows the correct info for each, including the two version filenames:

“View XML” tells the same story:

For 2022.12.05:

<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="2" librarySectionTitle="TV Shows" librarySectionUUID="9af57dec-747d-45af-9c1b-c21888b7570f" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1670478210">
  <Video ratingKey="5470" key="/library/metadata/5470" parentRatingKey="5468" grandparentRatingKey="5467" guid="plex://episode/638cb80ff98dec8d57a48d10" parentGuid="plex://season/6318c5815a29fa7c70a7b745" grandparentGuid="plex://show/5d9c0807ffd9ef001e98b056" type="episode" title="John David Washington, Naomi Osaka, Spoon" grandparentKey="/library/metadata/5467" parentKey="/library/metadata/5468" librarySectionTitle="TV Shows" librarySectionID="2" librarySectionKey="/library/sections/2" grandparentTitle="The Late Show with Stephen Colbert" parentTitle="Season 8" contentRating="TV-PG" summary="Stephen welcomes actor John David Washington, tennis player Naomi Osaka, and a musical performance by Spoon." index="46" parentIndex="8" viewCount="1" lastViewedAt="1670955868" thumb="/library/metadata/5470/thumb/1670492595" art="/library/metadata/5467/art/1670923346" grandparentThumb="/library/metadata/5467/thumb/1670923346" grandparentArt="/library/metadata/5467/art/1670923346" grandparentTheme="/library/metadata/5467/theme/1670923346" duration="1951607" originallyAvailableAt="2022-12-05" addedAt="1670343250" updatedAt="1670492595">
    <Media id="9777" duration="1951607" bitrate="1498" width="1280" height="720" aspectRatio="1.78" audioChannels="2" audioCodec="vorbis" videoCodec="h264" videoResolution="720" container="mkv" videoFrameRate="NTSC" videoProfile="high">
      <Part accessible="1" exists="1" id="11341" key="/library/parts/11341/1670343147/file.mkv" duration="1951607" file="\\Synchole\Plex Media\TV Shows\The Late Show with Stephen Colbert\Season 08\The Late Show with Stephen Colbert - 2022.12.05 - fast.mkv" size="366806762" container="mkv" deepAnalysisVersion="6" requiredBandwidths="3044,2355,2355,2355,2355,2355,2355,2355" videoProfile="high">
        <Stream id="32865" streamType="1" codec="h264" index="0" bitrate="1409" bitDepth="8" chromaLocation="left" chromaSubsampling="4:2:0" codedHeight="720" codedWidth="1280" colorPrimaries="bt709" colorRange="tv" colorSpace="bt709" colorTrc="bt709" frameRate="29.970" hasScalingMatrix="0" height="720" level="31" profile="high" refFrames="4" requiredBandwidths="2949,2267,2267,2267,2267,2267,2267,2267" scanType="progressive" width="1280" displayTitle="720p (H.264)" extendedDisplayTitle="720p (H.264)"></Stream>
        <Stream id="32866" streamType="2" selected="1" codec="vorbis" index="1" channels="2" bitrate="89" audioChannelLayout="stereo" requiredBandwidths="91,91,91,91,91,91,91,91" samplingRate="48000" displayTitle="Unknown (VORBIS Stereo)" extendedDisplayTitle="Unknown (VORBIS Stereo)"></Stream>
      </Part>
    </Media>
    <Media id="9778" duration="2439509" bitrate="3108" width="1280" height="720" aspectRatio="1.78" audioChannels="2" audioCodec="aac" videoCodec="h264" videoResolution="720" container="mkv" videoFrameRate="NTSC" audioProfile="lc" videoProfile="high">
      <Part accessible="1" exists="1" id="11342" key="/library/parts/11342/1670328169/file.mkv" duration="2439509" file="\\Synchole\Plex Media\TV Shows\The Late Show with Stephen Colbert\Season 08\The Late Show with Stephen Colbert - 2022.12.05.mkv" size="948493494" audioProfile="lc" container="mkv" deepAnalysisVersion="6" requiredBandwidths="3107,3107,3107,3107,3107,3107,3107,3107" videoProfile="high">
        <Stream id="32867" streamType="1" default="1" codec="h264" index="0" bitrate="2982" bitDepth="8" chromaLocation="left" chromaSubsampling="4:2:0" codedHeight="720" codedWidth="1280" colorPrimaries="bt709" colorRange="tv" colorSpace="bt709" colorTrc="bt709" frameRate="29.970" hasScalingMatrix="0" height="720" level="40" profile="high" refFrames="5" requiredBandwidths="2981,2981,2981,2981,2981,2981,2981,2981" scanType="progressive" width="1280" displayTitle="720p (H.264)" extendedDisplayTitle="720p (H.264)"></Stream>
        <Stream id="32868" streamType="2" selected="1" default="1" codec="aac" index="1" channels="2" bitrate="125" language="English" languageTag="en" languageCode="eng" profile="lc" requiredBandwidths="126,126,126,126,126,126,126,126" samplingRate="48000" displayTitle="English (AAC Stereo)" extendedDisplayTitle="English (AAC Stereo)"></Stream>
        <Stream id="32869" streamType="3" codec="srt" index="2" bitrate="0" language="English" languageTag="en" languageCode="eng" requiredBandwidths="1,1,1,1,1,1,1,1" title="English [SDH]" displayTitle="English (SRT)" extendedDisplayTitle="English [SDH] (SRT)"></Stream>
      </Part>
    </Media>
    <Guid id="imdb://tt23951432"/>
    <Guid id="tmdb://4084735"/>
    <Guid id="tvdb://9483238"/>
    <Role id="41040" filter="actor=41040" tag="John David Washington" tagKey="5d77682a151a60001f24b675" role="" thumb="https://metadata-static.plex.tv/c/people/cbf54ec545d040545361adb928c2ab99.jpg"/>
    <Role id="41041" filter="actor=41041" tag="Naomi Osaka" tagKey="5fb545dcac6cd9002db5140f" role=""/>
    <Role id="41042" filter="actor=41042" tag="Spoon" tagKey="5fe8cc970a708b002ddef5d8" role=""/>
    <Extras size="0"></Extras>
    <Related></Related>
  </Video>
</MediaContainer>

and for 2022.12.06:

<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="2" librarySectionTitle="TV Shows" librarySectionUUID="9af57dec-747d-45af-9c1b-c21888b7570f" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1670478210">
  <Video ratingKey="5471" key="/library/metadata/5471" parentRatingKey="5468" grandparentRatingKey="5467" guid="plex://episode/638cb80ff98dec8d57a48d10" parentGuid="plex://season/6318c5815a29fa7c70a7b745" grandparentGuid="plex://show/5d9c0807ffd9ef001e98b056" type="episode" title="John David Washington, Naomi Osaka, Spoon" grandparentKey="/library/metadata/5467" parentKey="/library/metadata/5468" librarySectionTitle="TV Shows" librarySectionID="2" librarySectionKey="/library/sections/2" grandparentTitle="The Late Show with Stephen Colbert" parentTitle="Season 8" contentRating="TV-PG" summary="Stephen welcomes actor John David Washington, tennis player Naomi Osaka, and a musical performance by Spoon." index="46" parentIndex="8" viewCount="1" lastViewedAt="1670955868" thumb="/library/metadata/5471/thumb/1670492595" art="/library/metadata/5467/art/1670923346" grandparentThumb="/library/metadata/5467/thumb/1670923346" grandparentArt="/library/metadata/5467/art/1670923346" grandparentTheme="/library/metadata/5467/theme/1670923346" duration="1951564" originallyAvailableAt="2022-12-05" addedAt="1670458953" updatedAt="1670492595">
    <Media id="9779" duration="1951564" bitrate="1722" width="1280" height="720" aspectRatio="1.78" audioChannels="2" audioCodec="vorbis" videoCodec="h264" videoResolution="720" container="mkv" videoFrameRate="NTSC" videoProfile="high">
      <Part accessible="1" exists="1" id="11343" key="/library/parts/11343/1670449590/file.mkv" duration="1951564" file="\\Synchole\Plex Media\TV Shows\The Late Show with Stephen Colbert\Season 08\The Late Show with Stephen Colbert - 2022.12.06 - fast.mkv" size="421597478" container="mkv" deepAnalysisVersion="6" requiredBandwidths="2965,2655,2655,2655,2655,2655,2655,2655" videoProfile="high">
        <Stream id="32870" streamType="1" codec="h264" index="0" bitrate="1635" bitDepth="8" chromaLocation="left" chromaSubsampling="4:2:0" codedHeight="720" codedWidth="1280" colorPrimaries="bt709" colorRange="tv" colorSpace="bt709" colorTrc="bt709" frameRate="29.970" hasScalingMatrix="0" height="720" level="31" profile="high" refFrames="4" requiredBandwidths="2871,2569,2569,2569,2569,2569,2569,2569" scanType="progressive" width="1280" displayTitle="720p (H.264)" extendedDisplayTitle="720p (H.264)"></Stream>
        <Stream id="32871" streamType="2" selected="1" codec="vorbis" index="1" channels="2" bitrate="87" audioChannelLayout="stereo" requiredBandwidths="90,90,90,90,90,90,90,90" samplingRate="48000" displayTitle="Unknown (VORBIS Stereo)" extendedDisplayTitle="Unknown (VORBIS Stereo)"></Stream>
      </Part>
    </Media>
    <Media id="9780" duration="2439445" bitrate="3112" width="1280" height="720" aspectRatio="1.78" audioChannels="2" audioCodec="aac" videoCodec="h264" videoResolution="720" container="mkv" videoFrameRate="NTSC" audioProfile="lc" videoProfile="high">
      <Part accessible="1" exists="1" id="11344" key="/library/parts/11344/1670405122/file.mkv" duration="2439445" file="\\Synchole\Plex Media\TV Shows\The Late Show with Stephen Colbert\Season 08\The Late Show with Stephen Colbert - 2022.12.06.mkv" size="949693120" audioProfile="lc" container="mkv" deepAnalysisVersion="6" requiredBandwidths="3192,3192,3192,3192,3192,3192,3192,3192" videoProfile="high">
        <Stream id="32872" streamType="1" default="1" codec="h264" index="0" bitrate="2986" bitDepth="8" chromaLocation="left" chromaSubsampling="4:2:0" codedHeight="720" codedWidth="1280" colorPrimaries="bt709" colorRange="tv" colorSpace="bt709" colorTrc="bt709" frameRate="29.970" hasScalingMatrix="0" height="720" level="40" profile="high" refFrames="5" requiredBandwidths="3072,3072,3072,3072,3072,3072,3072,3072" scanType="progressive" width="1280" displayTitle="720p (H.264)" extendedDisplayTitle="720p (H.264)"></Stream>
        <Stream id="32873" streamType="2" selected="1" default="1" codec="aac" index="1" channels="2" bitrate="125" language="English" languageTag="en" languageCode="eng" profile="lc" requiredBandwidths="126,126,126,126,126,126,126,126" samplingRate="48000" displayTitle="English (AAC Stereo)" extendedDisplayTitle="English (AAC Stereo)"></Stream>
        <Stream id="32874" streamType="3" codec="srt" index="2" bitrate="0" language="English" languageTag="en" languageCode="eng" requiredBandwidths="1,1,1,1,1,1,1,1" title="English [SDH]" displayTitle="English (SRT)" extendedDisplayTitle="English [SDH] (SRT)"></Stream>
      </Part>
    </Media>
    <Guid id="imdb://tt23951432"/>
    <Guid id="tmdb://4084735"/>
    <Guid id="tvdb://9483238"/>
    <Role id="41040" filter="actor=41040" tag="John David Washington" tagKey="5d77682a151a60001f24b675" role="" thumb="https://metadata-static.plex.tv/c/people/cbf54ec545d040545361adb928c2ab99.jpg"/>
    <Role id="41041" filter="actor=41041" tag="Naomi Osaka" tagKey="5fb545dcac6cd9002db5140f" role=""/>
    <Role id="41042" filter="actor=41042" tag="Spoon" tagKey="5fe8cc970a708b002ddef5d8" role=""/>
    <Extras size="0"></Extras>
    <Related></Related>
  </Video>
</MediaContainer>

As you can see, the Video metadata, the Guids, and the Roles all indicate these are the “same” episode, but if you look at the Media > Part’s file attributes, you’ll see the files are the correctly dated ones.

Additionally for anyone trying to debug this, maybe the problem is that the parts are different lengths? The originals are approximately 40 minutes while the - fast versions are approximately 32 minutes. If you’d like to fully reproduce, name the files in date-based Plex format like The Late Show with Stephen Colbert - 2022.12.06.mkv and then run:

for file in *olbert*.mkv; do
  /usr/local/bin/ffmpeg -hide_banner -nostats -loglevel panic -i "$file" -filter_complex "[0:v]setpts=0.8*PTS[v];[0:a]atempo=1.25[a]" -map "[v]" -map "[a]" "`basename "$file" .mkv` - fast.mkv"
done

(Update your ffmpeg location as needed.) Note that this conversion happens outside of the Plex media location and both files are moved over after the fact, not with ffmpeg actively writing to the Plex media directories.

Hmm. Both of your videos have the “OriginallyAvailableAt” value of 2022-12-05. That’s why they are being matched to the same date. Can you check through the other metadata for the 12-06 episodes and see if anything shows as 12-05? I think there is a metadata tag that gets used for that date.

If this is the case, you should be able to fix it by turning off the option to use embedded data, then Plex Dance these files.

@anon18523487 There’s no episodic metadata on the files themselves, according to both VLC and ffprobe. Is there somewhere else you think I should be checking?

OriginallyAvailableAt seems to be getting set by Plex, not the files. All of the attributes in the Video tag (which includes OriginallyAvailableAt) is coming from Plex, not me.

I’m not sure what’s going on then. I’m not able to reproduce.

Can you create a test library just for those episodes then send me the server logs after the items are added there?

@anon18523487 I can try to do that soon — is there any sort of documentation you can point me to for a best-practices way to set up a test library? Or just go ahead and make a new library in my existing server setup?

Just move those files to a separate folder. Make a new library that points to this new folder.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.