2 "recently added" items stuck

server-windows

#1

For about a month I have two items stuck in the recently added list.
After these two items the list updates like usual if I add content to the server, but the first two item never change.

Any hint how to get rid off this?

(This has to be a server issue since this happens on every device)


#2

Yes, the recently added information is on the server. Can you call up the xml for these 2 items? In there you will find a field for "addedAt=" and a long number. Can you post the numbers for these 2 items? That is the time the item was added to the database in Unix time. If that is somehow set to a time in the future, they will stay there until that time passes and you add more stuff after. If this is the case, you will need to remove and readd the items so a new date can be used.


#3

Thanks,

readding the files helped!


#4

same problem here with 3 series sesons that wont dissaper in recently added.
cam someone tell me where I can find the .xml data


#5

Changing the xml file will not help. These are actually generated based on what is in the database. You can view the xml by using Plex Web and going to one of the episodes in the season, along the left, hit the 3 dots, then info. A pop up window will appear, hit the view xml at the bottom. This is just to verify that the added_at date is indeed sometime in the future, which is why the items are stuck. That date hasn't happened so it will always be listed first until that date finally passes and yo have more items after that date.

The less technical fix is to remove and readd (Plex Dance) all the episodes from these seasons. The technical approach is to fix the entries in the database.


#6

@MovieFan.Plex said:

The less technical fix is to remove and readd (Plex Dance) all the episodes from these seasons. The technical approach is to fix the entries in the database.

That worked (only needed first Episode of the season)
Thank you very much ;-)


#7

I had same issue with 2 episodes stuck in the "recently added" and won't budge not matter what.
I was able to solve the issue using @MovieFan.Plex post.

I opened the XML and found out the values for those 2 episodes were somewhere in 2038. As much as I have patience, but waiting 22 years is unacceptable. So I took matters into hands and started digging.

Here are the instructions to repair those items manually.
- Find the location of your Plex server sqlite database. On linux it's something like that: /Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db
- Install an Sqlite management tool and open the database file with it. I used sqlite3 on linux.
- Open the XML info of the corrupted item in Plex Web (Open "Info" for the episode and click "View XML").
- Locate the property "ratingKey". This will be the id of the record in the metadata_items table.
- Run the following command in Sqlite (replace [ratingKey] with actual value from last step):

UPDATE metadate_items
SET added_at = created_at
WHERE id=
[ratingKey]

Done!

I hope this was helpful.


#8

As a followup to @n_shay 's very helpful post... if you have a lot of items that need fixing, you can do the following. Standard disclaimer applies - I know a lot of SQL from my day job, but not as experienced with SQLLite. Backup your db, and use at your own risk.

-- This will give you all of the rows of items containing an added_at date that is greater than right now. I use this to get a rowcount of how many incorrect add dates I have in my db.

select * from metadata_items where added_at >= date('now')

-- To fix them we are going to do just as before and set the added_at date = to created_at, but instead of running a command for each record (I had several hundred)... we are going to do them all in one swoop. This looks at all the records in the metadata_items table, and if the added_at date is after right now, then it sets added_at equal to created_at.

update metadata_items
set added_at = created_at
where added_at >= date('now')

Interesting fact, my weird added_at dates were also 2038. Is it possible that there is a condition that will trigger Plex to auto fill in a date like that? I've seen some weird bugs during row creation when using XML or metadata sources in SQL. Maybe its a check that needs to be made on the import side of Plex? I looked at the raw file metadata prior to import, and couldn't see a 2038 date in there anywhere, so I'm assuming it isn't a problem with a rip/file. I'd be happy to take a look at the import process if somebody at Plex wanted me to.


#9

The time stored in the database is based on linux epoch time which runs out in 2038. If you are seeing 2038, then the Plex scanner probably ran into an overflow value for the date so it stopped at 2038. If you have a way to reliably recreate 2038 showing up, I'd love to know so we can work around it.


#10

That fixed me!


#11

I have the same problem, and i just noticed that all my stuck item where in a folder whose name included the french letter “é” on my NAS. Currently refreshing metadata after folder name editing. Guess I’d have to add new content to validate… which will not happen soon. Can someone replicate?


#12

Hey guys, I know this is an old post but I’m having the same issue. Tried checking the XML and so far the first 3 season of 24…seem to be correct. Many of them showing 1291042355 added around 2010…so the dates so far seem to be correct. Do I need to go through the xml for each episode to find the culprit? There are over 120 episodes so didnt really want to do that.


#13

If you run the SQL command that @isujinx provided it should fix the issue for all corrupted entries:

update metadata_items
set added_at = created_at
where added_at >= date(‘now’)

I never ran into this issue ever again, and had only 2 of them so it was easy running it against their ID.