Is there any way to delete items directly from the database?

Context:

  • Using Plex autoscan which sends a scan command to PMS with the full path like so:
Plex Media Scanner --scan  --refresh --section 1 --activity XXXXXXYYYYYYZZZZ --directory /home/drive/Movies/Title (Year)/Interviews

in which there is a file called

Interview with producers Person A and Person B.mkv

I didn’t realize all these extras would be added as movies (and thus not match) so now I have hundreds of extras files that are unmatched and appearing in my library when sorting by newly added, and it looks like this:

I can’t exactly do the Plex dance to try and empty trash since they are across hundreds of folders/subfolders. Is there a way to just delete the database entry directly?

They should normally not get added as movies, if they are located inside a folder Interviews, which itself sits inside the subfolder of a movie – like you have them.

Which scanner and agent is selected for this library?
To which folder did you point this library? Is it anything else than /home/drive/Movies?

Which scanner and agent is selected for this library?

It is the old scanner called “Plex Movie Scanner”, and using the TMDB movie agent (with Plex Movie (Legacy) enabled in the Agents setting and placed above TMDB).

To which folder did you point this library? Is it anything else than /home/drive/Movies ?

Nope, it is pointed to just /home/drive/Movies.

I reverted from the newest Plex Movie agent/scanner combo (and have abandoned it for now) because it is roughly 20x slower with the way I have my movies organized (A-Z folders under Movies). This revert has no effect on this situation because the upgrade happened on a separate database/server in a duplicate container in case things didn’t work (which they didn’t).

Is this issue solved with the new agent?

I don’t know. It’s not a known issue, AFAIK.

That’s curious. It is supposed to be at least 5 times faster than the old way.

Hmm, that’s what I’ve heard as well which is why I was eager to upgrade. But I’ve now tried it with two different servers (and even reverted + reupgraded) for a total of three times. And scans have been consistently slower because it seems to check/scan each and every folder instead of just the changes idk. This is of course after the initial refresh/scanning/processing phase.

If you scan only the interview folder, PMS doesn’t know that it belongs to a movie and will scan these as individual videos. Only scan at the movie level.

No need. Just rescan the movie level and the extras should get added correctly as extras.

If you don’t want these shown at all, you’ll need to use Plexignore, but that won’t work if you are scanning individual folders unless you place a copy of plexignore in every folder. https://support.plex.tv/articles/201381883-special-keyword-file-folder-exclusion/

If you scan only the interview folder, PMS doesn’t know that it belongs to a movie and will scan these as individual videos. Only scan at the movie level.

Yeah I realized that after my mistake. Now, I have hundreds of these extras as unmatched movies in my library :frowning:

No need. Just rescan the movie level and the extras should get added correctly as extras.

Yes, they will. But how do I remove all the unmatched ones showing up in my library as movies (and in recently added)?? Since the path to these extras still exists, they won’t get cleared out, thus I need a way to edit the database and remove these entries directly.

Could that be contributing? If I had A-Z folders, I would be adding those to the Library instead of the parent Movies folder.

I know that the TV/Series scanner has sometimes been opinionated about directory structure and depth; I don’t remember if the Movie scanner is too.

Edit: I did a simple test and it didn’t seem to matter. :man_shrugging: :woman_shrugging:

If they are Unmatched, there is a library view for Unmatched.

Yes, they will. But how do I remove all the unmatched ones showing up in my library as movies (and in recently added)?? Since the path to these extras still exists, they won’t get cleared out, thus I need a way to edit the database and remove these entries directly.

Sorry, I am just wrong. This is not the case, and a simple directory scan cleared these extras! Although I’d be still interested to know the correct way to remove items from the DB directly.

1 Like

You shouldn’t (ahahaha) ever need to do that.

If the scanner still sees the files on disk, it doesn’t make sense to remove them from the database directly - they would just be scanned again and added back again. Right?

And when the scanner has been prevented from seeing the files, they should be automatically removed at the next scan/refresh/empty trash.

Cough, cough.

There is no simple way. First you’d need to identify these items. Then remove the entries related to their ID from multiple tables. SQL does not use a referential data structure so related items don’t automatically get removed. It has to all be done manually. If you are familiar with databases, it can be done. If you’re not savvy with that stuff, it could be risky doing it manually.

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