Updating series folder name confuses Drone about existing files

Yesterday I noticed that TVDB/Trakt had changed the title of Seirei Tsukai no Blade Dance to Blade Dance of the Elementalers. I figured I should update the series info and also rename my series folder so the notification I get would display the actual folder I’d need to navigate to on my media player. However, after updating the folder name, it seems that none of the existing files are rescanned (or simply updated) to point to the new path.

I figured I’d just do a rename on all files, but I got an error toast because it couldn’t find the files that it thought existed. I fixed that by updating the series info again and then doing a rename on the episodes, but that made the process rather lengthy:

  1. Update series info.
  2. Rename folder on the filesystem and in Drone to fit the new series title.
  3. Update series info again.
  4. Rename episode files (though I’m not sure this was needed, in hindsight).

I think it would be a good idea to automatically do a rescan of the series folder after it has been renamed. At the very least that would prevent that error toast from appearing when you click rename.

Should it be relevant, the exception that’s involved with it:

NzbDrone.Common.Exceptions.NotParentException: /volume1/video/series/Anime/Seirei Tsukai no Blade Dance/Season 01/1x01 - 001 - Episode 1.mkv is not a child of /volume1/video/series/Anime/Blade Dance of the Elementalers
at NzbDrone.Common.PathExtensions.GetRelativePath (string,string) <0x0011b>
at NzbDrone.Core.MediaFiles.RenameEpisodeFileService/<GetPreviews>d__c.MoveNext () <0x0076b>
at System.Linq.Enumerable.ToArray<NzbDrone.Core.MediaFiles.RenameEpisodeFilePreview>(System.Collections.Generic.IEnumerable`1<NzbDrone.Core.MediaFiles.RenameEpisodeFilePreview>) <0x00214>
at System.Linq.QuickSort`1<NzbDrone.Core.MediaFiles.RenameEpisodeFilePreview>..ctor (System.Collections.Generic.IEnumerable`1<NzbDrone.Core.MediaFiles.RenameEpisodeFilePreview>,System.Linq.SortContext`1<NzbDrone.Core.MediaFiles.RenameEpisodeFilePreview>) <0x00037>
at System.Linq.QuickSort`1/<Sort>c__Iterator0<NzbDrone.Core.MediaFiles.RenameEpisodeFilePreview>.MoveNext () <0x00093>
at System.Collections.Generic.List`1<NzbDrone.Core.MediaFiles.RenameEpisodeFilePreview>.AddEnumerable (System.Collections.Generic.IEnumerable`1<NzbDrone.Core.MediaFiles.RenameEpisodeFilePreview>) <0x0008a>
at System.Collections.Generic.List`1<NzbDrone.Core.MediaFiles.RenameEpisodeFilePreview>..ctor (System.Collections.Generic.IEnumerable`1<NzbDrone.Core.MediaFiles.RenameEpisodeFilePreview>) <0x000c7>
at System.Linq.Enumerable.ToList<NzbDrone.Core.MediaFiles.RenameEpisodeFilePreview> (System.Collections.Generic.IEnumerable`1<NzbDrone.Core.MediaFiles.RenameEpisodeFilePreview>) <0x0003b>
at NzbDrone.Core.MediaFiles.RenameEpisodeFileService.GetRenamePreviews (int) <0x001cb>
at NzbDrone.Api.Episodes.RenameEpisodeModule/<>c__DisplayClassd.<GetEpisodes>b__c () <0x00028>
at NzbDrone.Api.NzbDroneRestModule`1<NzbDrone.Api.Episodes.RenameEpisodeResource>.ToListResource<NzbDrone.Core.MediaFiles.RenameEpisodeFilePreview> (System.Func`1<System.Collections.Generic.IEnumerable`1<NzbDrone.Core.MediaFiles.RenameEpisodeFilePreview>>) <0x0001b>
at NzbDrone.Api.Episodes.RenameEpisodeModule.GetEpisodes () <0x00b73>
at NzbDrone.Api.REST.RestModule`1<NzbDrone.Api.Episodes.RenameEpisodeResource>.<set_GetResourceAll>b__c (object) <0x0001e>
at (wrapper dynamic-method) object.CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,System.Func`2<object, object>,object) <0x000a0>
at Nancy.Routing.Route/<>c__DisplayClass4.<Wrap>b__3 (object,System.Threading.CancellationToken) <0x00137>

The underlying problem is the episode file cares about the series folder it is in and really shouldn’t, this causes two issues, one the episode files are in a weird state as you noticed and two they need to be rescanned, which goes through the entire parsing process again.

I thought it was already on Trello, but its there now: https://trello.com/c/qmmukpVJ/736-convert-episode-file-paths-to-relative

That does sound like a better idea. Thanks for making the ticket for it. :smile: