Option to generate/update .plexmatch files on Edit page & Fix Match

There’s an insane amount of media that can be misinterpreted and the .nfo and .plexmatch files are a good option to ensure that they’re not mismatched or that ordering and other preferences are assigned. Unfortunately, when your database has been lost either due to a server failure, a disconnected drive+empty trash, or simply by adding a single media file to a folder after the pattern-matching rules were changed even though the other files had been indexed for years. In any of these situations, if we haven’t taken the time to manually create these files then we have to either rename our media or manually generate these files now. Yuck.

Having an option to generate (or update if it already exists) the .plexmatch or .nfo files will save us all a lot of time. This should be available as either a checkbox or button on both the Edit page and the Fix Match page.

An added benefit of this feature is that it would generate the files in the correct formats in such a way as to operate as a template for administrators to revise them later.

While I can see the benefit here I think the biggest problem would be a way to determine what is saved & where. Creating a .plexmatch file for a show? That I can see being easy enough because you just drop the “This title is MOVIE X” in the .plexmatch for the show’s root directory but going to the show & clicking a button in the settings would be as much or more work than going to the folder & doing the same. The other things the .plexmatch do right now wouldn’t benefit from this because if Plex has matched it there’s no reason to save it. The .plexmatch is pretty much for things like a show called “Season Seven” where Plex matches the files names “Season 7 S01 Episode 3.mkv” as Season 7 Episode 3 instead of Season 1 Episode 3.

Are you asking for a button to create a .plexmatch file for each show in a library? What do you want it to match? Do you want it to essentially create a text file in each show with the filenames of each file & the episode that it currently has it matched to? I mean I could see that having a small potential benefit if the library got deleted & the matching rules changed so now when you are recreating it, but even then it would only be needed for a few that are problematic. In which case you would be better served doing it manually for those shows than wasting a ton of resources creating a bunch of files that 99% of don’t server a purpose & might actually cause problems. For that use it’d be better to have an external program to do that. If you don’t want it to make them for all, then how do you want it to determine what needs to be there & what doesn’t? The .plexmatch file doesn’t actually store any information on it except what to match the files with, & as far as I know Plex doesn’t currently support NFO files in any way. Are you asking for there to be a way to export the Metadata into an NFO file & then the ability for Plex to use those NFO files in the future to pull metadata from? If so that’s really a cart before the horse.

As far as a template for a .plexmatch file I think that would be great as the Documentation is not very good, but I don’t think that’s what you want either, it sounds that was a "In the future I can use the plexmatch file that’s already created for when it’s needed for when I add more episodes, but again that’s a lot of resources for something that will only be used less than 1% of the time.

I’m not against this suggestion, I just don’t understand what is being asked for, so I have no idea if I would use a vote to support it, & I seriously doubt the devs would be able to use any of that to create a feature without more context even if they wanted to

Not tested by me, but there’s a 3rd. Party tool, that might cover what you want?

2 Likes

Thank you for your feedback, @LostOnTheLine. I don’t see this as being something that would store every piece of information about the show, only those that were changed or otherwise different from values detected. The .plexmatch page indicates the following are good candidates to appear in a show folder or season folder:

Title: Cool Show
Year: 2018
Season: 2
tvdbid: 12345

I agree. These few things are the most likely to be edited manually, and perhaps only the tvdbid would necessarily need to be assigned, but it would be best if when I manually assigned this value within the web interface that I had the option of ensuring I wouldn’t have to re-assign it every single time something happened.

I’ve had The Bionic Woman (1976) for years. I re-ripped a few of the specials recently and the entire series went from the 1976 version to the 2007 version - which I didn’t even know existed. Had there been a .plexmatch file created with only the year and/or tvdbid when I mapped the original version it would have saved me some trouble when I recently had to rebuild my server. This is one of the more obvious examples, but it would be most useful, I believe, with things like web series (Broken Brain, Fall of the Cabal, and so on) which are almost never detected correctly, and also shows with much the same name. For example, I have five separate series named Lincoln and while the year alone should help to prevent some of these from being mismatched, often the plex agent still gets it wrong or just ignores the year portion of the series name entirely. Or it treats them as several copies of the same show (whoever Lincoln Rhyme is).

To answer your questions:

No, I don’t think it should be set to export/dump every detail. Only the details that are manually assigned in the Edit page or the name+year+ID from the Fix Match page.

While it might be easy enough to go to the folder and create the .plexmatch files manually, the idea of using a system like this is that less manual work is required. Adding the option of creating a hint file in the folder from the web interface for these values should be simple enough.

In my experience, having used this system for ~5 years or so, I’ve only needed to use the Fix Match or Edit pages for a tiny fraction of my library (<2%), but it’s had to be done every single time I replaced hardware, change drive letters, or otherwise re-organize the media. My belief is that the .plexmatch files are intended to make this process easier. Adding an optional checkbox or button to update the .plexmatch file when these values are modified seems like it would be something to minimize user effort all around.

