Skip to content

Commit

Permalink
fix: ensure customLangExt is used only without duplicate keys
Browse files Browse the repository at this point in the history
- Updated hasCustomLangExt to check for duplicate keys
- Ensures customLangExt is applied only when no duplicates exist
- Improves reliability of language extension handling
  • Loading branch information
qwqcode committed Sep 24, 2024
1 parent 89d0e1e commit d7db0db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SubRenamer/Services/RenameService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void UpdateRenameTaskList(IReadOnlyList<MatchItem> matchList, Collection<
var hasDuplicateKey = matchList.GroupBy(x => x.Key).Any(g => g.Count() > 1);
var keepLangExt = Config.Get().KeepLangExt || hasDuplicateKey;
var customLangExt = Config.Get().CustomLangExt.Trim();
var hasCustomLangExt = !string.IsNullOrEmpty(customLangExt);
var hasCustomLangExt = !hasDuplicateKey && !string.IsNullOrEmpty(customLangExt);

foreach (var item in matchList)
{
Expand Down

0 comments on commit d7db0db

Please sign in to comment.