Upgrading episodes is so much work!

I recently upgraded several seasons of TV shows, removing h264 files and replacing with h265. The only boondoggle is that Plex doesn’t seem to want to let go of the deleted files. They show up as UNAVAILABLE and it seems I have to delete each of them one by one, fairly time consuming for multiple 20 episode seasons.

Is there a way to streamline this task that doesn’t involve swapping gigabites of files between directories?

Thanks for any help.

Try and rescan library, followed by empty trash

If only! Unavailable files were still there. Sonarr updates releases when a better quality comes in. Plex won’t let go of the old ones, just says Unavailable.

Please show screen capture of Media info of an item in trouble

Still looking for the add attachment button…


Just pasted it.

That show was deleted weeks ago. I ran a Library scan and emptied the trash before this.


This is an example of the upgrade issue. Sonarr replaced the first x264 with the preferred x265, but the x264 remains shown as Unavailable.

First of all, it looks like you have 3rd. Party updating directly on PMS library path, which is bad!

I do suggest you consult 3rd. Party manuals (Sonar) for moving into PMS library after done!

Secondly, if you did empty trash, then this sadly could indicate a broken database, so try this:

  • Make sure PMS log level is set to Debug level only!
  • Restart PMS
  • Empty Trash
  • Upload a zip with PMS logs

You mean the SONARR directory is unsuitable for a Plex library? Should I move all programs manually after they arrive? The only thing I see in a Sonarr guide at https://dailysysadmin.com/KB/Article/3804/installing-and-configuring-sonarr-and-integrating-with-a-plex-media-server/ is called Connections, and it doesn’t currently seem to want to communicate with my Plex.

Will restart in a few minutes when my wife finishes her show. Enable PMS debug logging has been checked, not verbose.

Log:
Plex Media Server Logs_2022-02-23_22-16-42.zip (4.8 MB)

If that’s the directory you setup Sonar to download to, then yes
If is simply a directory, where Sonar puts the medias after they are downloaded, then it’s fine

Also note, that your Sonar files are named incorrectly, as well as other shows
E:\Sonarr\FBI- Most Wanted\FBI.Most.Wanted.S03E13.720p.HDTV.x264-SYNCOPY.mkv
should be named:
E:\Sonarr\FBI Most Wanted (2020) {tmdb-94372}\Season 03\FBI.Most.Wanted.S03E13.720p.HDTV.x264-SYNCOPY.mkv

Important in above was the Year for the show, as well as a missing Season XX folder
Ref: https://support.plex.tv/articles/naming-and-organizing-your-tv-show-files/

I also see, that you have libraries defined at the root level of your drives, which is not recommended! (D, G and J drives)

I also noticed on Empty Trash command issued for Section 1, that said no files found to be deleted, so even though logs doesn’t indicate any database errors, I do suspect there are, and suggest you for a start do a manual repair of it
Ref: https://support.plex.tv/articles/repair-a-corrupted-database/

Thanks so much for this information.

The Sonarr Directory is indeed simply a directory where Sonarr puts the media after download. Sonarr Downloads first go to an SABnzbd directory on my C drive, then are moved to E:\Sonarr. It’s been working well for years.

Other than the refusal of Plex to automatically remove deleted versions of media, the naming conventions do not seem to be interfering with programs being available to watch (including display of episode info). Still, I will follow the link and see what I can do. The scene itself is inconsistent.

Much of my media downloads are deleted after viewing, which is why I told Sonarr not to create a season folder. If this is important it’s the easiest fix possible. The only problem I’m having is Plex not recognizing deleted files, and I didn’t think season folders could affect that. But I’ll tell Sonarr to create season folders for all shows going forward.

How do you mean root level? To me, root is C:\ or E:\ or J:, etc. I can fix this easily with D:\ and G:, but my J:\ drive has one directory, 4K, for the storage of 4K films. I will create a directory for files on D:\ and G:\ and tell Plex what it is.

I will attempt a database repair. Thanks again for the links.

It doesn’t. it was simply for correct naming, to make sure episodes was detected correctly

Fix is hopefully in the database

Trying to repair the database. I managed to get the command prompt to switch to the proper directory and back up the database, but the next line of your link says to use the following command(s?) to check the db: ```
“C:\Program Files (x86)\Plex\Plex Media Server\Plex SQLite.exe” com.plexapp.plugins.library.db “PRAGMA integrity_check”


I mistakenly kept the quotes, but even after removing them, errors were returned (not from the database, but from Windows).

Power off PMS, and zip the entire database directory

Then upload somewhere, and DM me the link

Done. Starting Plex now.

By the way, I’ve moved all media out of root directories, although technically, they were all in different folders named for the program or type of movie (No actual media files were in the root, but folders with them were).

Well, since there was no backup made of your database for almost a month, I do suspect something was wrong with it, even though there’s no indication of it!

I did DM you a download link for a database, where I ran a manual fix

So do this:

  • Shut down PMS
  • if the following files are present in the database directory, then delete them
    • com.plexapp.plugins.library.db-wal
    • com.plexapp.plugins.library.db-shm
    • com.plexapp.plugins.library.db
  • Copy the zip extracted database I provided you with into the database directory
  • Power up PMS

Now see if you can do a scan of your TV libraries, followed by an empty trash

And please report back