mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-08-03 01:28:37 +02:00
16 lines
627 B
Dart
16 lines
627 B
Dart
enum QualityVariantMenuAction { downloadAnotherQuality, playLocal }
|
|
|
|
/// Resolves the quality-variant entry shown in a remote track's options menu.
|
|
///
|
|
/// When tapping an already-local track is repurposed to download another
|
|
/// quality, the menu becomes the escape hatch for playing that local copy.
|
|
QualityVariantMenuAction? resolveQualityVariantMenuAction({
|
|
required bool allowQualityVariants,
|
|
required bool hasLocalPlaybackCandidate,
|
|
}) {
|
|
if (!allowQualityVariants) return null;
|
|
return hasLocalPlaybackCandidate
|
|
? QualityVariantMenuAction.playLocal
|
|
: QualityVariantMenuAction.downloadAnotherQuality;
|
|
}
|