mirror of
https://github.com/kilyabin/psysonic.git
synced 2026-07-22 06:25:41 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user