Music Player: keep the playlist after a page reload

オープン
#127 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Ziqian-Huang0607 がすでに取り組んでいます。

2026年11月25日 から。

評価

この issue はまだ評価されていません。

説明

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

主要言語
JavaScript
スター
16
フォーク
8
平均マージ
4時間 24分
マージ済み PR(30日)
10

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

codehubbers/OrbitOS のほかの issue

codehubbers/OrbitOS の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。