// Minimal .pls parser. SomaFM publishes channels as .pls playlist
// files, e.g.:
//   [playlist]
//   numberofentries=4
//   File1=https://ice1.somafm.com/groovesalad-128-mp3
//   Title1=SomaFM: Groove Salad ...
//   ...
// We extract the FileN entries in order; first one is the preferred
// stream. .m3u parser deferred to Tier 2.

export function parsePls(text) {
  const lines = text.split(/\r?\n/);
  const streams = [];
  for (const line of lines) {
    const m = line.match(/^File\d+=(.+)$/i);
    if (m) streams.push(m[1].trim());
  }
  return streams;
}
