Array of track data with skip statistics
Boolean indicating success or failure
export function saveSkippedTracks(tracks: SkippedTrack[]): boolean {
try {
// Create directory if it doesn't exist
if (!fs.existsSync(path.dirname(skippedTracksFilePath))) {
fs.mkdirSync(path.dirname(skippedTracksFilePath), { recursive: true });
}
fs.writeFileSync(
skippedTracksFilePath,
JSON.stringify(tracks, null, 2),
"utf-8",
);
console.log(
`Saved ${tracks.length} skipped tracks to:`,
skippedTracksFilePath,
);
return true;
} catch (error) {
console.error("Failed to save skipped tracks:", error);
return false;
}
}
Persists skipped tracks data to storage