Potential fixes for 2 code quality findings#32
Conversation
…a/repository/LyricsRepositoryImpl.kt from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Signed-off-by: Dае Еuнша <daedaevibin@ik.me>
…a/repository/LyricsRepositoryImpl.kt from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Signed-off-by: Dае Еuнша <daedaevibin@ik.me>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/src/main/java/com/theveloper/pixelplay/data/repository/LyricsRepositoryImpl.kt (1)
1686-1693:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winComment is accurate but reveals separator handling inconsistency.
The comment correctly identifies
\uFF0Das the fullwidth hyphen-minus, but there's an inconsistency in how it's handled:
- Line 1687 strips
\uFF0Dfrom the beginning of titles- Line 1692's
splitRegexsplits on ASCII-but not on\uFF0D- Meanwhile,
TITLE_SEPARATOR_REGEX(line 138) and the aggressive fallback (line 537) both treat\uFF0Das a separatorExample: A title like
"Song1-Remix"(with fullwidth hyphen in the middle) won't be split/truncated at the fullwidth hyphen, but"Song1-Remix"(ASCII hyphen) would be split to"Song1".This inconsistency could affect search matching for CJK titles that use fullwidth punctuation.
🔧 Suggested fix
Add
\uFF0Dto thesplitRegexon line 1692 to align with other separator handling:- val splitRegex = Regex("""[-\(\[\{\uFF08\uFF3B\uFF5B\u3010\u300E\u300C\u3014\u3008\u300A]""") + val splitRegex = Regex("""[-\uFF0D\(\[\{\uFF08\uFF3B\uFF5B\u3010\u300E\u300C\u3014\u3008\u300A]""")🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/src/main/java/com/theveloper/pixelplay/data/repository/LyricsRepositoryImpl.kt` around lines 1686 - 1693, The split/truncate logic in LyricsRepositoryImpl.kt is inconsistent: the leading-strip regex includes the fullwidth hyphen \uFF0D but the splitRegex used to truncate (variable splitRegex) does not, causing titles like "Song1-Remix" to not be split; update the splitRegex (the Regex assigned to variable splitRegex near the truncation code) to include \uFF0D in its character class so it matches fullwidth hyphens the same way as TITLE_SEPARATOR_REGEX and the aggressive fallback.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In
`@app/src/main/java/com/theveloper/pixelplay/data/repository/LyricsRepositoryImpl.kt`:
- Around line 1686-1693: The split/truncate logic in LyricsRepositoryImpl.kt is
inconsistent: the leading-strip regex includes the fullwidth hyphen \uFF0D but
the splitRegex used to truncate (variable splitRegex) does not, causing titles
like "Song1-Remix" to not be split; update the splitRegex (the Regex assigned to
variable splitRegex near the truncation code) to include \uFF0D in its character
class so it matches fullwidth hyphens the same way as TITLE_SEPARATOR_REGEX and
the aggressive fallback.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: e3a96395-776d-4fd5-a42b-4ca650f65fc9
📒 Files selected for processing (1)
app/src/main/java/com/theveloper/pixelplay/data/repository/LyricsRepositoryImpl.kt
This PR applies 2/2 suggestions from code quality AI findings.
Summary by CodeRabbit
Note: This release contains no user-facing changes.