Unable to clear trash can icon from certain series

After some further searching around, I pieced together a couple of topics and was able to fix this with some manual database editing, as it appears to be a bug where the deletedAt attribute doesn’t get cleared sometimes, which causes the trash icon to show up for a season or show.

First, I found this topic, but because it’s so old, and the SQLite db has been extended by Plex since then, I needed to follow steps from this post here. Here’s what I did, step by step, and it worked like a charm. Of course, you are manually editing a database, so there’s risk of all kinds of problems, so beware, and BACKUP your database before attempting.

  1. BACKUP YOUR DATABASE: You can download a copy to your machine under

Settings, Manage, Troubleshooting, Download Database

  1. Shut down Plex Media Server
  2. Copy the database to your machine from

Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db

  1. Open the database using DB Browser for SQLite.
  2. Under Database Structure, scroll all the way down to triggers delete the following triggers:
    fts4_metadata_titles_before_update_icu
    fts4_metadata_titles_after_update_icu
  3. Write changes
  4. Under Execute SQL, you’ll execute the following command, where id = the season id number. This can be found by clicking on the Unavailable button on the Season page, clicking View XML, and searching for ratingKey=#####. You’ll want to execute this command for each of the seasons that are showing the trash icon. This can also be confirmed in the season/show XML, where you’ll find a deletedAt attribute with a Unix time number. Normal seasons/shows do not have this set. We’re setting it to back NULL. You may also need to do this at the show level, entering the show id number, which is listed on the season XML under parentRatingKey=#####.
    UPDATE metadata_items SET deleted_at = NULL WHERE id = #####;
  5. Now to restore the triggers we deleted in order to be able to edit the database outside of Plex. Under Execute SQL, run the following commands, one at a time. You’ll get an error if you try to do them both at once.
CREATE TRIGGER fts4_metadata_titles_before_update_icu BEFORE UPDATE ON metadata_items BEGIN DELETE FROM fts4_metadata_titles_icu WHERE docid=old.rowid; END
CREATE TRIGGER fts4_metadata_titles_after_update_icu AFTER UPDATE ON metadata_items BEGIN INSERT INTO fts4_metadata_titles_icu(docid, title, title_sort, original_title) VALUES(new.rowid, new.title, new.title_sort, new.original_title); END
  1. Verify that the triggers are back in place under Database Structure by scrolling all the way down again.
  2. Write changes, and then close the database.
  3. Make another backup of your original database by renaming com.plexapp.plugins.library.db to something with a descriptive title, like com.plexapp.plugins.library.db-before-edit
  4. Copy your edited database into place, making sure the name is exactly
    com.plexapp.plugins.library.db.
  5. Start Plex Media Server up again, and verify your seasons look good. I hope they do! Mine did!