Files
iptvnator/apps/electron-backend
4gray d9cbb1ce87 refactor(player,epg): add MPV reuse, IPC commands, and EPG handlers
Introduce MPV process reuse and IPC control, and add basic EPG IPC
handlers.

- Add GET_CHANNEL_PROGRAMS and FETCH_EPG ipc handlers to epg.events.ts
  to expose fetching EPG data by channel or URLs.
- Rework player.events.ts:
  - Export proper bootstrap and add module-level mpvProcess and
    mpvSocketPath to track a reusable MPV instance.
  - Add sendMpvCommand helper to communicate with MPV via its IPC socket.
  - Implement OPEN_MPV_PLAYER handler that:
    - Reads MPV path and MPV_REUSE_INSTANCE setting from store.
    - Attempts to reuse an existing MPV process by sending loadfile
      command over the socket when reuse is enabled.
    - Falls back to spawning a new mpv process, creating a unique IPC
      socket path, and storing the process/socket when reuse is enabled.
    - Adds error and exit handlers to clear stored references.
  - Add necessary imports (ChildProcess, existsSync, createConnection).
  - Remove/comment unused import block for shared-interfaces and adapt
    existing code to the new flow.

Why:
- Enable reusing a single MPV instance to improve resource usage and
  provide faster playback switching.
- Add IPC endpoints for EPG to support frontend requests for program
  data.
2025-10-18 11:53:57 +02:00
..
2025-10-07 18:02:13 +02:00
2025-10-07 18:02:13 +02:00
2025-10-07 18:02:13 +02:00