feat(NST): update langue to new allowed values (Français, VF, VFF, VF… #98

Merged
yippee0903 merged 2 commits from fix/nst-langue-values into master 2026-03-22 23:25:30 +00:00
yippee0903 commented 2026-03-22 23:09:07 +00:00 (Migrated from github.com)

…I, VFQ)

NST dropped Multi, Anglais, VOSTFR, VFSTFR, Muet from their langue field. Rewrite _detect_nst_langue to detect VF variant tags (.VFF., .VFQ., .VFI., .VF2., .VOF., .MULTI.VFF. etc.) from the release name, falling back to audio_languages for generic Français. Update all tests accordingly.

Summary by CodeRabbit

  • Improvements
    • Refined NST language detection to prioritize explicit VF variant tags (VFF, VFQ, VFI, VF) and better map VO/French indicators to "Français"; reduced reliance on inferred "Multi"/English from audio listings.
  • Tests
    • Updated unit tests to reflect new detection outputs and adjusted expectations for various release-name scenarios.
…I, VFQ) NST dropped Multi, Anglais, VOSTFR, VFSTFR, Muet from their langue field. Rewrite _detect_nst_langue to detect VF variant tags (.VFF., .VFQ., .VFI., .VF2., .VOF., .MULTI.VFF. etc.) from the release name, falling back to audio_languages for generic Français. Update all tests accordingly. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Improvements** * Refined NST language detection to prioritize explicit VF variant tags (VFF, VFQ, VFI, VF) and better map VO/French indicators to "Français"; reduced reliance on inferred "Multi"/English from audio listings. * **Tests** * Updated unit tests to reflect new detection outputs and adjusted expectations for various release-name scenarios. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
coderabbitai[bot] commented 2026-03-22 23:09:31 +00:00 (Migrated from github.com)

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6f743895-d45e-4d2a-a182-7c0e4972b178

📥 Commits

Reviewing files that changed from the base of the PR and between eaec6456e5 and 3d421a79eb.

📒 Files selected for processing (2)
  • src/trackers/NST.py
  • tests/test_nst.py
Files skipped from review due to trivial changes (1)
  • src/trackers/NST.py

📝 Walkthrough

Walkthrough

Redesigned NST's _detect_nst_langue() to derive langue from VF-related variant tags embedded in release names (VFF, VFQ, VFI, VF, or Français). Removed prior outputs Multi, VOSTFR, and Anglais, and reduced reliance on audio_languages for English/Multi detection.

Changes

