Skip to content

Commit 7cef361

Browse files
mpracharclaude
andcommitted
fix: return nil from filterManualImportToSplitTracks when NewFiles is empty
When item.Resp is nil or NewFiles is empty, the function was returning the full unfiltered outputs slice. This made filterSplitOutputs always see a non-empty result, making the filterManualImportToNumberedTracks fallback completely unreachable (dead code). Return nil instead to signal "couldn't filter", allowing the numbered track pattern fallback to work as intended for CUE splits where MoveFiles has already moved tracks back to the original folder. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 161eda8 commit 7cef361

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/unpackerr/lidarr.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func crossPlatformBase(path string) string {
168168
// host (e.g. Linux) may use different paths than the Starr app (e.g. Windows).
169169
func filterManualImportToSplitTracks(outputs []*lidarr.ManualImportOutput, item *Extract) []*lidarr.ManualImportOutput {
170170
if item == nil || item.Resp == nil || len(item.Resp.NewFiles) == 0 {
171-
return outputs
171+
return nil // Signal that we couldn't filter; caller should try fallback.
172172
}
173173

174174
splitFiles := make(map[string]struct{}, len(item.Resp.NewFiles))

0 commit comments

Comments
 (0)