Hello.
I have determined how ‘in the future’ last played dates are being introduced.
it is from itunes playlist import.
While attempting to resolve this issue previously, I noticed I had database malformed or corrupted errors (which ended up being the gracenote cache databases).
After sorting out the gracenote db issues, I decided to start fresh with a new music premium database (same as old), and fresh rescan of ~200+k tracks.
While the actual import/rescan of the entire music folder is taking far too long to complete in one go, I have made 50% progress and verified that I had no played tracks from the future.
I decided to try to importing itunes xml to restore my ratings/playlists/import dates, etc.
After getting an itunes import on the existing scanned files, I now have a bunch of files that are now ‘last played’ in the future again.
example;
Here is a plex xml for one track played in the future
<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="11" librarySectionTitle="Music" librarySectionUUID="4542ec05-caf3-4b56-9a95-c3de2b06396c" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1539019897">
<Track ratingKey="424629" key="/library/metadata/424629" parentRatingKey="424616" grandparentRatingKey="424447" guid="com.plexapp.agents.plexmusic://gracenote/track/7483349-39E12F5B5AADA3D56CCA3D7E8EE51364/7483362-46465EA1BC03D45683DF007382E0EED7?lang=en" librarySectionTitle="Music" librarySectionID="11" librarySectionKey="/library/sections/11" type="track" title="21st Century (Digital Boy)" grandparentKey="/library/metadata/424447" parentKey="/library/metadata/424616" grandparentTitle="Bad Religion" parentTitle="Against the Grain" originalTitle="Bad Religion" summary="" index="13" parentIndex="1" userRating="5.0" lastViewedAt="2085805696" thumb="/library/metadata/424616/thumb/1540105081" parentThumb="/library/metadata/424616/thumb/1540105081" grandparentThumb="/library/metadata/424447/thumb/1540105016" duration="168777" addedAt="1198860682">
<Media id="486067" duration="168777" bitrate="130" audioChannels="2" audioCodec="mp3" container="mp3">
<Part accessible="1" exists="1" id="494486" key="/library/parts/494486/1231926292/file.mp3" duration="168777" file="/data/media/audio/MP3/B/Bad Religion/1990 - Against the Grain [MP3]/13 - Bad Religion - 21st Century (Digital Boy).mp3" size="2748416" container="mp3" hasThumbnail="1">
<Stream id="862727" streamType="2" selected="1" codec="mp3" index="0" channels="2" bitrate="128" audioChannelLayout="stereo" samplingRate="44100" displayTitle="Unknown (MP3 Stereo)"/>
</Part>
</Media>
<Extras size="0"> </Extras>
</Track>
</MediaContainer>
here is the same track in itunes xml, with the play date in the past.
<key>39283</key>
<dict>
<key>Track ID</key><integer>39283</integer>
<key>Name</key><string>21st Century (Digital Boy)</string>
<key>Artist</key><string>Bad Religion</string>
<key>Album Artist</key><string>Bad Religion</string>
<key>Album</key><string>Against the Grain</string>
<key>Kind</key><string>MPEG audio file</string>
<key>Size</key><integer>2748416</integer>
<key>Genre</key><string>Punk</string>
<key>Total Time</key><integer>168803</integer>
<key>Track Number</key><integer>13</integer>
<key>Rating</key><integer>50</integer>
<key>Year</key><integer>1990</integer>
<key>Date Modified</key><date>2009-01-14T03:44:52</date>
<key>Date Added</key><date>2007-12-28T16:51:22</date>
<key>Play Date UTC</key><date>1899-12-30T00:00:00</date>
<key>Bit Rate</key><integer>128</integer>
<key>Sample Rate</key><integer>44100</integer>
<key>Track Type</key><string>File</string>
<key>File Folder Count</key><integer>-1</integer>
<key>Library Folder Count</key><integer>-1</integer>
<key>BPM</key><string>134</string>
<key>Location</key><string>file://localhost/data/media/audio/MP3/B/Bad%20Religion/1990%20-%20Against%20the%20Grain%20%5BMP3%5D/13%20-%20Bad%20Religion%20-%2021st%20Century%20(Digital%20Boy).mp3</string>
</dict>
Additional info;
this itunes xml was exported from mediamonkey with a script.
this particular track had not been played.
I don’t know why the played date is in the past in this exported xml, nor why plex interprets/imports it as played in the future.
both are wrong.
here is an xml from itunes itself with this track just added and unplayed
<key>7035</key>
<dict>
<key>Track ID</key><integer>7035</integer>
<key>Size</key><integer>2748416</integer>
<key>Total Time</key><integer>168803</integer>
<key>Track Number</key><integer>13</integer>
<key>Track Count</key><integer>17</integer>
<key>Year</key><integer>1990</integer>
<key>BPM</key><integer>134</integer>
<key>Date Modified</key><date>2009-01-14T09:44:52Z</date>
<key>Date Added</key><date>2018-10-22T02:16:03Z</date>
<key>Bit Rate</key><integer>128</integer>
<key>Sample Rate</key><integer>44100</integer>
<key>Artwork Count</key><integer>1</integer>
<key>Persistent ID</key><string>DD6E628FAB056EA5</string>
<key>Track Type</key><string>File</string>
<key>File Folder Count</key><integer>-1</integer>
<key>Library Folder Count</key><integer>-1</integer>
<key>Name</key><string>21st Century (Digital Boy)</string>
<key>Artist</key><string>Bad Religion</string>
<key>Album Artist</key><string>Bad Religion</string>
<key>Album</key><string>Against the Grain</string>
<key>Genre</key><string>Punk</string>
<key>Kind</key><string>MPEG audio file</string>
<key>Sort Artist</key><string>Bad Religion</string>
<key>Location</key><string>file://localhost//sauron/media/audio/MP3/B/Bad%20Religion/1990%20-%20Against%20the%20Grain%20%5BMP3%5D/13%20-%20Bad%20Religion%20-%2021st%20Century%20(Digital%20Boy).mp3</string>
</dict>
itunes apparently does not even include the played date until something is played.
TLDR;
in summary, there are 2 bugs. 1 from the xml generator, and 1 for plex itunes xml importer.
itunes xml is generated by 3rd party with invalid played date data in the past. 1899-12-30T00:00:00
itunes xml is imported by plex, which inverts the invalid play date data to the future. 2085805696
insert back to the future jokes here.