Existing subtitles are not renamed when existing shows are renamed

Sonarr version (exact version):
Mono version (if Sonarr is not running on Windows):
OS: macOS 11.7.4 (Big Sur)
Debug logs:
Description of issue:

If a show with subtitles is imported without renaming, and then the user later uses the Organize & Rename feature of Sonarr, the video files are renamed, but not the subtitle files.

So in a season folder if there is Show.Name.S01E01.WEBRip.1080p.mp4, Show.Name.S01E02.WEBRip.1080p.mp4, etc., and the corresponding Show.Name.S01E01.WEBRip.1080p.en.srt, Show.Name.S01E02.WEBRip.1080p.en.srt, etc., the mp4 files will be renamed according to the preferences set in Settings > Media Management > Episode Naming, but the user has to manually rename the .srt files.

Not too bad when there is only one .srt file per episode, but some of my shows have multiple .srt files per episode. This also happens if the .srt has no country code.

Sonarr version (exact version) :
Mono version (if Sonarr is not running on Windows) :
OS : UNRAID 6.11.5
Debug logs :
Description of issue :

Not only do I have the same problems, I also have issues when adding a new show.
None of the subtitles are moved into the Season folder.

This just started in the past week or so.

Windows 11

Same here. I tried adding more subtitle formats, restart program, restart PC and so on.

It seems the last update broke it!

EDIT: Just added a new show…no issues with that.

Mono Version
Mac OS 10.14.6

Same issue here :frowning:

In the logs I see what looks related:

2023-03-12 23:11:15.3|Info|RenameEpisodeFileService|Renaming 9 files for **[Redacted]**
2023-03-12 23:11:16.2|Error|EventAggregator|ExtraService failed while processing [SeriesRenamedEvent]

[v3.0.10.1566] System.ArgumentNullException: Value cannot be null.
Parameter name: values
  at System.String.Join (System.String separator, System.Collections.Generic.IEnumerable`1[T] values) [0x00081] in /Users/builder/jenkins/wo
  at NzbDrone.Core.Extras.Subtitles.SubtitleFile.get_LanguageTagsAsString () [0x00000] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.C
  at NzbDrone.Core.Extras.Subtitles.SubtitleFile.get_AggregateString () [0x00000] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\E
  at NzbDrone.Core.Extras.Subtitles.SubtitleService+<>c.<MoveFilesAfterRename>b__12_1 (NzbDrone.Core.Extras.Subtitles.SubtitleFile s) [0x000
00] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Extras\Subtitles\SubtitleService.cs:75 
  at System.Linq.Lookup`2[TKey,TElement].Create (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] keySelector, S
ystem.Collections.Generic.IEqualityComparer`1[T] comparer) [0x00017] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/exte
  at System.Linq.GroupedEnumerable`2[TSource,TKey].ToList () [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/ex
  at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0000e] in /Users/builder/jenkins/workspa
  at NzbDrone.Core.Extras.Subtitles.SubtitleService.MoveFilesAfterRename (NzbDrone.Core.Tv.Series series, System.Collections.Generic.List`1[
T] episodeFiles) [0x00037] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\Extras\Subtitles\SubtitleService.cs:74 
  at NzbDrone.Core.Extras.ExtraService.Handle (NzbDrone.Core.MediaFiles.Events.SeriesRenamedEvent message) [0x0002a] in C:\BuildAgent\work\6
  at NzbDrone.Core.Messaging.Events.EventAggregator.PublishEvent[TEvent] (TEvent event) [0x0011a] in C:\BuildAgent\work\63739567f01dbcc2\src

I wonder if this change is responsible, although that was 7 months ago. Is it possible that didn’t make it into the production release until this latest version?

More info that might help debug:

Folder structure was:

   +-- ShowName.SxxEyy/
       +-- (Video file)
   +-- Subs/
       +-- ShowName.SxxEyy/
           +-- X_langname.srt (as many as there are subs)

This structure worked fine in the past for getting subs renamed alongside the video files into season folders, for example.

Yeah, that change was only ever in a develop build and underwent some changes since then that aren’t part of v3. I’ve pushed a new main build ( that removes this and some other changes that shouldn’t be part of the release.

1 Like

Thanks Markus! From quick testing it appears to have resolved the issue for me on running manual reorganization (after renaming the season folder first and re-scanning, as expected would be necessary).

Appreciate the quick turnaround!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.