Cohort / File(s) Summary
Language Detection Logic
src/trackers/NST.py
Rewrote _detect_nst_langue() and updated get_additional_data() mapping: prioritize explicit name-embedded VF variants (VFF, VFQ, VFI), then generic VF variants, map VOF/FRENCH/TRUEFRENCH to Français, handle MULTI by extracting VF variant or defaulting to VF. Removed Multi/VOSTFR/Anglais outputs; audio_languages only used for French aliases.
Test Cases
tests/test_nst.py
Updated TestDetectNstLangue expectations to assert VFF, VFQ, VFI, VF, and Français mappings; removed assertions for Multi, VOSTFR, and Anglais. Adjusted additional-data test to expect langue == "VFF" for MULTi.VFF... cases.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | 2 | 1

Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks (2 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and specifically describes the main change: updating NST's langue field to new allowed values (Français, VF, VFF, VFI, VFQ), which aligns with the core objective of the PR.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/nst-langue-values

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

<!-- This is an auto-generated comment: summarize by coderabbit.ai --> No actionable comments were generated in the recent review. 🎉 <details> <summary>ℹ️ Recent review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Path: .coderabbit.yaml **Review profile**: CHILL **Plan**: Pro **Run ID**: `6f743895-d45e-4d2a-a182-7c0e4972b178` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between eaec6456e5c089bd817183f45299ea8640c666c6 and 3d421a79eb823b63f15330bf2cfd1d689599de73. </details> <details> <summary>📒 Files selected for processing (2)</summary> * `src/trackers/NST.py` * `tests/test_nst.py` </details> <details> <summary>✅ Files skipped from review due to trivial changes (1)</summary> * src/trackers/NST.py </details> </details> --- <!-- walkthrough_start --> <details> <summary>📝 Walkthrough</summary> ## Walkthrough Redesigned NST's `_detect_nst_langue()` to derive `langue` from VF-related variant tags embedded in release names (VFF, VFQ, VFI, VF, or Français). Removed prior outputs `Multi`, `VOSTFR`, and `Anglais`, and reduced reliance on `audio_languages` for English/Multi detection. ## Changes |Cohort / File(s)|Summary| |---|---| |**Language Detection Logic** <br> `src/trackers/NST.py`|Rewrote `_detect_nst_langue()` and updated `get_additional_data()` mapping: prioritize explicit name-embedded VF variants (`VFF`, `VFQ`, `VFI`), then generic `VF` variants, map `VOF`/`FRENCH`/`TRUEFRENCH` to `Français`, handle `MULTI` by extracting VF variant or defaulting to `VF`. Removed `Multi`/`VOSTFR`/`Anglais` outputs; `audio_languages` only used for French aliases.| |**Test Cases** <br> `tests/test_nst.py`|Updated `TestDetectNstLangue` expectations to assert `VFF`, `VFQ`, `VFI`, `VF`, and `Français` mappings; removed assertions for `Multi`, `VOSTFR`, and `Anglais`. Adjusted additional-data test to expect `langue == "VFF"` for `MULTi.VFF...` cases.| ## Estimated code review effort 🎯 3 (Moderate) | ⏱️ ~20 minutes ## Possibly related PRs - yippee0903/Upload-Assistant#92: Modifies NST's `_detect_nst_langue` logic to expand recognized French alias codes and tag handling. - yippee0903/Upload-Assistant#88: Previously updated NST tracker language-detection and tests; touches the same functions and test suite. </details> <!-- walkthrough_end --> <!-- pre_merge_checks_walkthrough_start --> <details> <summary>🚥 Pre-merge checks | ✅ 2 | ❌ 1</summary> ### ❌ Failed checks (1 warning) | Check name | Status | Explanation | Resolution | | :----------------: | :--------- | :------------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------- | | Docstring Coverage | ⚠️ Warning | Docstring coverage is 15.00% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary>✅ Passed checks (2 passed)</summary> | Check name | Status | Explanation | | :---------------: | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. | | Title check | ✅ Passed | The title clearly and specifically describes the main change: updating NST's langue field to new allowed values (Français, VF, VFF, VFI, VFQ), which aligns with the core objective of the PR. | </details> <sub>✏️ Tip: You can configure your own custom pre-merge checks in the settings.</sub> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- finishing_touch_checkbox_start --> <details> <summary>✨ Finishing Touches</summary> <details> <summary>📝 Generate docstrings</summary> - [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> Create stacked PR - [ ] <!-- {"checkboxId": "3e1879ae-f29b-4d0d-8e06-d12b7ba33d98"} --> Commit on current branch </details> <details> <summary>🧪 Generate unit tests (beta)</summary> - [ ] <!-- {"checkboxId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Create PR with unit tests - [ ] <!-- {"checkboxId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Commit unit tests in branch `fix/nst-langue-values` </details> </details> <!-- finishing_touch_checkbox_end --> <!-- tips_start --> --- Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=yippee0903/Upload-Assistant&utm_content=98)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary>❤️ Share</summary> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </details> <sub>Comment `@coderabbitai help` to get the list of available commands and usage tips.</sub> <!-- tips_end --> <!-- internal state start --> <!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKPR1AGxJcAZiWoAFAByAMrQAJRc2Ny01CSQHphE2PEEkOQA7ugeHvgZdJASaB4pyAEAYlQYAOfaiAA0kABq5Y0trc3lAJJt5QCK4ZCQBkGOApRcAJwAHEMGAKo2ADJcsLi43IgcAPTbROqw2AIaTMzbsvDc3CQkAAyTtwDM2/PcuWi0YACCiIhIuJhcNtuNgctsZnN5ogJpALlcbvcnnMQvhsBQGPEBFUGLBfPAAB7bDCIXBgRIYZIkMBFErSSCAJMIYM5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cUIE8gxBVo4w4Ky43Ii4KmUQpGYsToAA5MgEpImMmIBNBlkCBHkAUObGUBGvmJ0L0B0Ngr0AMFGggJEkinLPxGlL7EwIJIICIP5FIHyr7LYBoFgTvigQwfhOgfokQKETQVKN/LFMkFKEPsntgVaLgcUPgQfq/uIHHvTn7g7tQY7iwRBPQYfirt7kGGTsoKQLEY7hwTfnDsPmwQ/rBk/h1OUV7mXgoOTivKgLNhoLcLcAAKRkRxQPx3TEjYCNLQLsDvzLhSgACO2A0Kx6UoqeKYfi0wtwgxIxIRLR6xfoeAWks+Ee6g8QBOXRauYYGcvszuYuC6Fkvwzi3oVsaQiAr8iAPg8gXh7qQsXo6x+qKY+xSB+E4RaBzg0RdRf2OBL8HgWRhBr+lxquYK5BTO/uQw468+PIuAtgR+JBHRr+KoyoK26mtAtwJSPgtwaAS2JS62yoBoJSBWDAa2FWLJsQaAaATwtwFW62s2yo8o6mRWDABoaAApC2tAS20wAgJSHwDJeWoReEC+uJNgTBs+6mBoQxkwOotABotAkwDAJSJS1JJJtwtAjW8oJSDieWkw6m02DADwDSHwkwtAjwBojJPgBo6mkwep8oJAo2BoGIbpPgRpnS/uh2UA92j2z2JRcWN29m4WLm8E3AO80IyWdO6ZqW32SpOJVgqZdAXwuABcJmdAYOJ2Zka8sOtw4ZiZeAyZ+ZmZNA12JK+gQAA== --> <!-- internal state end -->
coderabbitai[bot] (Migrated from github.com) requested changes 2026-03-22 23:14:33 +00:00
coderabbitai[bot] (Migrated from github.com) left a comment

Actionable comments posted: 1

🧹 Nitpick comments (1)
tests/test_nst.py (1)

308-360: Add regression tests for direct VF and VF3+ tags.

Given the current matrix, edge cases for .VF. and .VF3/.VF4 are still unguarded.

Suggested test additions
 class TestDetectNstLangue:
+    def test_vf_in_name(self):
+        assert NST._detect_nst_langue({"name": "Movie.2026.VF.1080p.WEB.H264-GRP"}) == "VF"
+
+    def test_vf3_maps_to_vf(self):
+        assert NST._detect_nst_langue({"name": "Movie.2026.VF3.1080p.WEB.H264-GRP"}) == "VF"
As per coding guidelines: `tests/**` should ensure assertions are specific and cover edge cases.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/test_nst.py` around lines 308 - 360, Add regression tests to cover
direct ".VF." and multi-digit VF tags (e.g., ".VF3", ".VF4") by extending
TestDetectNstLangue: add a test that asserts NST._detect_nst_langue({"name":
"Movie.2026.VF.1080p.WEB.H264-GRP"}) == "VF" and tests that ".VF3" and ".VF4"
(e.g., "Movie.2026.VF3.1080p..." and "Movie.2026.VF4.1080p...") also return
"VF"; mirror the style of existing tests (use NST._detect_nst_langue and, if
desired, an async check via NST.get_additional_data) so edge cases for
single-token VF and VF3+ are covered.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/trackers/NST.py`:
- Around line 391-393: The current normalization only maps ".VF2." to "VF" and
misses other French-dub markers; update the logic in NST.py inside the
FrenchTrackerMixin._get_french_dub_suffix (or the nearby VF handling block) to
detect any ".VF" marker with optional digits and either a following dot or
end-of-string (e.g., ".VF.", ".VF3.", ".VF4", or ending ".VF3") and return "VF".
Replace the specific check for ".VF2."/endswith(".VF2") with a pattern-based
check (or equivalent string checks) that covers ".VF", ".VF{n}" and trailing
forms so VF, VF3, VF4 variants normalize to "VF".

---

Nitpick comments:
In `@tests/test_nst.py`:
- Around line 308-360: Add regression tests to cover direct ".VF." and
multi-digit VF tags (e.g., ".VF3", ".VF4") by extending TestDetectNstLangue: add
a test that asserts NST._detect_nst_langue({"name":
"Movie.2026.VF.1080p.WEB.H264-GRP"}) == "VF" and tests that ".VF3" and ".VF4"
(e.g., "Movie.2026.VF3.1080p..." and "Movie.2026.VF4.1080p...") also return
"VF"; mirror the style of existing tests (use NST._detect_nst_langue and, if
desired, an async check via NST.get_additional_data) so edge cases for
single-token VF and VF3+ are covered.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: efb015c9-7087-46f8-a70f-78851f35f93c

📥 Commits

Reviewing files that changed from the base of the PR and between d0584a2652 and eaec6456e5.

📒 Files selected for processing (2)
  • src/trackers/NST.py
  • tests/test_nst.py
**Actionable comments posted: 1** <details> <summary>🧹 Nitpick comments (1)</summary><blockquote> <details> <summary>tests/test_nst.py (1)</summary><blockquote> `308-360`: **Add regression tests for direct `VF` and `VF3+` tags.** Given the current matrix, edge cases for `.VF.` and `.VF3`/`.VF4` are still unguarded. <details> <summary>✅ Suggested test additions</summary> ```diff class TestDetectNstLangue: + def test_vf_in_name(self): + assert NST._detect_nst_langue({"name": "Movie.2026.VF.1080p.WEB.H264-GRP"}) == "VF" + + def test_vf3_maps_to_vf(self): + assert NST._detect_nst_langue({"name": "Movie.2026.VF3.1080p.WEB.H264-GRP"}) == "VF" ``` </details> As per coding guidelines: `tests/**` should ensure assertions are specific and cover edge cases. <details> <summary>🤖 Prompt for AI Agents</summary> ``` Verify each finding against the current code and only fix it if needed. In `@tests/test_nst.py` around lines 308 - 360, Add regression tests to cover direct ".VF." and multi-digit VF tags (e.g., ".VF3", ".VF4") by extending TestDetectNstLangue: add a test that asserts NST._detect_nst_langue({"name": "Movie.2026.VF.1080p.WEB.H264-GRP"}) == "VF" and tests that ".VF3" and ".VF4" (e.g., "Movie.2026.VF3.1080p..." and "Movie.2026.VF4.1080p...") also return "VF"; mirror the style of existing tests (use NST._detect_nst_langue and, if desired, an async check via NST.get_additional_data) so edge cases for single-token VF and VF3+ are covered. ``` </details> </blockquote></details> </blockquote></details> <details> <summary>🤖 Prompt for all review comments with AI agents</summary> ``` Verify each finding against the current code and only fix it if needed. Inline comments: In `@src/trackers/NST.py`: - Around line 391-393: The current normalization only maps ".VF2." to "VF" and misses other French-dub markers; update the logic in NST.py inside the FrenchTrackerMixin._get_french_dub_suffix (or the nearby VF handling block) to detect any ".VF" marker with optional digits and either a following dot or end-of-string (e.g., ".VF.", ".VF3.", ".VF4", or ending ".VF3") and return "VF". Replace the specific check for ".VF2."/endswith(".VF2") with a pattern-based check (or equivalent string checks) that covers ".VF", ".VF{n}" and trailing forms so VF, VF3, VF4 variants normalize to "VF". --- Nitpick comments: In `@tests/test_nst.py`: - Around line 308-360: Add regression tests to cover direct ".VF." and multi-digit VF tags (e.g., ".VF3", ".VF4") by extending TestDetectNstLangue: add a test that asserts NST._detect_nst_langue({"name": "Movie.2026.VF.1080p.WEB.H264-GRP"}) == "VF" and tests that ".VF3" and ".VF4" (e.g., "Movie.2026.VF3.1080p..." and "Movie.2026.VF4.1080p...") also return "VF"; mirror the style of existing tests (use NST._detect_nst_langue and, if desired, an async check via NST.get_additional_data) so edge cases for single-token VF and VF3+ are covered. ``` </details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Path: .coderabbit.yaml **Review profile**: CHILL **Plan**: Pro **Run ID**: `efb015c9-7087-46f8-a70f-78851f35f93c` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between d0584a2652383426a14b80380562acaef3bf087e and eaec6456e5c089bd817183f45299ea8640c666c6. </details> <details> <summary>📒 Files selected for processing (2)</summary> * `src/trackers/NST.py` * `tests/test_nst.py` </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
@ -368,42 +368,50 @@ class NST(FrenchTrackerMixin, UNIT3D):
coderabbitai[bot] (Migrated from github.com) commented 2026-03-22 23:14:32 +00:00

⚠️ Potential issue | 🟠 Major

Handle .VF. and VF{n} markers, not only VF2.

Line [392] currently normalizes only VF2. Names containing .VF. or .VF3/.VF4 can fall through to "", producing an invalid/empty langue despite being French-dub variants.

🐛 Proposed fix
-        # VF2 (dual VFF+VFQ) → generic VF
-        if ".VF2." in upper or upper.endswith(".VF2"):
+        # Generic VF markers (VF, VF2, VF3, ...)
+        if re.search(r"(?:^|[._-])VF(?:\d+)?(?:[._-]|$)", upper):
             return "VF"
Based on learnings: `FrenchTrackerMixin._get_french_dub_suffix` intentionally allows `VF{n}` (e.g., `VF3`, `VF4`).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/trackers/NST.py` around lines 391 - 393, The current normalization only
maps ".VF2." to "VF" and misses other French-dub markers; update the logic in
NST.py inside the FrenchTrackerMixin._get_french_dub_suffix (or the nearby VF
handling block) to detect any ".VF" marker with optional digits and either a
following dot or end-of-string (e.g., ".VF.", ".VF3.", ".VF4", or ending ".VF3")
and return "VF". Replace the specific check for ".VF2."/endswith(".VF2") with a
pattern-based check (or equivalent string checks) that covers ".VF", ".VF{n}"
and trailing forms so VF, VF3, VF4 variants normalize to "VF".

Addressed in commit 3d421a7

_⚠️ Potential issue_ | _🟠 Major_ **Handle `.VF.` and `VF{n}` markers, not only `VF2`.** Line [392] currently normalizes only `VF2`. Names containing `.VF.` or `.VF3/.VF4` can fall through to `""`, producing an invalid/empty `langue` despite being French-dub variants. <details> <summary>🐛 Proposed fix</summary> ```diff - # VF2 (dual VFF+VFQ) → generic VF - if ".VF2." in upper or upper.endswith(".VF2"): + # Generic VF markers (VF, VF2, VF3, ...) + if re.search(r"(?:^|[._-])VF(?:\d+)?(?:[._-]|$)", upper): return "VF" ``` </details> Based on learnings: `FrenchTrackerMixin._get_french_dub_suffix` intentionally allows `VF{n}` (e.g., `VF3`, `VF4`). <details> <summary>🤖 Prompt for AI Agents</summary> ``` Verify each finding against the current code and only fix it if needed. In `@src/trackers/NST.py` around lines 391 - 393, The current normalization only maps ".VF2." to "VF" and misses other French-dub markers; update the logic in NST.py inside the FrenchTrackerMixin._get_french_dub_suffix (or the nearby VF handling block) to detect any ".VF" marker with optional digits and either a following dot or end-of-string (e.g., ".VF.", ".VF3.", ".VF4", or ending ".VF3") and return "VF". Replace the specific check for ".VF2."/endswith(".VF2") with a pattern-based check (or equivalent string checks) that covers ".VF", ".VF{n}" and trailing forms so VF, VF3, VF4 variants normalize to "VF". ``` </details> <!-- fingerprinting:phantom:poseidon:hawk --> <!-- This is an auto-generated comment by CodeRabbit --> ✅ Addressed in commit 3d421a7
coderabbitai[bot] (Migrated from github.com) approved these changes 2026-03-22 23:24:06 +00:00
Sign in to join this conversation.
No description provided.