Gotcha, so you’re talking about the show matching part. I think of the .plexmatch file more for the problems with how a Show’s Episodes are named. My example of choice is the show “3x3 Eyes” which currently works, but in the past it has not & then did, & then not, then did again, so I have a .plexmatch file telling it what episodes are what because when it doesn’t it sees 3x3 at the beginning of the file name & just assumes everything is a different version of Season 3 Episode 3. So I think of the .plexmatch more for fixing problems that can’t be fixed in the UI. especially since the TVDB.ID can be added to a file name to force that match already. There actually used to be a way to add a text file, named "tvdb.id" I think, to the root of the folder with just the text of the ID# & have it force a match that way, but I don’t know if that still works or the specifics as I only played around with it a few years ago.

Thanks for clarifying. I understand more what your desired result is, & though I personally don’t think it’ll happen, & I think tools like the one posted above by @dane22 are probably a better solution, I’ll keep an eye on this tread & if I think of anything that might help I’ll post here. Anything that gets Plexians thinking about the .plexmatch file is good in my book, as the Feature Suggestion I have that you referenced states I think the .plexmatch file has the potential to do a lot, & the 1 Vote I got (My Own) will probably stay that way no matter what. I just hope the Devs see it & the examples & think, "oh, that sounds useful, & it wouldn’t be hard to do, we’re editing the feature anyway, why not add that" but hey, I can dream.

Thanks again, @LostOnTheLine. The problem with the tool @dane22 linked to is that it generates .plexmatch files for every series. I definitely do not want that, as it would prevent potentially better matches in the future, and since some of the media I have already is likely mismatched, it would force it to always be detected incorrectly once the defective .plexmatch file is created. I believe this option should only operate as an option when I perform a manual adjustment to matching behavior.

See, that’s where you loose me. If you are going in manually I think it’s just as easy to do it in your file manger, easier TBH. You could use the tool, then do a search for .plexmatch & look at the results, select all, and manually unselect the ones you want to keep, then hit delete. 1 & done. Having to go & manually find all the ones you want seems to be the reason for the button, so if you have to do it manually on each show/movie I’d personally rather do it manually, you could even do a sample .plexmatch file & copy it over each time & edit it. If the problem is not knowing how what to put in the .plexmatch file, understandable with the documentation provided, you could post the shows you want & I could just give you a copy-paste for each file, assuming there are only a few, if you have more than like 6 I’ll tell you how I made it & give you the 1st couple, & you should be able to do it pretty easily yourself

I just re-read the plexmatch info page and it says that whenever a tvdbid, tmdbid, or imdbid is assigned that the Show/Title and Year values are ignored. Seems like assigning just these values is appropriate.

The PlexMatch-File-Generator program doesn’t assign or preserve any of these ID values. It only stores the Title, Year and Guid (which appears to be a unique value within the local database, which is entirely different from one of the public database ID values). I’ve been digging thru the database and I do see a Guid under the Hints (strong_show_guid), which appears to be the one pulled from TheTVDB, TheMovieDB or IMDB. It looks like PlexMatch-File-Generator also doesn’t update the .plexmatch file if you run it again after making changes, but rather appends the same Title, Year and Guid values to the file each time it’s run. The plexmatch docs don’t say necessarily that only one value is allowed, or that only the last one is preserved, but it might be safe to assume that’s the behavior.

It might be worth it to just dig through the code myself and see what effort would be required to add this feature, but I’m not seeing a public repo.

1 Like

Yeah, it clearly indicates that the TVdb/TMdb/IMdb IDs are highest priority. I would assume that any app would use those since it’s highest priority & it’s a single entity. If it doesn’t I would wager that the reason is its easier to pull data for the “what was matched” than an ID pulled from that match, either that or it’s just pulling the information from what is in Plex. If you are using it I’d suggest making a new entry for a movie/show you don’t have anywhere with just the TVdb/TMdb ID in the folder name & then run the tool & see if it then pulls the names still or shows the ID. Also try matching a Movie/Show, then editing the name, I’d put a different entry in Name, Sort Name, & Original Name, as well as change the year in your Plex UI. Then see what the tool puts in the .plexmatch file. If it gives you the changes you made I’d say the tool is pretty useless on the whole, if not then there’s hope, there might be a way to alter or make a similar tool to pull the information you want.

Yeah, I’d say that makes that particular tool a non-starter for what you want. The .plexmatch has to, in some way, ignore multiple entries for the same field, & I’m highly doubtful that it will use the Last… Most likely it will use the 1st value it finds of the highest priority that’s in the file.

I dunno, it still sounds to me like a lot more work than the at most 3 minutes to manually find that data. But it’s quite interesting, I’d really like a better, more comprehensive .plexmatch documentation but I feel that’s a dream that will never see the light of day

Well if you find one let me know, I’ll take a look… Though I don’t think I’ll be of much help in altering it

The specific code for the tool where it does the writing is here (~line 133) and it literally only appends Title, Year and Guid to the .plexmatch file, creating a new one if it doesn’t exist. I’m not 100% sure that the Guid is a unique database-level value (and not from one of the ID services), but since it’s written as Guid instead of one of the unique ID values that the .plexmatch docs refer to it doesn’t look like it’ll work anyway.

The sqlite database does store the relevant information and it should be simple enough to extract paths and other relevant data from the Hints column as a strong_show_guid parameter to automate building them using a script. I can use this to resolve my specific need. I was just hoping to have it built into the existing UI.

1 Like