Music Player: keep the playlist after a page reload

Abierto
#127 0 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@Ziqian-Huang0607 ya está trabajando en esto.

Desde el 25/11/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

backend difficulty: medium frontend

New here? Say hi on Discord first, it's the fastest way to get help: https://discord.gg/NW2YZACf4k

The Music Player (#120) keeps its playlist only in React state, so a reload clears it and you have to add tracks again from My Files.

Expected

  • The playlist, the current track and the volume survive a reload.
  • Shuffle and repeat settings survive too.

Suggested approach

  • Store { trackIds, currentIndex, volume, shuffle, repeat } in the user's preferences, using the same PUT /api/users/preferences the Weather app uses. Add a music field to the preferences in src/models/User.js.
  • Save only file ids (file-<id>). Don't save the URL or any content, and rebuild the track list from GET /api/files?meta=1 on load.
  • Skip ids that no longer exist, for example a deleted file.
  • Debounce saves, at most once every couple of seconds, so dragging the volume slider doesn't spam the API.

Where: src/context/MusicContext.js and src/models/User.js.

Done when

  • Reloading keeps the playlist and settings.
  • A deleted file is dropped quietly.
  • Tests cover the restore and deleted-file cases.

Comment "I'd like to take this" and we'll assign you. Questions are welcome in Discord: https://discord.gg/NW2YZACf4k

Lenguaje dominante
JavaScript
Estrellas
16
Forks
8
Merge medio
4 h 24 min
PR fusionados (30 d)
10

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de codehubbers/OrbitOS

Todos los issues de codehubbers/OrbitOS

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.