fix(csv-import): guard s.isrc type before toUpperCase, restore public toggle, move @types to devDeps

- s.isrc from Subsonic API may be non-string at runtime; add typeof guard
  to prevent TypeError crashing all 80 search calls into "network errors"
- Restore isPublic toggle in PlaylistEditModal footer (accidentally removed
  in PR #190); keep new Cancel button alongside it
- Move @types/papaparse from dependencies to devDependencies

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Psychotoxical
2026-04-15 18:21:23 +02:00
parent 2384b73908
commit fce8dc3208
+1 -2
View File
@@ -766,7 +766,7 @@ export default function PlaylistDetail() {
const scoredMatches = searchResult.songs.map(s => {
// Fast ISRC path: if both have ISRC and they match, perfect score
if (track.isrc && s.isrc && track.isrc.toUpperCase() === s.isrc.toUpperCase()) {
if (track.isrc && s.isrc && typeof s.isrc === 'string' && track.isrc.toUpperCase() === s.isrc.toUpperCase()) {
return { song: s, score: 1.0, titleScore: 1.0, artistScore: 1.0, isrcMatch: true };
}
@@ -822,7 +822,6 @@ export default function PlaylistDetail() {
existingIds.add(bestMatch.song.id);
return bestMatch.song;
} catch {
// Network error/timeout - distinguish from "not found"
searchErrors.push(track);
return null;
}