Hello
I have an issue with Plex Media Server metadata, some movies and music albums have incorrect added date
I see in the Plex Home (on the web and for clients as well) that there is some albums and tracks that get the incorrect AddedAt value.
Albums or Movies i created long ago are updated with a more recent added date which leads to their presence in my plex home.
To fix this i develop a bit of python code using PlexApi to update the Added At value.
It did the trick for movies but not for music tracks or albums.
For tracks i have verified that at the datatebase level the new Added at values are correct, but in the Plex home (recently added music) the order of albums is not correct.
Has anyone the same issue and succeded to fix it for music tracks and albums ? thanks
Thanks for the quick feedback
Yes i just changed the settings, i hope it won’t happen again
To fix the existing data without having to restore a db backup i finally found the solution with some tweaking, initially i though that the album added date was based on each track added date, but it appears that each album has its own added date metadata
I can share with you the python code to ensure that album added dates and track added dates are the same. If i see the error i can just rerun the script to fix it instead of restoring the database
import plexapi
from plexapi.server import PlexServer
# Connect to your Plex server
PLEX_URL = 'http://ip:32400'
PLEX_TOKEN = 'token'
plex = PlexServer(PLEX_URL, PLEX_TOKEN)
SectionName = 'Music'
ArtistName = "AC/DC"
# Get a list of all albums on the server
all_artists = plex.library.section(SectionName).searchArtists()
# Select the album you want to update
selected_artist = None
for artist in all_artists:
if artist.title == ArtistName:
selected_artist = artist
break
if selected_artist is not None:
# List all tracks for the artist
for album in selected_artist.albums():
albumdate = album.originallyAvailableAt
albumupdate = {"addedAt.value": albumdate}
album.edit(**albumupdate)
for track in album.tracks():
updates = {"addedAt.value": albumdate,"updatedAt.value":albumdate}
track.edit(**updates)