"Scan library files" should remove references to "Optimized Versions" when files have been deleted

ferzkopp
Sat, 15 Jun 2024 17:55:44 +0000
Plex Media Server

Server Version#: 1.40.3.8555

Feature request: “Scan library files” should remove references to “Optimized Versions” when files that references optimized versions are deleted

It is easy to run into the Optimize error “The media version already exists” with duplicate media file of different qualities (i.e. 4K + HD) exist in the store. If these are found in the store, creating new versions with Plex defaults is blocked with the above error message. The optimization is blocked even after the lower quality version used as “optimized” version has been deleted.

Bug:
With two non-Plex generated files present and one being the “optimized” version, deleting the lower resolution file, rescanning media files, and attempting to create a new Plex encoded version in the “Plex Versions” folder fails. The “Optimized Versions” list still references the missing file.

Repro:

setup store with 4K and HD versions of the same movie (non-Plex encoded)

verify that the media references both files via “Get Info”

verify the issue that an optimized version cannot be created (since it is already present)

delete the lower resolution file (HD version)

rescan media

attempt to create optimized version using “Optimized for TV”, Version storage location: “In folders with original items” settings
Expected: works
Actual: fails with “The media version already exists”

check “Optimized Versions” list
Expected: HD version not listed
Actual: HD version still listed

Workaround:

move 4K media file out of the videos folder

scan media folder (movie is now not part of the collection anymore)

place 4K media file back into videos folder

scan media folder (movie is now re-discovered as new content)

initiate HD optimization

2 posts - 2 participants