Existing subtitles are not renamed when existing shows are renamed

Sonarr version (exact version): 3.0.10.1566
Mono version (if Sonarr is not running on Windows): 6.12.0.182
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) : 3.0.10.1566
Mono version (if Sonarr is not running on Windows) : 6.12.0.182
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.

v3.0.10.1566
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.

Version 3.0.10.1566
Mono Version 6.12.0.122
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
rkspace/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/external/corefx/src/Common/src/CoreLib/System/String.Manipulation.
cs:607 
  at NzbDrone.Core.Extras.Subtitles.SubtitleFile.get_LanguageTagsAsString () [0x00000] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.C
ore\Extras\Subtitles\SubtitleFile.cs:15 
  at NzbDrone.Core.Extras.Subtitles.SubtitleFile.get_AggregateString () [0x00000] in C:\BuildAgent\work\63739567f01dbcc2\src\NzbDrone.Core\E
xtras\Subtitles\SubtitleFile.cs:11 
  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
rnal/bockbuild/builds/mono-x64/external/corefx/src/System.Linq/src/System/Linq/Lookup.cs:96 
  at System.Linq.GroupedEnumerable`2[TSource,TKey].ToList () [0x00000] in /Users/builder/jenkins/workspace/build-package-osx-mono/2020-02/ex
ternal/bockbuild/builds/mono-x64/external/corefx/src/System.Linq/src/System/Linq/Grouping.cs:270 
  at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0000e] in /Users/builder/jenkins/workspa
ce/build-package-osx-mono/2020-02/external/bockbuild/builds/mono-x64/external/corefx/src/System.Linq/src/System/Linq/ToCollection.cs:30 
  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
3739567f01dbcc2\src\NzbDrone.Core\Extras\ExtraService.cs:152 
  at NzbDrone.Core.Messaging.Events.EventAggregator.PublishEvent[TEvent] (TEvent event) [0x0011a] in C:\BuildAgent\work\63739567f01dbcc2\src
\NzbDrone.Core\Messaging\Events\EventAggregator.cs:92

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/
   +-- 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 ( 3.0.10.1567) 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.