[bug] Cannot Delete Uploaded Subtitles

Server Version#: 1.32.8.7639
Player Version#: Plex Web

I recently added some external SRT subtitles to a movie and realized there was a typo in one of them and the time needed to be shifted a bit. I made the changes and re-uploaded the new SRT file through Plex Web, but cannot remove the old SRT file. The [DELETE] button appears to work (no visible error thrown), but the old subtitle entry remains. I tried cleaning bundles hoping that would help but it’s still there. How can I get rid of this old subtitle entry ?

That may actually be a simple caching issue. You can also try to Refresh Metadata. If it’s a tv show episode, refresh metadata on the whole show.

Never use the upload feature if you have a subtitle file.
Always place it beside the video file, like so: https://support.plex.tv/articles/200471133-adding-local-subtitles-to-your-media/

Unfortunately that does not seem to have cleaned up the old subtitle files. I tried emptying trash, analyzing the library, refreshing metadata and cleaning bundles. The movie still has three entries for subtitles.

Interestingly, when I click the “X” next to two of them and click [DELETE}, nothing happens. On the third entry (actually the top-listed one), it seems to actually do something though there is no visible sign of a result.

I used to always add the SRT files separately “next to” the movie files, but it stopped recognizing them some time back. Upload is the only way I can seem to get them recognized.

Here are a couple screen grabs. (And I know tvdb is not used for movie hints :grinning: )

The delete button “spins” for a second and the pop-up goes away on two of the files. It is non-responsive on the other file.

image

image

Your screenshot makes it immediately clear why that is.
The subtitle must have the exact same file name as the video file, except for the added language code (and the file name extension, ofc).

Ooops, yes, that was my mistake. I renamed the file and now I show four subtitle options for this film. Delete is still not getting rid of the three that were uploaded. I hope I’m not stuck with them forever.

Verify your database file for damage. Better safe than sorry.
https://support.plex.tv/articles/repair-a-corrupted-database/

I ran the integrity_check and got a clean “ok” response. I also ran VACUUM; and REINDEX; and another integrity_check;. All came back clean. I stopped short of the rebuild step because it did not seem necessary.

Those pesky extra uploaded subtitles entries are still there and will not delete.

Are there any relevant warning/errors in your server logs after attempting to delete the tracks? I’d only recommend the following if you’ve exhausted all other options, but if you’re comfortable editing your database manually you can try deleting them directly:

  1. Shut down PMS.

  2. Make a backup of your main database and blobs database.

  3. Open your main database (com.plexapp.plugins.library.db) and list all uploaded subtitles associated with the file (based on your file name in the above screenshot):

    SELECT * FROM media_streams WHERE stream_type_id=3 AND id IN (
        SELECT media_streams.id FROM media_streams
        INNER JOIN media_items ON media_items.id=media_streams.media_item_id
        INNER JOIN media_parts ON media_parts.media_item_id=media_items.id
        WHERE media_parts.file LIKE "%The Good Shepherd (2006) {tvdb-1972}%"
            AND media_streams.url="blob://"
    );
    
  4. Make note of the ids for later.

  5. Delete all references to uploaded subtitles associated with the file:

    DELETE FROM media_streams WHERE stream_type_id=3 AND id IN (
        SELECT media_streams.id FROM media_streams
        INNER JOIN media_items ON media_items.id=media_streams.media_item_id
        INNER JOIN media_parts ON media_parts.media_item_id=media_items.id
        WHERE media_parts.file LIKE "%The Good Shepherd (2006) {tvdb-1972}%"
            AND media_streams.url="blob://"
    );
    
  6. Open your blobs database (com.plexapp.plugins.library.blobs.db) and delete the subtitles themselves from the blobs database:

    DELETE FROM blobs WHERE linked_type="media_stream" AND blob_type=3 AND linked_id IN (id1, id2, id3, ...);
    

    Where id1, id2, id3, etc are the IDs you noted from step 2. If you want to first see a list of all the blobs that will be deleted by that query, run

    SELECT id, linked_type, linked_id, created_at, blob_type FROM blobs WHERE linked_type="media_stream" AND blob_type=3 AND linked_id IN (id1, id2, id3, ...);
    

One thing to note is that the steps might not work if any of the links between media_items, media_streams, and the blobs database are broken, which won’t necessarily show up after an integrity_check.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.