@torrent-tv/proxy 2.13.0 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -334,6 +334,20 @@ export function createPlaybackPlanner({
334
334
  * @param {{ sourceKey: string, fileIndex: number }} params
335
335
  * @returns {{ durationSeconds: number | null, width: number | null, height: number | null, fps: number | null, startTime: number, isHdr: boolean } | null}
336
336
  */
337
+ /**
338
+ * The audio tracks this file was probed to have, or an empty list. The
339
+ * master playlist publishes one rendition per track, and the inventory is
340
+ * already here — probing again for it would be a second scan of a file the
341
+ * proxy is in the middle of serving.
342
+ *
343
+ * @param {{ sourceKey: string, fileIndex: number }} params
344
+ * @returns {object[]}
345
+ */
346
+ getCachedAudioTracks({ sourceKey, fileIndex }) {
347
+ const plan = cache.get(`${sourceKey}:${fileIndex}`);
348
+ return Array.isArray(plan?.audioTracks) ? plan.audioTracks : [];
349
+ },
350
+
337
351
  getCachedMediaInfo({ sourceKey, fileIndex }) {
338
352
  return mediaInfoCache.get(`${sourceKey}:${fileIndex}`) ?? null;
339
353
  },