Where does "Episode" count come from?

server-linux

#1

When I go to my library, I click to view all my episodes, and I get a count.

it says 805. I added 500 files, and I see them when I sort by date added. However, the count is still the same, at 805. I suspect it's way off, and should be around 2,000+.

I've tried restarting, updating the server, logging out of the browser. Nothing helps.

This is on the latest version, Version 1.13.0.5023.

Going crazy trying to make sure everything got imported correctly....


#2

The first thing you must do is make sure of the naming and structure:

The fundamental structure for Series and Episodes is:

Series/
  Season n/
    Series - SxxExx - Optional Title.ext

With this stucture, you and Plex will know better where you stand.

To obtain an exact count of the number of files you have, Linux is very good at that.

find /pathname -type f -print | wc -l

Finds all the files under that directory, prints then out, one per line, which is captured by wc to count the number of lines


#3

@ChuckPA said:
The first thing you must do is make sure of the naming and structure:

The fundamental structure for Series and Episodes is:

Series/
  Season n/
    Series - SxxExx - Optional Title.ext

With this stucture, you and Plex will know better where you stand.

To obtain an exact count of the number of files you have, Linux is very good at that.

find /pathname -type f -print | wc -l

Finds all the files under that directory, prints then out, one per line, which is captured by wc to count the number of lines

Hi Chuck,

Thanks for the help. I actually just want to make sure they're actually imported into my new plex install. They were in a previous install before, so the file naming doesn't have any issues.

It's just that after importing the files into Plex, seeing them, and able to watch them, I can't get my count to be updated. It doesn't make sense, since I see new episodes in the episode list, but the count isn't updating.

Running your command gives me an approximate count along what I was thinking -- and what matches the original Plex install, around 2,900 videos. I'm not sure why the count doesn't update in the new plex install, even though it appears that all the videos are present.


#4

If you're having count mismatches, there is a tool you can install (a plug-in) which will help you find unmatched media. It counts the number of unique episodes. If you have duplicates, that won't show. If it and Plex comes up with the same number of matched then you know where the problem lies. Fortunately, the ninja who wrote it also added the ability to list out duplicates to make curating easier.

You want to install the WebTools plug-in. It was written and is maintained by Dane22. Here's a link to the thread. I don't have the exact download link. I know it's on github. If you're ok with searching around the thread a bit, you'll find it.
https://forums.plex.tv/discussion/288191/webtools-unsupported-appstore


#5

Very cool, will check this tool out -- thanks for showing me a path to go down!


#6

There is one issue I saw, and that's that I saw the count go up briefly after a scan. When I opened it up again later, it went back down to 800... not sure what's going on there.

Maybe this WebTools thing will help me figure out what's going on.


#7

Hmm, I think we're getting further. WebTools shows 805, and it says : " Perfect! Media files are present and accessible for all items in the Plex database."

Then directly below that: "These media files are missing, but the Plex database still has them listed. They were either deleted, the hard drive got disconnected or moved, or you simply forgot to empty the library trash in Plex if you erased them intentionally."

It proceeds then to list 805 files. I have just verified that these are all valid and exist in the places WebTools says. I guess whatever WebTools is checking to see if the files are there isn't compatible with my rclone mount. Maybe my scans aren't going correctly... I'm using a programmatic scan based on directory as follows:

/usr/lib/plexmediaserver/Plex\ Media\ Scanner -s -r -c 1 -d /mnt/gdrive/nhk_shows/SHOW_TITLE/

Is there anything wrong with that?


#8

That directory looks good if /mnt/gdrive/nhk_shows is the top directory Plex looks at.
One problem seen is gdrive sometimes drops the connection and PMS marks files as disconnected. This will change the count.

Rather than invoking the scanner manually, why not have it go over the entire library after you do a find /mnt/gdrive/nhk_shows -print > /dev/null . This will wake everything up and load the directories into your filesystem cache. It'll make scanning run quicker.

When done, do the rest of the 'Empty Trash' and "Clean Bundles". Counts should come back into alignment


#9

Will try that. I have been scared of API limits, so have been avoiding that.

Since yesterday, my count has climbed a little bit, back up to 977 now. Scanning the whole library after waking up the FS, so let's see where this goes..


#10

Well, the scan was initially going well, I saw the count go up to 1200, then it dropped back to 999


#11

Looks like the scan completed, and we are back to it settling down to 999.