Whit SQLite, how can I programatically identify a new movie added?

Having a movie with a filename that PLEX will not be able to identify on IMDB (for example: “movie.mkv”), I need to know how can I use Plex SQLite.exe to add a local movie file and tell to PLEX the IMDB title, so it can recognize it with 100% match.

I’m aware of the file naming rules to help PLEX identify movies, but this is not what I’m asking for.

In short, programatically I want to add a new movie file to the plex database file, and ensure plex will identify that movie file in IMDB, because I know the IMDB’s title Id for that movie, so I can specify it in the database when adding the movie file entry.

I ask this because I was not able to find within the database what field holds the IMDB title for a media file, or how PLEX does to link the IMDB title to a media file.

It would be substantially less complicated to just rename the file. You can add e.g. {imdb-tt1234567} to the filename and it will use that imdb id for matching.

Adding items directly to the database is not something that is supported nor would it be trivial and would result in all sorts of headaches.

Thanks for answer, although as I said I’m aware of the naming rules and tips like that. It is not what I’m looking for.

What I could accept is having to create a dummy plain text file inside the movie folder with file name: “{imdb-id}” or “{imdb-id}.txt”, but as you know the scanner will not be aware of that file, unless developers improve the logic some day.

Anyway, I have an url file inside every of my movie folders, the url file content points to the IMDB title page, eg.:

[InternetShortcut]
URL=https://www.imdb.com/title/tt0077651

but of course PLEX is not as sophisticated to be aware of this and parse the url file content to match the IMDB title.

I also have my covers / posters following the naming pattern: “[movie-name].Cover.jpg”, inside every movie folder, but PLEX totally ignore this file, if the cover does not have the name “Poster.jpg” (or so I think I remember) .

This is my file structure pattern for every movie folder:

Halloween [01]꞉ La noche de Halloween (1978).mkv
Halloween [01]꞉ La noche de Halloween (1978).mkv.Cover.jpg
Halloween [01]꞉ La noche de Halloween (1978).mkv.IMDB.url
Halloween [01]꞉ La noche de Halloween (1978).mkv.Info.txt
Halloween [01]꞉ La noche de Halloween (1978).mkv.Thumbs.jpg

With movie sagas and my current naming patterns, PLEX will mess with the “꞉” char and it will not match the proper title on IMDB.

Many little improvements that are life savers like these things that could be add to improve the scanner. It should be considered.

Adding a {IMDB title Id.} at the end of the directory or the file name, aesthetically its a very ugly workaround.

Just let the users the alternative to add that {IMDB title Id.} but as a dummy file inside the movie folder, that would be welcome for me.

Try renaming the text file identically to the video file, with only the file name extension differing.
Change the file name extension from .txt to .nfo

Sorry but what text file do you mean?.

My *.info.txt file just contains a MediaInfo’s report.

Can you give a link or explain me what do you mean with the creation of a .nfo file and what should be its file content?. I don’t get it.

As long as it contains the URL to the IMDb page of this movie or its IMDB ID number, you should be fine.
e.g. the above cited example [InternetShortcut] URL=https://www.imdb.com/title/tt0077651

With tt0077651 being the IMDb ID.

If the movie is in its own folder it doesn’t actually matter what the filename is, as long as there is some file in that folder with the .nfo extension then it will look at the contents and extract anything that looks like an imdb id.

However in the current live build there is a bug preventing this from working, it’s fixed already but will only be released with the next PMS release 1.23.5.

If adding that .nfo file really helps to ensure to match the correct IMDB title, then probably I’m doing something wrong…

I tried with this file structure:

├───test
    test.mkv
    test.mkv.nfo
    test.nfo

Inside both .nfo files I have this:

[InternetShortcut]
URL=https://www.imdb.com/title/tt0120724

But PLEX identify the movie as “Test (2000)”, this:

What I’m doing wrong?.

See above:

Oh, wow!!, then I will look forward to that update.

Many thanks to both of you, if this really works then I just have to wait for said update … hopefully it works and it’s that simple.

Is there no way to download that update for now, am I wrong?

It doesn’t exist, yet. A code repository and a compiled program are different :slight_smile:

Sorry, in my head I was thinking about nightly or dev builds that are not considered releases yet but could be downloaded for testing purposes.

Thanks again for all the help!!!