I've set Sonarr to notify Plex when a new item is added to my library. This causes a refresh of my library, but this library doesn't work properly. I expected the update to simply pick up the new file and add it to my library, but it additionally removes random episodes from my Library.
For example, I have Season 1 & 2 of Battlestar Galactica and I add an episode to Season 3. After the update has finished I open up my TV Shows in Plex and it is only showing Season 1 and Season 3.
Initially I thought this was due to Sonarr and Plex having different file paths, but the Sonarr devs assure me that they only send an Update notification to Plex, and don't contain any file paths.
Looking at my Plex Media Scanner.log
, I can see the following:
Jan 27, 2016 08:37:35 [0x7fff7a83e000] DEBUG - Adding subdirectory for scanner: /Volumes/SSD/mnt/odin/tv/Battlestar Galactica (2003)/Season 01
Jan 27, 2016 08:37:35 [0x7fff7a83e000] DEBUG - Adding file for scanner: /Volumes/SSD/mnt/odin/tv/Battlestar Galactica (2003)/Season 02
Jan 27, 2016 08:37:35 [0x7fff7a83e000] DEBUG - Adding subdirectory for scanner: /Volumes/SSD/mnt/odin/tv/Battlestar Galactica (2003)/Season 03
Why is Season 02 being marked as a file rather than subdirectory? Opening a Terminal
window and running ls -al
in the parent directory shows that it is indeed a folder:
thor:Battlestar Galactica (2003) tv$ ls -al
total 0
drwxrwxr-x 1 user wheel 264 27 Jan 04:17 .
drwxrwxrwx@ 1 user wheel 2540 24 Jan 22:39 ..
drwxrwxr-x 1 user wheel 466 24 Jan 11:17 Season 01
drwxrwxr-x 1 user wheel 704 27 Jan 03:43 Season 02
drwxrwxr-x 1 user wheel 264 27 Jan 08:37 Season 03
Running a full TV Shows update from the TV Shows menu, re-adds the files.