Skip to content

馃悰 Set SID when playback starts

sorc278 requested to merge sorc278/karaokemugen-app:i1532 into next

Closes #1532 (closed) Check the second commit for clearer diff.

  • Moves Player to separate file.
  • Gives play different code path so that additional behavior can be added without additional ifs/flags, and to abstract a bit more by pushing more concrete code to classes closer to MPV.
  • Creates playback-time observable to allow more flexible use of it and clearer references.
  • On play, each player creates short lived subscription. On first non-zero playback time player sets SID and terminates that subscription. Should be durable against any possible future mpv fixes.
  • Updated existing player code related to playback-time to listen to observable too.
  • Updated player logger to automatically add service and player type to log messages.
  • Fixed another minor bug in mpv.ts: sid 'none' does exist, use 'no' instead.

Adds RxJS as dependency for observables. Also adds Vitest for unit testing. At first tried using existing Mocha which seemed to work (but would need Sinon for mocks), then tried Vitest, then tried Mocha again and had issues making it work the second time, reverted to Vitest. It currently needs a bit older esbuild so adds more dependencies until that is upgraded. Did not add unit testing to any CI files.

Edited by sorc278

Merge request reports