RhythmBox/lib/services/server/sourced_track.dart
2024-08-27 01:49:05 +08:00

18 lines
549 B
Dart
Executable File

import 'package:get/get.dart';
import 'package:rhythm_box/services/audio_player/audio_player.dart';
import 'package:rhythm_box/services/local_track.dart';
import 'package:rhythm_box/services/sourced_track/sourced_track.dart';
class SourcedTrackProvider extends GetxController {
Future<SourcedTrack?> fetch(RhythmMedia? media) async {
final track = media?.track;
if (track == null || track is LocalTrack) {
return null;
}
final sourcedTrack = await SourcedTrack.fetchFromTrack(track: track);
return sourcedTrack;
}
}