Server Version#: 1.32.7.7621
Player Version#: 4.108.0
Depending on the contents of a directory, plex might ignore it or actively destroy it. This behavior is very weird so I’ll provide an example (I can provide logs if requested) below.
Consider my directory:
/anime/Chivalry_of_a_Failed_Knight/Season_01
which contains:
Chivalry_of_a_Failed_Knight-S01E01, The_Worst_One_I-[Doki-Bluray-1080p].mkv
Chivalry_of_a_Failed_Knight-S01E02, The_Worst_One_II-[Doki-Bluray-1080p].mkv
Chivalry_of_a_Failed_Knight-S01E03, The_Worst_One_III-[Doki-Bluray-1080p].mkv
Chivalry_of_a_Failed_Knight-S01E04, The_Worst_One_IV-[Doki-Bluray-1080p].mkv
Chivalry_of_a_Failed_Knight-S01E05, The_Experience_of_the_Princess-[Doki-Bluray-1080p].mkv
Chivalry_of_a_Failed_Knight-S01E06, Sword_Eater_I-[Doki-Bluray-1080p].mkv
Chivalry_of_a_Failed_Knight-S01E07, Sword_Eater_II-[Doki-Bluray-1080p].mkv
Chivalry_of_a_Failed_Knight-S01E08, Sword_Eater_III-[Doki-Bluray-1080p].mkv
Chivalry_of_a_Failed_Knight-S01E09, Princess'_Vacation-[Doki-Bluray-1080p].mkv
Chivalry_of_a_Failed_Knight-S01E10, Witch_of_the_Deep_Ocean_vs_Raikiri-[Doki-Bluray-1080p].mkv
Chivalry_of_a_Failed_Knight-S01E11, Another_One-_The_Uncrowned_Sword_King_I-[Doki-Bluray-1080p].mkv
Chivalry_of_a_Failed_Knight-S01E12, Another_One-_The_Uncrowned_Sword_King_II-[Doki-Bluray-1080p].mkv
Plex will not see show this directory or the files in the library. However, if I do copy Chivalry_of_a_Failed_Knight-S01E12, Another_One-_The_Uncrowned_Sword_King_II-[Doki-Bluray-1080p].mkv
into Chivalry_of_a_Failed_Knight-S01E13.mkv
(so there are now 13 episodes in the directory) plex picked up on all 13 files!
If I then remove this 13th file, in the plex logs the scanner will show:
Library section 5 (Anime) will be updated because of a change in "/anime/Chivalry_of_a_Failed_Knight/Season_01/Chivalry_of_a_Failed_Knight-S01E13.mkv"
At this point (at least this time) the plex library is as one would expect, the original 12 episodes. However, if I then enter plex and tell plex to rescan the library again the entire series will be deleted. From the logs:
...
Nov 17, 2023 07:47:35.548 [140398782876472] DEBUG - Was connected to metadata item 90273, count is now 0.
Nov 17, 2023 07:47:35.549 [140398782876472] DEBUG - Destroying metadata item 90273 (Princess' Vacation)
Nov 17, 2023 07:47:35.549 [140398782876472] DEBUG - Updating deletion state for metadata item 90264, is has a dead item count of 0.
Nov 17, 2023 07:47:35.550 [140398782876472] DEBUG - Updating deletion state for metadata item 90263, is has a dead item count of 0.
Nov 17, 2023 07:47:35.550 [140398373428024] DEBUG - [LibraryTimeline] Scanner activity on section 5: 0 added, 9 deleted
Nov 17, 2023 07:47:35.551 [140398782876472] DEBUG - Deleting media item 146279.
Nov 17, 2023 07:47:35.551 [140398782876472] DEBUG - Was connected to metadata item 90274, count is now 0.
Nov 17, 2023 07:47:35.551 [140398782876472] DEBUG - Destroying metadata item 90274 (Witch of the Deep Ocean vs Raikiri)
Nov 17, 2023 07:47:35.552 [140398782876472] DEBUG - Updating deletion state for metadata item 90264, is has a dead item count of 0.
Nov 17, 2023 07:47:35.552 [140398782876472] DEBUG - Updating deletion state for metadata item 90263, is has a dead item count of 0.
Nov 17, 2023 07:47:35.553 [140398373428024] DEBUG - [LibraryTimeline] Scanner activity on section 5: 0 added, 10 deleted
Nov 17, 2023 07:47:35.553 [140398782876472] DEBUG - Deleting media item 146280.
Nov 17, 2023 07:47:35.553 [140398782876472] DEBUG - Was connected to metadata item 90275, count is now 0.
Nov 17, 2023 07:47:35.553 [140398782876472] DEBUG - Destroying metadata item 90275 (An Uncrowned Champion I)
Nov 17, 2023 07:47:35.554 [140398782876472] DEBUG - Updating deletion state for metadata item 90264, is has a dead item count of 0.
Nov 17, 2023 07:47:35.555 [140398782876472] DEBUG - Updating deletion state for metadata item 90263, is has a dead item count of 0.
Nov 17, 2023 07:47:35.555 [140398373428024] DEBUG - [LibraryTimeline] Scanner activity on section 5: 0 added, 11 deleted
Nov 17, 2023 07:47:35.555 [140398782876472] DEBUG - Deleting media item 146281.
Nov 17, 2023 07:47:35.556 [140398782876472] DEBUG - Was connected to metadata item 90276, count is now 0.
Nov 17, 2023 07:47:35.556 [140398782876472] DEBUG - Destroying metadata item 90276 (An Uncrowned Champion II)
Nov 17, 2023 07:47:35.557 [140398782876472] DEBUG - Destroying metadata item 90264 (Season 1)
Nov 17, 2023 07:47:35.557 [140398782876472] DEBUG - Destroying metadata item 90263 (Chivalry of a Failed Knight)
Nov 17, 2023 07:47:35.558 [140398373428024] DEBUG - [LibraryTimeline] Scanner activity on section 5: 0 added, 12 deleted
Nov 17, 2023 07:47:35.559 [140398373428024] DEBUG - [LibraryTimeline] Scanner activity on section 5: 0 added, 13 deleted
Nov 17, 2023 07:47:35.559 [140398373428024] DEBUG - [LibraryTimeline] Scanner activity on section 5: 0 added, 14 deleted
Nov 17, 2023 07:47:35.641 [140398782876472] DEBUG - Removing 2 directories that were left.
Nov 17, 2023 07:47:35.642 [140398782876472] DEBUG - Deleting directory [Chivalry_of_a_Failed_Knight] (7958)
Nov 17, 2023 07:47:35.676 [140398782876472] DEBUG - Deleting directory [Chivalry_of_a_Failed_Knight/Season_01] (7959)
Any help about what is going on and how to fix it would be appreciated!