mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00

* feat: add connect server support * feat: add ability discover and connect to same network Spotube(s) and sync queue * feat(connect): add player controls, shuffle, loop, progress bar and queue support * feat: make control page adaptive * feat: add volume control support * cd: upgrade macos runner version * chore: upgrade inappwebview version to 6 * feat: customized devices button * feat: add user icon next to devices button * feat: add play in remote device support * feat: show alert when new client connects * fix: ignore the device itself from broadcast list * fix: volume control not working * feat: add ability to select current device's output speaker
28 lines
867 B
Dart
28 lines
867 B
Dart
part of 'connect.dart';
|
|
|
|
List<Map<String, dynamic>> _tracksJson(List<Track> tracks) {
|
|
return tracks.map((e) => e.toJson()).toList();
|
|
}
|
|
|
|
@freezed
|
|
class WebSocketLoadEventData with _$WebSocketLoadEventData {
|
|
factory WebSocketLoadEventData({
|
|
@JsonKey(name: 'tracks', toJson: _tracksJson) required List<Track> tracks,
|
|
String? collectionId,
|
|
int? initialIndex,
|
|
}) = _WebSocketLoadEventData;
|
|
|
|
factory WebSocketLoadEventData.fromJson(Map<String, dynamic> json) =>
|
|
_$WebSocketLoadEventDataFromJson(json);
|
|
}
|
|
|
|
class WebSocketLoadEvent extends WebSocketEvent<WebSocketLoadEventData> {
|
|
WebSocketLoadEvent(WebSocketLoadEventData data) : super(WsEvent.load, data);
|
|
|
|
factory WebSocketLoadEvent.fromJson(Map<String, dynamic> json) {
|
|
return WebSocketLoadEvent(
|
|
WebSocketLoadEventData.fromJson(json['data'] as Map<String, dynamic>),
|
|
);
|
|
}
|
|
}
|