merge: incorporate main's safearea/auto-order/vacaciones fixes
This commit is contained in:
@@ -6,7 +6,6 @@ import 'package:audio_service/audio_service.dart';
|
||||
import 'package:flutter/foundation.dart' show visibleForTesting;
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
||||
import '../estado/orden_emisoras.dart';
|
||||
import '../modelos/emisora.dart';
|
||||
import '../modelos/grupo_favoritos.dart';
|
||||
import '../modelos/pista_local.dart';
|
||||
@@ -350,15 +349,23 @@ class ConstructorArbolAuto {
|
||||
extras: _contentStyleLista,
|
||||
);
|
||||
|
||||
/// Leaf items for [parentId], sorted via [ordenarEmisoras] and capped at
|
||||
/// [_maxItemsPorCarpeta] (Design "which stations surface & ordering" —
|
||||
/// avoids driver distraction and Auto list limits). Unknown [parentId]
|
||||
/// (or an empty [emisoras]) returns an empty list instead of throwing.
|
||||
/// Leaf items for [parentId], PRESERVING the incoming [emisoras] order and
|
||||
/// capped at [_maxItemsPorCarpeta] (Design "which stations surface &
|
||||
/// ordering" — avoids driver distraction and Auto list limits).
|
||||
///
|
||||
/// Fix `android-auto-orden`: this used to force
|
||||
/// `ordenarEmisoras(emisoras, OrdenEmisoras.calidad)` unconditionally,
|
||||
/// silently discarding whatever order the caller actually wanted —
|
||||
/// Favoritos' manual drag-reorder order, or the global `ordenListas`
|
||||
/// setting for Todas/Mis emisoras. Every caller (`EstadoRadio.
|
||||
/// cargarFavoritos`/`cargarPopulares`/`_cargarEmisorasCustom`/
|
||||
/// `cambiarOrdenListas`) now pushes an already-ordered snapshot, so this
|
||||
/// only slices and maps — it must never re-sort. Unknown [parentId] (or
|
||||
/// an empty [emisoras]) returns an empty list instead of throwing.
|
||||
List<MediaItem> hijos(String parentId, {required List<Emisora> emisoras}) {
|
||||
if (!_idsCarpetas.contains(parentId)) return const [];
|
||||
if (emisoras.isEmpty) return const [];
|
||||
final ordenadas = ordenarEmisoras(emisoras, OrdenEmisoras.calidad);
|
||||
return ordenadas.take(_maxItemsPorCarpeta).map(itemEmisora).toList();
|
||||
return emisoras.take(_maxItemsPorCarpeta).map(itemEmisora).toList();
|
||||
}
|
||||
|
||||
/// Maps a single [Emisora] to a playable `MediaItem`: id `emisora:<uuid>`
|
||||
@@ -824,10 +831,12 @@ class ConstructorArbolAuto {
|
||||
}
|
||||
|
||||
/// Members of the favorite group identified by [grupoMediaId] (a
|
||||
/// `grupo:<id>` id), sorted and capped like every other folder (Spec "Car
|
||||
/// requests a group folder's stations"). An unknown/stale/malformed id
|
||||
/// returns an empty list instead of throwing (Spec "Car requests an
|
||||
/// unknown or stale group id").
|
||||
/// `grupo:<id>` id), PRESERVING the incoming [favoritos] order (Favoritos'
|
||||
/// manual order — see [hijos]' doc, fix `android-auto-orden`) and capped
|
||||
/// like every other folder (Spec "Car requests a group folder's
|
||||
/// stations"). An unknown/stale/malformed id returns an empty list
|
||||
/// instead of throwing (Spec "Car requests an unknown or stale group
|
||||
/// id").
|
||||
List<MediaItem> hijosGrupo(
|
||||
String grupoMediaId, {
|
||||
required List<Emisora> favoritos,
|
||||
@@ -837,8 +846,7 @@ class ConstructorArbolAuto {
|
||||
if (id.isEmpty) return const [];
|
||||
final miembros = favoritos.where((e) => e.grupoFavoritosId == id).toList();
|
||||
if (miembros.isEmpty) return const [];
|
||||
final ordenados = ordenarEmisoras(miembros, OrdenEmisoras.calidad);
|
||||
return ordenados.take(_maxItemsPorCarpeta).map(itemEmisora).toList();
|
||||
return miembros.take(_maxItemsPorCarpeta).map(itemEmisora).toList();
|
||||
}
|
||||
|
||||
/// Equalizer preset-selection media-id prefix (decision
|
||||
|
||||
Reference in New Issue
Block a user