2021-03-06 19:09:19 +01:00
|
|
|
import '../repositories/audio_player_repository.dart';
|
|
|
|
import '../repositories/platform_integration_repository.dart';
|
|
|
|
|
|
|
|
class MoveQueueItem {
|
|
|
|
MoveQueueItem(
|
|
|
|
this._audioPlayerRepository,
|
|
|
|
this._platformIntegrationRepository,
|
|
|
|
);
|
|
|
|
|
|
|
|
final AudioPlayerRepository _audioPlayerRepository;
|
|
|
|
final PlatformIntegrationRepository _platformIntegrationRepository;
|
|
|
|
|
|
|
|
Future<void> call(int oldIndex, int newIndex) async {
|
|
|
|
await _audioPlayerRepository.moveQueueItem(oldIndex, newIndex);
|
|
|
|
|
2021-05-09 21:38:34 +02:00
|
|
|
final songList = _audioPlayerRepository.queueStream.valueWrapper.value;
|
2021-03-06 19:09:19 +01:00
|
|
|
_platformIntegrationRepository.setQueue(songList);
|
|
|
|
}
|
|
|
|
}
|