react-native-audio-browser 0.2.0-next.53 → 0.2.0-next.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (599) hide show
  1. package/README.md +32 -19
  2. package/android/src/cast/java/com/audiobrowser/cast/CastSupport.kt +8 -10
  3. package/android/src/main/java/com/audiobrowser/AudioBrowser.kt +96 -243
  4. package/android/src/main/java/com/audiobrowser/AudioBrowserLifecycleModule.kt +8 -12
  5. package/android/src/main/java/com/audiobrowser/AudioBrowserPackage.kt +1 -3
  6. package/android/src/main/java/com/audiobrowser/Callbacks.kt +1 -10
  7. package/android/src/main/java/com/audiobrowser/ForegroundStart.kt +13 -18
  8. package/android/src/main/java/com/audiobrowser/HeadlessTaskService.kt +3 -7
  9. package/android/src/main/java/com/audiobrowser/RemoteOutputs.kt +8 -10
  10. package/android/src/main/java/com/audiobrowser/Service.kt +20 -61
  11. package/android/src/main/java/com/audiobrowser/ServiceBinding.kt +9 -17
  12. package/android/src/main/java/com/audiobrowser/browser/ArtworkResolutionRegistry.kt +10 -9
  13. package/android/src/main/java/com/audiobrowser/browser/BrowseArtworkRegistry.kt +11 -8
  14. package/android/src/main/java/com/audiobrowser/browser/BrowserManager.kt +117 -448
  15. package/android/src/main/java/com/audiobrowser/browser/BrowserUrlResolution.kt +21 -60
  16. package/android/src/main/java/com/audiobrowser/browser/InertStyleDiagnostic.kt +20 -80
  17. package/android/src/main/java/com/audiobrowser/browser/JsonArtwork.kt +6 -10
  18. package/android/src/main/java/com/audiobrowser/browser/JsonModels.kt +7 -24
  19. package/android/src/main/java/com/audiobrowser/browser/RouteMatch.kt +2 -4
  20. package/android/src/main/java/com/audiobrowser/browser/SectionScope.kt +13 -31
  21. package/android/src/main/java/com/audiobrowser/browser/SimpleRouter.kt +12 -40
  22. package/android/src/main/java/com/audiobrowser/browser/StyleResolver.kt +15 -26
  23. package/android/src/main/java/com/audiobrowser/browser/TrackLoadHandler.kt +5 -15
  24. package/android/src/main/java/com/audiobrowser/extension/EnumExtensions.kt +1 -0
  25. package/android/src/main/java/com/audiobrowser/extension/NumberExt.kt +2 -0
  26. package/android/src/main/java/com/audiobrowser/extension/ResolvedTrackExt.kt +4 -8
  27. package/android/src/main/java/com/audiobrowser/extension/TappedTrack.kt +4 -6
  28. package/android/src/main/java/com/audiobrowser/extension/TrackIdentity.kt +3 -7
  29. package/android/src/main/java/com/audiobrowser/http/HttpClient.kt +13 -22
  30. package/android/src/main/java/com/audiobrowser/http/RequestConfigBuilder.kt +17 -38
  31. package/android/src/main/java/com/audiobrowser/model/IcyTitle.kt +5 -6
  32. package/android/src/main/java/com/audiobrowser/model/PlaybackMetadata.kt +4 -9
  33. package/android/src/main/java/com/audiobrowser/model/PlayerSetupOptions.kt +18 -29
  34. package/android/src/main/java/com/audiobrowser/model/PlayerUpdateOptions.kt +6 -16
  35. package/android/src/main/java/com/audiobrowser/player/AutomaticBufferManager.kt +15 -45
  36. package/android/src/main/java/com/audiobrowser/player/CapabilityControls.kt +23 -59
  37. package/android/src/main/java/com/audiobrowser/player/CrossOriginHeaderStripper.kt +14 -26
  38. package/android/src/main/java/com/audiobrowser/player/DynamicLoadControl.kt +15 -43
  39. package/android/src/main/java/com/audiobrowser/player/EnginePlayback.kt +4 -4
  40. package/android/src/main/java/com/audiobrowser/player/EqualizerController.kt +15 -21
  41. package/android/src/main/java/com/audiobrowser/player/InterceptingPlayer.kt +14 -31
  42. package/android/src/main/java/com/audiobrowser/player/LocalEngine.kt +8 -8
  43. package/android/src/main/java/com/audiobrowser/player/MediaFactory.kt +16 -27
  44. package/android/src/main/java/com/audiobrowser/player/MediaSessionCallback.kt +119 -237
  45. package/android/src/main/java/com/audiobrowser/player/MediaSessionCommandManager.kt +48 -145
  46. package/android/src/main/java/com/audiobrowser/player/NowPlayingUpdater.kt +39 -100
  47. package/android/src/main/java/com/audiobrowser/player/PlaybackErrorClassifier.kt +16 -26
  48. package/android/src/main/java/com/audiobrowser/player/PlaybackStateMachine.kt +22 -28
  49. package/android/src/main/java/com/audiobrowser/player/PlaybackStateStore.kt +28 -64
  50. package/android/src/main/java/com/audiobrowser/player/PlaybackTimer.kt +8 -4
  51. package/android/src/main/java/com/audiobrowser/player/Player.kt +117 -405
  52. package/android/src/main/java/com/audiobrowser/player/PlayerCapabilitiesExt.kt +1 -1
  53. package/android/src/main/java/com/audiobrowser/player/PlayerEngineFactory.kt +11 -19
  54. package/android/src/main/java/com/audiobrowser/player/PlayerListener.kt +30 -96
  55. package/android/src/main/java/com/audiobrowser/player/RetryLoadErrorHandlingPolicy.kt +39 -95
  56. package/android/src/main/java/com/audiobrowser/player/ShuffleOrderLedBy.kt +7 -13
  57. package/android/src/main/java/com/audiobrowser/player/SleepTimer.kt +13 -30
  58. package/android/src/main/java/com/audiobrowser/player/SleepTimerManager.kt +7 -11
  59. package/android/src/main/java/com/audiobrowser/player/StuckRecoveryPolicy.kt +9 -22
  60. package/android/src/main/java/com/audiobrowser/player/TransformingDataSource.kt +22 -54
  61. package/android/src/main/java/com/audiobrowser/player/VolumeFader.kt +8 -15
  62. package/android/src/main/java/com/audiobrowser/remote/RemoteItem.kt +9 -8
  63. package/android/src/main/java/com/audiobrowser/remote/RemoteOutputsController.kt +13 -10
  64. package/android/src/main/java/com/audiobrowser/remote/RemotePlayback.kt +8 -8
  65. package/android/src/main/java/com/audiobrowser/remote/RemoteQueue.kt +12 -5
  66. package/android/src/main/java/com/audiobrowser/remote/RemoteSwitchingPlayer.kt +28 -48
  67. package/android/src/main/java/com/audiobrowser/sonos/DeviceDescriptionParser.kt +11 -19
  68. package/android/src/main/java/com/audiobrowser/sonos/DidlLite.kt +2 -2
  69. package/android/src/main/java/com/audiobrowser/sonos/SoapClient.kt +6 -6
  70. package/android/src/main/java/com/audiobrowser/sonos/SoapEnvelopes.kt +8 -9
  71. package/android/src/main/java/com/audiobrowser/sonos/SoapResponseParser.kt +11 -18
  72. package/android/src/main/java/com/audiobrowser/sonos/SonosDiscoverer.kt +10 -10
  73. package/android/src/main/java/com/audiobrowser/sonos/SonosOutputs.kt +10 -10
  74. package/android/src/main/java/com/audiobrowser/sonos/SonosPlayer.kt +21 -33
  75. package/android/src/main/java/com/audiobrowser/sonos/SonosRemote.kt +4 -6
  76. package/android/src/main/java/com/audiobrowser/sonos/SonosRouteProviderService.kt +9 -10
  77. package/android/src/main/java/com/audiobrowser/sonos/SonosStreamUri.kt +7 -7
  78. package/android/src/main/java/com/audiobrowser/sonos/SonosTransport.kt +5 -4
  79. package/android/src/main/java/com/audiobrowser/sonos/SsdpDiscovery.kt +8 -3
  80. package/android/src/main/java/com/audiobrowser/sonos/SsdpMessages.kt +4 -6
  81. package/android/src/main/java/com/audiobrowser/sonos/ZoneGroupState.kt +13 -11
  82. package/android/src/main/java/com/audiobrowser/tls/AiaCertChaser.kt +34 -71
  83. package/android/src/main/java/com/audiobrowser/tls/AiaChasingExtendedTrustManager.kt +20 -37
  84. package/android/src/main/java/com/audiobrowser/tls/AiaChasingTrustManager.kt +18 -27
  85. package/android/src/main/java/com/audiobrowser/tls/AiaTls.kt +14 -29
  86. package/android/src/main/java/com/audiobrowser/tls/CachingCertificateFetcher.kt +68 -133
  87. package/android/src/main/java/com/audiobrowser/util/ArtworkContentProvider.kt +10 -22
  88. package/android/src/main/java/com/audiobrowser/util/ArtworkRoutes.kt +6 -6
  89. package/android/src/main/java/com/audiobrowser/util/ArtworkUris.kt +4 -3
  90. package/android/src/main/java/com/audiobrowser/util/ArtworkVariant.kt +2 -13
  91. package/android/src/main/java/com/audiobrowser/util/Automotive.kt +2 -4
  92. package/android/src/main/java/com/audiobrowser/util/BatteryOptimizationHelper.kt +3 -9
  93. package/android/src/main/java/com/audiobrowser/util/BatteryWarningStore.kt +4 -14
  94. package/android/src/main/java/com/audiobrowser/util/BrowserPathHelper.kt +21 -85
  95. package/android/src/main/java/com/audiobrowser/util/CoilArtworkLoader.kt +7 -7
  96. package/android/src/main/java/com/audiobrowser/util/CoilArtworkLoaderHolder.kt +5 -8
  97. package/android/src/main/java/com/audiobrowser/util/CoilBitmapLoader.kt +8 -24
  98. package/android/src/main/java/com/audiobrowser/util/EqualizerManager.kt +7 -39
  99. package/android/src/main/java/com/audiobrowser/util/MediaExtrasBuilder.kt +10 -14
  100. package/android/src/main/java/com/audiobrowser/util/MetadataAdapter.kt +5 -9
  101. package/android/src/main/java/com/audiobrowser/util/NetworkConnectivityMonitor.kt +5 -9
  102. package/android/src/main/java/com/audiobrowser/util/OutputMonitor.kt +21 -50
  103. package/android/src/main/java/com/audiobrowser/util/OutputSwitcher.kt +7 -20
  104. package/android/src/main/java/com/audiobrowser/util/PlayingStateFactory.kt +3 -5
  105. package/android/src/main/java/com/audiobrowser/util/RatingFavorites.kt +4 -5
  106. package/android/src/main/java/com/audiobrowser/util/StyleWire.kt +5 -5
  107. package/android/src/main/java/com/audiobrowser/util/SvgArtworkRenderer.kt +5 -9
  108. package/android/src/main/java/com/audiobrowser/util/SystemVolumeMonitor.kt +6 -9
  109. package/android/src/main/java/com/audiobrowser/util/TrackFactory.kt +25 -47
  110. package/android/src/nocast/java/com/audiobrowser/cast/CastSupport.kt +0 -2
  111. package/android/src/test/java/com/audiobrowser/ForegroundStartTest.kt +1 -2
  112. package/android/src/test/java/com/audiobrowser/LegacyRatingTest.kt +3 -3
  113. package/android/src/test/java/com/audiobrowser/ServiceBindingTest.kt +0 -13
  114. package/android/src/test/java/com/audiobrowser/ServiceTaskRemovedTest.kt +2 -3
  115. package/android/src/test/java/com/audiobrowser/TestFixtures.kt +5 -14
  116. package/android/src/test/java/com/audiobrowser/browser/BrowseArtworkRegistryTest.kt +1 -1
  117. package/android/src/test/java/com/audiobrowser/browser/BrowserManagerBuildApiRequestTest.kt +2 -8
  118. package/android/src/test/java/com/audiobrowser/browser/BrowserManagerFavoritesTest.kt +2 -12
  119. package/android/src/test/java/com/audiobrowser/browser/BrowserManagerLayerResolutionTest.kt +5 -28
  120. package/android/src/test/java/com/audiobrowser/browser/BrowserManagerTest.kt +11 -43
  121. package/android/src/test/java/com/audiobrowser/browser/BrowserUrlResolutionTest.kt +4 -13
  122. package/android/src/test/java/com/audiobrowser/browser/InertStyleDiagnosticTest.kt +2 -11
  123. package/android/src/test/java/com/audiobrowser/browser/JsonArtworkTest.kt +0 -2
  124. package/android/src/test/java/com/audiobrowser/browser/JsonStyleTest.kt +3 -8
  125. package/android/src/test/java/com/audiobrowser/browser/SectionScopeTest.kt +2 -14
  126. package/android/src/test/java/com/audiobrowser/browser/SimpleRouterTest.kt +1 -5
  127. package/android/src/test/java/com/audiobrowser/browser/StyleResolverTest.kt +2 -13
  128. package/android/src/test/java/com/audiobrowser/extension/TappedTrackTest.kt +1 -7
  129. package/android/src/test/java/com/audiobrowser/extension/TrackIdentityTest.kt +0 -5
  130. package/android/src/test/java/com/audiobrowser/http/RequestConfigBuilderTest.kt +8 -16
  131. package/android/src/test/java/com/audiobrowser/model/IcyTitleTest.kt +1 -1
  132. package/android/src/test/java/com/audiobrowser/player/BrowseTilesTest.kt +12 -29
  133. package/android/src/test/java/com/audiobrowser/player/CapabilityControlsTest.kt +3 -12
  134. package/android/src/test/java/com/audiobrowser/player/CrossOriginHeaderStripperTest.kt +0 -7
  135. package/android/src/test/java/com/audiobrowser/player/DynamicLoadControlTest.kt +0 -1
  136. package/android/src/test/java/com/audiobrowser/player/EqualizerControllerTest.kt +0 -9
  137. package/android/src/test/java/com/audiobrowser/player/LiveSeekCommandTest.kt +1 -2
  138. package/android/src/test/java/com/audiobrowser/player/MediaSessionSlotMappingTest.kt +0 -9
  139. package/android/src/test/java/com/audiobrowser/player/NowPlayingUpdaterTest.kt +15 -22
  140. package/android/src/test/java/com/audiobrowser/player/PlaybackErrorClassifierTest.kt +1 -24
  141. package/android/src/test/java/com/audiobrowser/player/PlaybackStateMachineTest.kt +0 -20
  142. package/android/src/test/java/com/audiobrowser/player/PlaybackStateStoreTrackJsonTest.kt +1 -6
  143. package/android/src/test/java/com/audiobrowser/player/PlaybackTimerTest.kt +2 -4
  144. package/android/src/test/java/com/audiobrowser/player/PlayerCastTest.kt +2 -2
  145. package/android/src/test/java/com/audiobrowser/player/PlayerEngineFactoryTest.kt +0 -3
  146. package/android/src/test/java/com/audiobrowser/player/PlayerInvalidTrackTest.kt +0 -1
  147. package/android/src/test/java/com/audiobrowser/player/PlayerSetupTest.kt +3 -2
  148. package/android/src/test/java/com/audiobrowser/player/PlayerSonosTest.kt +5 -1
  149. package/android/src/test/java/com/audiobrowser/player/PlayerSuppressionTest.kt +5 -7
  150. package/android/src/test/java/com/audiobrowser/player/RetryLoadErrorHandlingPolicyTest.kt +4 -35
  151. package/android/src/test/java/com/audiobrowser/player/SessionErrorMaskTest.kt +0 -5
  152. package/android/src/test/java/com/audiobrowser/player/ShuffleOrderLedByTest.kt +1 -8
  153. package/android/src/test/java/com/audiobrowser/player/StandardSkipTest.kt +4 -6
  154. package/android/src/test/java/com/audiobrowser/player/StuckRecoveryPolicyTest.kt +11 -11
  155. package/android/src/test/java/com/audiobrowser/player/TransformingDataSourceTest.kt +2 -23
  156. package/android/src/test/java/com/audiobrowser/remote/FakeRemote.kt +9 -10
  157. package/android/src/test/java/com/audiobrowser/remote/RemoteSwitchingPlayerTest.kt +0 -1
  158. package/android/src/test/java/com/audiobrowser/sonos/DeviceDescriptionParserTest.kt +1 -3
  159. package/android/src/test/java/com/audiobrowser/sonos/DidlLiteTest.kt +0 -1
  160. package/android/src/test/java/com/audiobrowser/sonos/SoapClientTest.kt +0 -3
  161. package/android/src/test/java/com/audiobrowser/sonos/SoapEnvelopesTest.kt +0 -1
  162. package/android/src/test/java/com/audiobrowser/sonos/SoapResponseParserTest.kt +0 -1
  163. package/android/src/test/java/com/audiobrowser/sonos/SonosDiscovererTest.kt +2 -0
  164. package/android/src/test/java/com/audiobrowser/sonos/SonosPlayerTest.kt +0 -1
  165. package/android/src/test/java/com/audiobrowser/sonos/SonosRemoteTest.kt +1 -1
  166. package/android/src/test/java/com/audiobrowser/sonos/SonosRoutesTest.kt +2 -0
  167. package/android/src/test/java/com/audiobrowser/sonos/SonosTransportTest.kt +2 -6
  168. package/android/src/test/java/com/audiobrowser/sonos/SsdpMessagesTest.kt +0 -2
  169. package/android/src/test/java/com/audiobrowser/tls/AiaCertChaserTest.kt +13 -37
  170. package/android/src/test/java/com/audiobrowser/tls/AiaChasingTrustManagerTest.kt +10 -24
  171. package/android/src/test/java/com/audiobrowser/tls/CachingCertificateFetcherCallSiteTest.kt +15 -39
  172. package/android/src/test/java/com/audiobrowser/tls/CachingCertificateFetcherTest.kt +4 -10
  173. package/android/src/test/java/com/audiobrowser/util/ArtworkContentProviderTest.kt +2 -11
  174. package/android/src/test/java/com/audiobrowser/util/ArtworkUrisTest.kt +0 -1
  175. package/android/src/test/java/com/audiobrowser/util/BrowserPathHelperTest.kt +0 -4
  176. package/android/src/test/java/com/audiobrowser/util/CoilArtworkLoaderHolderTest.kt +1 -1
  177. package/android/src/test/java/com/audiobrowser/util/CoilArtworkLoaderTest.kt +0 -5
  178. package/android/src/test/java/com/audiobrowser/util/FakeImageLoader.kt +2 -2
  179. package/android/src/test/java/com/audiobrowser/util/MediaExtrasBuilderTest.kt +4 -12
  180. package/android/src/test/java/com/audiobrowser/util/OutputMonitorTest.kt +1 -1
  181. package/android/src/test/java/com/audiobrowser/util/PlayingStateFactoryTest.kt +0 -4
  182. package/android/src/test/java/com/audiobrowser/util/TrackFactoryBrowseTest.kt +1 -1
  183. package/android/src/test/java/com/audiobrowser/util/TrackFactoryMediaIdTest.kt +4 -6
  184. package/android/src/testCast/java/com/audiobrowser/cast/CastEndsTest.kt +1 -1
  185. package/android/src/testCast/java/com/audiobrowser/cast/SendingMediaItemConverterTest.kt +1 -0
  186. package/ios/AVPlayerEngine.swift +13 -21
  187. package/ios/AVPlayerEngineCallbacks.swift +2 -4
  188. package/ios/Browser/BrowseGate.swift +7 -8
  189. package/ios/Browser/BrowserConfig.swift +19 -34
  190. package/ios/Browser/BrowserError.swift +0 -1
  191. package/ios/Browser/BrowserManager.swift +29 -75
  192. package/ios/Browser/BrowserPathHelper.swift +13 -93
  193. package/ios/Browser/FavoriteSet.swift +7 -10
  194. package/ios/Browser/InertStyleDiagnostic.swift +17 -82
  195. package/ios/Browser/JsonModels.swift +11 -51
  196. package/ios/Browser/NavigationErrorState.swift +3 -2
  197. package/ios/Browser/PageResolver.swift +13 -23
  198. package/ios/Browser/RequestLayer.swift +16 -20
  199. package/ios/Browser/RequestPipeline.swift +33 -43
  200. package/ios/Browser/SearchDrillIn.swift +7 -13
  201. package/ios/Browser/SectionScope.swift +14 -26
  202. package/ios/Browser/SimpleRouter.swift +8 -15
  203. package/ios/Browser/StyleResolver.swift +12 -29
  204. package/ios/Browser/TabBarEntries.swift +6 -11
  205. package/ios/Browser/TrackIdTemplate.swift +6 -14
  206. package/ios/CarPlay/CPInterfaceController+Safe.swift +19 -28
  207. package/ios/CarPlay/CarPlayArtworkResolver.swift +5 -9
  208. package/ios/CarPlay/CarPlayController.swift +4 -4
  209. package/ios/CarPlay/CarPlayImageLoader.swift +11 -26
  210. package/ios/CarPlay/CarPlayListItemFactory.swift +30 -80
  211. package/ios/CarPlay/CarPlayNowPlayingManager.swift +19 -54
  212. package/ios/CarPlay/CarPlaySession+Navigator.swift +10 -10
  213. package/ios/CarPlay/CarPlaySession+PageLoader.swift +6 -5
  214. package/ios/CarPlay/CarPlaySession+Refresher.swift +2 -2
  215. package/ios/CarPlay/CarPlaySession+TabBar.swift +19 -26
  216. package/ios/CarPlay/CarPlaySession.swift +13 -17
  217. package/ios/CarPlay/CarPlayTemplates.swift +6 -7
  218. package/ios/CarPlay/IntentHandlers.swift +3 -5
  219. package/ios/CarPlay/MediaIntentCriteria.swift +15 -29
  220. package/ios/CarPlay/MediaIntentHandler.swift +4 -7
  221. package/ios/CarPlay/MediaIntentPlayback.swift +9 -8
  222. package/ios/CarPlay/NowPlayingButtonRules.swift +3 -4
  223. package/ios/CarPlay/SectionPresentation.swift +18 -28
  224. package/ios/CarPlay/TopTemplateReplacer.swift +8 -9
  225. package/ios/Extension/Capability+RemoteCommand.swift +3 -3
  226. package/ios/Extension/ChapterMetadata+AVFoundation.swift +2 -5
  227. package/ios/Extension/CxxVectorConformances.swift +4 -16
  228. package/ios/Extension/NavigationError+Conversion.swift +4 -7
  229. package/ios/Extension/PlayerCapabilities+Favorite.swift +0 -1
  230. package/ios/Extension/RequestConfig+Copying.swift +2 -6
  231. package/ios/Extension/ResolvedTrack+Copying.swift +2 -8
  232. package/ios/Extension/SearchParams+Query.swift +4 -4
  233. package/ios/Extension/Section+Copying.swift +3 -6
  234. package/ios/Extension/String+IcyCharset.swift +5 -5
  235. package/ios/Extension/TimedMetadata+AVFoundation.swift +6 -12
  236. package/ios/Extension/Track+AVPlayer.swift +1 -2
  237. package/ios/Extension/Track+Copying.swift +2 -8
  238. package/ios/Extension/Track+Identity.swift +4 -9
  239. package/ios/Extension/TrackMetadata+AVFoundation.swift +10 -13
  240. package/ios/Extension/UIApplication+ActiveScene.swift +6 -14
  241. package/ios/Extension/Variant+Artwork.swift +8 -22
  242. package/ios/Http/HttpClient.swift +3 -3
  243. package/ios/HybridAudioBrowser+Browser.swift +10 -16
  244. package/ios/HybridAudioBrowser+Options.swift +6 -9
  245. package/ios/HybridAudioBrowser+Player.swift +8 -16
  246. package/ios/HybridAudioBrowser+PlayerCallbacks.swift +4 -5
  247. package/ios/HybridAudioBrowser+Stubs.swift +5 -7
  248. package/ios/HybridAudioBrowser.swift +54 -79
  249. package/ios/Model/NitroTypeStubs.swift +15 -22
  250. package/ios/Model/PlayerUpdateOptions.swift +6 -21
  251. package/ios/Model/RemoteCommand.swift +2 -2
  252. package/ios/Model/TrackPlayerError.swift +9 -22
  253. package/ios/NowPlayingInfo/NowPlayingInfoController.swift +21 -40
  254. package/ios/NowPlayingInfo/SilentAudioPrimer.swift +10 -16
  255. package/ios/Observer/ItemObserver.swift +7 -5
  256. package/ios/Observer/PlayerObserver.swift +5 -5
  257. package/ios/PlaybackEvent.swift +2 -2
  258. package/ios/Player/AirPlayStallJudgement.swift +7 -9
  259. package/ios/Player/AudioSessionController.swift +14 -15
  260. package/ios/Player/DeferredSeek.swift +2 -2
  261. package/ios/Player/EndOfTrackJudgement.swift +6 -13
  262. package/ios/Player/ErrorStatus.swift +8 -7
  263. package/ios/Player/MediaLoader.swift +20 -24
  264. package/ios/Player/NowPlayingLines.swift +1 -4
  265. package/ios/Player/NowPlayingUpdater.swift +35 -61
  266. package/ios/Player/PersistedPlaybackState.swift +1 -2
  267. package/ios/Player/PlaybackFailure.swift +20 -24
  268. package/ios/Player/PlaybackPersistence.swift +5 -6
  269. package/ios/Player/PlaybackStateMachine.swift +8 -11
  270. package/ios/Player/PlaybackTimer.swift +8 -11
  271. package/ios/Player/Player.swift +6 -13
  272. package/ios/Player/PlayerEngine.swift +20 -20
  273. package/ios/Player/PlayerStatusTypes.swift +1 -2
  274. package/ios/Player/QueueManager.swift +23 -67
  275. package/ios/Player/RetryLoop.swift +39 -50
  276. package/ios/Player/ShuffleOrder.swift +17 -57
  277. package/ios/Player/SleepTimerManager.swift +13 -28
  278. package/ios/Player/VolumeFader.swift +16 -16
  279. package/ios/RemoteCommand/RemoteCommandCallbacks.swift +6 -16
  280. package/ios/RemoteCommand/RemoteCommandController.swift +8 -10
  281. package/ios/Tests/AirPlayStallJudgementTests.swift +4 -4
  282. package/ios/Tests/BrowserPathHelperTests.swift +3 -6
  283. package/ios/Tests/DeferredSeekTests.swift +1 -3
  284. package/ios/Tests/EmitterTests.swift +0 -1
  285. package/ios/Tests/EndOfTrackJudgementTests.swift +1 -6
  286. package/ios/Tests/FavoriteSetTests.swift +1 -0
  287. package/ios/Tests/GenerationMemoTests.swift +2 -2
  288. package/ios/Tests/InertStyleDiagnosticTests.swift +4 -10
  289. package/ios/Tests/JsonModelsTests.swift +5 -12
  290. package/ios/Tests/LRUCacheTests.swift +1 -5
  291. package/ios/Tests/MediaIntentCriteriaTests.swift +2 -7
  292. package/ios/Tests/MediaLoaderTests.swift +3 -12
  293. package/ios/Tests/ObserverTests.swift +3 -3
  294. package/ios/Tests/PlaybackErrorTests.swift +7 -9
  295. package/ios/Tests/PlaybackFailureTests.swift +9 -17
  296. package/ios/Tests/PlaybackPersistenceTests.swift +1 -0
  297. package/ios/Tests/PlaybackStateMachineTests.swift +1 -16
  298. package/ios/Tests/PlaybackTimerTests.swift +2 -3
  299. package/ios/Tests/PlayerPolicyTests.swift +10 -26
  300. package/ios/Tests/PlayerTests.swift +53 -88
  301. package/ios/Tests/PlayingStateTests.swift +0 -1
  302. package/ios/Tests/QueueManagerTests.swift +30 -80
  303. package/ios/Tests/RemoteCommandControllerTests.swift +5 -13
  304. package/ios/Tests/ResolvedTrackCopyingTests.swift +0 -2
  305. package/ios/Tests/RetryLoopTests.swift +12 -35
  306. package/ios/Tests/SearchDrillInTests.swift +4 -5
  307. package/ios/Tests/SectionPresentationTests.swift +3 -16
  308. package/ios/Tests/SectionScopeTests.swift +3 -6
  309. package/ios/Tests/SimpleRouterTests.swift +1 -5
  310. package/ios/Tests/SleepTimerManagerTests.swift +8 -11
  311. package/ios/Tests/StyleResolverTests.swift +4 -13
  312. package/ios/Tests/Support/ManualSleepTimerScheduler.swift +3 -8
  313. package/ios/Tests/Support/TestTypes.swift +5 -15
  314. package/ios/Tests/TabBarEntriesTests.swift +0 -2
  315. package/ios/Tests/TimedMetadataAVFoundationTests.swift +2 -3
  316. package/ios/Tests/TopTemplateReplacerTests.swift +1 -1
  317. package/ios/Tests/TrackIdTemplateTests.swift +2 -6
  318. package/ios/Tests/TrackMetadataAVFoundationTests.swift +1 -4
  319. package/ios/Tests/TrackSelectorTests.swift +3 -15
  320. package/ios/TrackSelector.swift +13 -25
  321. package/ios/Util/ArtworkFreshness.swift +6 -6
  322. package/ios/Util/ArtworkImageFetcher.swift +19 -20
  323. package/ios/Util/ConcurrentMap.swift +2 -2
  324. package/ios/Util/Emitter.swift +8 -13
  325. package/ios/Util/NetworkMonitor.swift +4 -6
  326. package/ios/Util/OutputPicker.swift +1 -1
  327. package/ios/Util/ReadyValue.swift +3 -2
  328. package/ios/Util/SFSymbolRenderer.swift +17 -30
  329. package/ios/Util/SVGProcessor.swift +5 -9
  330. package/lib/commonjs/CLAUDE.md +7 -2
  331. package/lib/commonjs/features/battery.js +16 -12
  332. package/lib/commonjs/features/battery.js.map +1 -1
  333. package/lib/commonjs/features/browser-config.js +1 -1
  334. package/lib/commonjs/features/browser.js +74 -24
  335. package/lib/commonjs/features/browser.js.map +1 -1
  336. package/lib/commonjs/features/carConnection.js +3 -4
  337. package/lib/commonjs/features/carConnection.js.map +1 -1
  338. package/lib/commonjs/features/equalizer.js +9 -5
  339. package/lib/commonjs/features/equalizer.js.map +1 -1
  340. package/lib/commonjs/features/errors.js +35 -21
  341. package/lib/commonjs/features/errors.js.map +1 -1
  342. package/lib/commonjs/features/favorites.js +15 -13
  343. package/lib/commonjs/features/favorites.js.map +1 -1
  344. package/lib/commonjs/features/gate.js +12 -6
  345. package/lib/commonjs/features/gate.js.map +1 -1
  346. package/lib/commonjs/features/metadata.js +16 -14
  347. package/lib/commonjs/features/metadata.js.map +1 -1
  348. package/lib/commonjs/features/network.js +5 -1
  349. package/lib/commonjs/features/network.js.map +1 -1
  350. package/lib/commonjs/features/nowPlaying.js +28 -14
  351. package/lib/commonjs/features/nowPlaying.js.map +1 -1
  352. package/lib/commonjs/features/output.js +8 -4
  353. package/lib/commonjs/features/output.js.map +1 -1
  354. package/lib/commonjs/features/playback/controls.js +10 -5
  355. package/lib/commonjs/features/playback/controls.js.map +1 -1
  356. package/lib/commonjs/features/playback/playWhenReady.js +6 -5
  357. package/lib/commonjs/features/playback/playWhenReady.js.map +1 -1
  358. package/lib/commonjs/features/playback/playing.js +5 -3
  359. package/lib/commonjs/features/playback/playing.js.map +1 -1
  360. package/lib/commonjs/features/playback/progress.js +11 -5
  361. package/lib/commonjs/features/playback/progress.js.map +1 -1
  362. package/lib/commonjs/features/playback/state.js +3 -3
  363. package/lib/commonjs/features/playback/state.js.map +1 -1
  364. package/lib/commonjs/features/playback/trackPlaybackTime.js +6 -1
  365. package/lib/commonjs/features/playback/trackPlaybackTime.js.map +1 -1
  366. package/lib/commonjs/features/playback/volume.js +6 -5
  367. package/lib/commonjs/features/playback/volume.js.map +1 -1
  368. package/lib/commonjs/features/player/options.js +20 -10
  369. package/lib/commonjs/features/player/options.js.map +1 -1
  370. package/lib/commonjs/features/player/setup.js +34 -38
  371. package/lib/commonjs/features/player/setup.js.map +1 -1
  372. package/lib/commonjs/features/queue/activeTrack.js +0 -1
  373. package/lib/commonjs/features/queue/activeTrack.js.map +1 -1
  374. package/lib/commonjs/features/queue/queue.js +48 -20
  375. package/lib/commonjs/features/queue/queue.js.map +1 -1
  376. package/lib/commonjs/features/queue/repeatMode.js +2 -1
  377. package/lib/commonjs/features/queue/repeatMode.js.map +1 -1
  378. package/lib/commonjs/features/queue/shuffle.js +0 -1
  379. package/lib/commonjs/features/queue/shuffle.js.map +1 -1
  380. package/lib/commonjs/features/remoteControls.js +59 -35
  381. package/lib/commonjs/features/remoteControls.js.map +1 -1
  382. package/lib/commonjs/features/sleepTimer.js +15 -6
  383. package/lib/commonjs/features/sleepTimer.js.map +1 -1
  384. package/lib/commonjs/utils/LazyNativeEmitter.js +6 -9
  385. package/lib/commonjs/utils/LazyNativeEmitter.js.map +1 -1
  386. package/lib/commonjs/utils/NativeUpdatedValue.js +13 -12
  387. package/lib/commonjs/utils/NativeUpdatedValue.js.map +1 -1
  388. package/lib/commonjs/utils/getTrackIdentity.js +6 -4
  389. package/lib/commonjs/utils/getTrackIdentity.js.map +1 -1
  390. package/lib/commonjs/utils/useDebug.js +16 -3
  391. package/lib/commonjs/utils/useDebug.js.map +1 -1
  392. package/lib/commonjs/web/NativeAudioBrowser.js +2 -4
  393. package/lib/commonjs/web/NativeAudioBrowser.js.map +1 -1
  394. package/lib/commonjs/web/browser/parseSearchResponse.js +3 -4
  395. package/lib/commonjs/web/browser/parseSearchResponse.js.map +1 -1
  396. package/lib/commonjs/web/browser/sections.js +1 -1
  397. package/lib/commonjs/web/util/BrowserPathHelper.js +1 -3
  398. package/lib/commonjs/web/util/BrowserPathHelper.js.map +1 -1
  399. package/lib/module/CLAUDE.md +7 -2
  400. package/lib/module/features/battery.js +16 -12
  401. package/lib/module/features/battery.js.map +1 -1
  402. package/lib/module/features/browser-config.js +1 -1
  403. package/lib/module/features/browser.js +74 -24
  404. package/lib/module/features/browser.js.map +1 -1
  405. package/lib/module/features/carConnection.js +3 -4
  406. package/lib/module/features/carConnection.js.map +1 -1
  407. package/lib/module/features/equalizer.js +9 -5
  408. package/lib/module/features/equalizer.js.map +1 -1
  409. package/lib/module/features/errors.js +35 -21
  410. package/lib/module/features/errors.js.map +1 -1
  411. package/lib/module/features/favorites.js +15 -13
  412. package/lib/module/features/favorites.js.map +1 -1
  413. package/lib/module/features/gate.js +12 -6
  414. package/lib/module/features/gate.js.map +1 -1
  415. package/lib/module/features/metadata.js +16 -14
  416. package/lib/module/features/metadata.js.map +1 -1
  417. package/lib/module/features/network.js +5 -1
  418. package/lib/module/features/network.js.map +1 -1
  419. package/lib/module/features/nowPlaying.js +28 -14
  420. package/lib/module/features/nowPlaying.js.map +1 -1
  421. package/lib/module/features/output.js +8 -4
  422. package/lib/module/features/output.js.map +1 -1
  423. package/lib/module/features/playback/controls.js +10 -5
  424. package/lib/module/features/playback/controls.js.map +1 -1
  425. package/lib/module/features/playback/playWhenReady.js +6 -5
  426. package/lib/module/features/playback/playWhenReady.js.map +1 -1
  427. package/lib/module/features/playback/playing.js +5 -3
  428. package/lib/module/features/playback/playing.js.map +1 -1
  429. package/lib/module/features/playback/progress.js +11 -5
  430. package/lib/module/features/playback/progress.js.map +1 -1
  431. package/lib/module/features/playback/state.js +3 -3
  432. package/lib/module/features/playback/state.js.map +1 -1
  433. package/lib/module/features/playback/trackPlaybackTime.js +6 -1
  434. package/lib/module/features/playback/trackPlaybackTime.js.map +1 -1
  435. package/lib/module/features/playback/volume.js +6 -5
  436. package/lib/module/features/playback/volume.js.map +1 -1
  437. package/lib/module/features/player/options.js +20 -10
  438. package/lib/module/features/player/options.js.map +1 -1
  439. package/lib/module/features/player/setup.js +34 -38
  440. package/lib/module/features/player/setup.js.map +1 -1
  441. package/lib/module/features/queue/activeTrack.js +0 -1
  442. package/lib/module/features/queue/activeTrack.js.map +1 -1
  443. package/lib/module/features/queue/queue.js +48 -20
  444. package/lib/module/features/queue/queue.js.map +1 -1
  445. package/lib/module/features/queue/repeatMode.js +2 -1
  446. package/lib/module/features/queue/repeatMode.js.map +1 -1
  447. package/lib/module/features/queue/shuffle.js +0 -1
  448. package/lib/module/features/queue/shuffle.js.map +1 -1
  449. package/lib/module/features/remoteControls.js +59 -35
  450. package/lib/module/features/remoteControls.js.map +1 -1
  451. package/lib/module/features/sleepTimer.js +15 -6
  452. package/lib/module/features/sleepTimer.js.map +1 -1
  453. package/lib/module/utils/LazyNativeEmitter.js +6 -9
  454. package/lib/module/utils/LazyNativeEmitter.js.map +1 -1
  455. package/lib/module/utils/NativeUpdatedValue.js +13 -12
  456. package/lib/module/utils/NativeUpdatedValue.js.map +1 -1
  457. package/lib/module/utils/getTrackIdentity.js +6 -4
  458. package/lib/module/utils/getTrackIdentity.js.map +1 -1
  459. package/lib/module/utils/useDebug.js +16 -3
  460. package/lib/module/utils/useDebug.js.map +1 -1
  461. package/lib/module/web/NativeAudioBrowser.js +2 -4
  462. package/lib/module/web/NativeAudioBrowser.js.map +1 -1
  463. package/lib/module/web/browser/parseSearchResponse.js +3 -4
  464. package/lib/module/web/browser/parseSearchResponse.js.map +1 -1
  465. package/lib/module/web/browser/sections.js +1 -1
  466. package/lib/module/web/util/BrowserPathHelper.js +1 -3
  467. package/lib/module/web/util/BrowserPathHelper.js.map +1 -1
  468. package/lib/typescript/src/features/battery.d.ts +17 -12
  469. package/lib/typescript/src/features/battery.d.ts.map +1 -1
  470. package/lib/typescript/src/features/browser.d.ts +64 -24
  471. package/lib/typescript/src/features/browser.d.ts.map +1 -1
  472. package/lib/typescript/src/features/carConnection.d.ts +3 -4
  473. package/lib/typescript/src/features/carConnection.d.ts.map +1 -1
  474. package/lib/typescript/src/features/equalizer.d.ts +9 -5
  475. package/lib/typescript/src/features/equalizer.d.ts.map +1 -1
  476. package/lib/typescript/src/features/errors.d.ts +37 -22
  477. package/lib/typescript/src/features/errors.d.ts.map +1 -1
  478. package/lib/typescript/src/features/favorites.d.ts +15 -13
  479. package/lib/typescript/src/features/favorites.d.ts.map +1 -1
  480. package/lib/typescript/src/features/gate.d.ts +14 -8
  481. package/lib/typescript/src/features/gate.d.ts.map +1 -1
  482. package/lib/typescript/src/features/metadata.d.ts +37 -17
  483. package/lib/typescript/src/features/metadata.d.ts.map +1 -1
  484. package/lib/typescript/src/features/network.d.ts +5 -1
  485. package/lib/typescript/src/features/network.d.ts.map +1 -1
  486. package/lib/typescript/src/features/nowPlaying.d.ts +28 -14
  487. package/lib/typescript/src/features/nowPlaying.d.ts.map +1 -1
  488. package/lib/typescript/src/features/output.d.ts +8 -4
  489. package/lib/typescript/src/features/output.d.ts.map +1 -1
  490. package/lib/typescript/src/features/playback/controls.d.ts +10 -5
  491. package/lib/typescript/src/features/playback/controls.d.ts.map +1 -1
  492. package/lib/typescript/src/features/playback/playWhenReady.d.ts +6 -5
  493. package/lib/typescript/src/features/playback/playWhenReady.d.ts.map +1 -1
  494. package/lib/typescript/src/features/playback/playing.d.ts +16 -3
  495. package/lib/typescript/src/features/playback/playing.d.ts.map +1 -1
  496. package/lib/typescript/src/features/playback/progress.d.ts +11 -5
  497. package/lib/typescript/src/features/playback/progress.d.ts.map +1 -1
  498. package/lib/typescript/src/features/playback/state.d.ts +8 -3
  499. package/lib/typescript/src/features/playback/state.d.ts.map +1 -1
  500. package/lib/typescript/src/features/playback/trackPlaybackTime.d.ts +9 -2
  501. package/lib/typescript/src/features/playback/trackPlaybackTime.d.ts.map +1 -1
  502. package/lib/typescript/src/features/playback/volume.d.ts +6 -5
  503. package/lib/typescript/src/features/playback/volume.d.ts.map +1 -1
  504. package/lib/typescript/src/features/player/options.d.ts +52 -37
  505. package/lib/typescript/src/features/player/options.d.ts.map +1 -1
  506. package/lib/typescript/src/features/player/setup.d.ts +65 -60
  507. package/lib/typescript/src/features/player/setup.d.ts.map +1 -1
  508. package/lib/typescript/src/features/queue/activeTrack.d.ts +0 -1
  509. package/lib/typescript/src/features/queue/activeTrack.d.ts.map +1 -1
  510. package/lib/typescript/src/features/queue/queue.d.ts +48 -20
  511. package/lib/typescript/src/features/queue/queue.d.ts.map +1 -1
  512. package/lib/typescript/src/features/queue/repeatMode.d.ts +1 -1
  513. package/lib/typescript/src/features/queue/repeatMode.d.ts.map +1 -1
  514. package/lib/typescript/src/features/queue/shuffle.d.ts +0 -1
  515. package/lib/typescript/src/features/queue/shuffle.d.ts.map +1 -1
  516. package/lib/typescript/src/features/remoteControls.d.ts +58 -25
  517. package/lib/typescript/src/features/remoteControls.d.ts.map +1 -1
  518. package/lib/typescript/src/features/sleepTimer.d.ts +15 -7
  519. package/lib/typescript/src/features/sleepTimer.d.ts.map +1 -1
  520. package/lib/typescript/src/types/browser-nodes.d.ts +54 -57
  521. package/lib/typescript/src/types/browser-nodes.d.ts.map +1 -1
  522. package/lib/typescript/src/types/browser.d.ts +181 -144
  523. package/lib/typescript/src/types/browser.d.ts.map +1 -1
  524. package/lib/typescript/src/utils/LazyNativeEmitter.d.ts +6 -9
  525. package/lib/typescript/src/utils/LazyNativeEmitter.d.ts.map +1 -1
  526. package/lib/typescript/src/utils/NativeUpdatedValue.d.ts +13 -12
  527. package/lib/typescript/src/utils/NativeUpdatedValue.d.ts.map +1 -1
  528. package/lib/typescript/src/utils/getTrackIdentity.d.ts +6 -4
  529. package/lib/typescript/src/utils/getTrackIdentity.d.ts.map +1 -1
  530. package/lib/typescript/src/utils/useDebug.d.ts +16 -3
  531. package/lib/typescript/src/utils/useDebug.d.ts.map +1 -1
  532. package/package.json +1 -1
  533. package/src/CLAUDE.md +7 -2
  534. package/src/docs-floors.test.ts +71 -0
  535. package/src/features/battery.ts +17 -13
  536. package/src/features/browser-config.ts +1 -1
  537. package/src/features/browser.ts +65 -24
  538. package/src/features/carConnection.ts +3 -4
  539. package/src/features/equalizer.ts +9 -5
  540. package/src/features/errors.ts +37 -22
  541. package/src/features/favorites.ts +15 -13
  542. package/src/features/gate.ts +14 -8
  543. package/src/features/metadata.ts +37 -17
  544. package/src/features/network.ts +5 -1
  545. package/src/features/nowPlaying.ts +28 -14
  546. package/src/features/output.ts +8 -4
  547. package/src/features/playback/controls.ts +10 -5
  548. package/src/features/playback/playWhenReady.ts +6 -5
  549. package/src/features/playback/playing.ts +16 -3
  550. package/src/features/playback/progress.ts +11 -5
  551. package/src/features/playback/state.ts +8 -3
  552. package/src/features/playback/trackPlaybackTime.ts +9 -2
  553. package/src/features/playback/volume.ts +6 -5
  554. package/src/features/player/options.ts +54 -43
  555. package/src/features/player/setup.ts +67 -61
  556. package/src/features/queue/activeTrack.ts +0 -1
  557. package/src/features/queue/queue.ts +48 -20
  558. package/src/features/queue/repeatMode.ts +1 -1
  559. package/src/features/queue/shuffle.ts +0 -1
  560. package/src/features/remoteControls.ts +59 -35
  561. package/src/features/sleepTimer.ts +15 -7
  562. package/src/types/browser-nodes.ts +54 -57
  563. package/src/types/browser.ts +183 -146
  564. package/src/utils/LazyNativeEmitter.ts +6 -9
  565. package/src/utils/NativeUpdatedValue.ts +13 -12
  566. package/src/utils/getTrackIdentity.ts +6 -4
  567. package/src/utils/useDebug.ts +16 -3
  568. package/src/web/NativeAudioBrowser.ts +2 -4
  569. package/src/web/browser/parseSearchResponse.ts +3 -4
  570. package/src/web/browser/sections.ts +1 -1
  571. package/src/web/util/BrowserPathHelper.ts +1 -3
  572. package/website/guide/android-auto.md +25 -13
  573. package/website/guide/android-certificates.md +199 -120
  574. package/website/guide/artwork.md +93 -48
  575. package/website/guide/audio-output.md +86 -68
  576. package/website/guide/automotive.md +15 -10
  577. package/website/guide/basic-usage.md +5 -2
  578. package/website/guide/battery.md +50 -23
  579. package/website/guide/browser.md +155 -68
  580. package/website/guide/carplay.md +132 -49
  581. package/website/guide/configuration.md +85 -49
  582. package/website/guide/equalizer.md +36 -32
  583. package/website/guide/errors.md +106 -64
  584. package/website/guide/favorites.md +41 -31
  585. package/website/guide/gate.md +24 -10
  586. package/website/guide/getting-started.md +55 -2
  587. package/website/guide/hooks.md +53 -47
  588. package/website/guide/live-streams.md +80 -49
  589. package/website/guide/metadata.md +87 -53
  590. package/website/guide/migrating-from-track-player.md +94 -49
  591. package/website/guide/native-callback-fetch.md +46 -36
  592. package/website/guide/network.md +36 -20
  593. package/website/guide/now-playing.md +72 -44
  594. package/website/guide/playback.md +112 -35
  595. package/website/guide/queue.md +77 -43
  596. package/website/guide/remote-controls.md +87 -29
  597. package/website/guide/search.md +37 -22
  598. package/website/guide/sleep-timer.md +35 -14
  599. package/website/guide/track.md +59 -35
@@ -2,22 +2,19 @@
2
2
  import NitroModules
3
3
  #endif
4
4
 
5
- /// The rendered form of a section — the single place where (resolved style,
6
- /// platform capability) maps to what CarPlay draws. Degradation drops
7
- /// decorations before layout (ADR 0011): a *wrapping* grid can only reach the
8
- /// tile path where the platform has a wrapping tile container (CarPlay:
9
- /// iOS 26+'s element API); without one it becomes a list, where every item
10
- /// stays reachable instead of truncating at an unknowable width. A
11
- /// single-line grid (`gridWrap: false`) renders everywhere — the legacy image
12
- /// row IS the single-line presentation.
5
+ /// How CarPlay draws a section, from its resolved style and what the platform supports
6
+ /// (ADR 0011: decorations drop before layout). A wrapping grid needs a wrapping tile container
7
+ /// (iOS 26+'s element API) and becomes a list without one, so every item stays reachable
8
+ /// instead of truncating at an unknown width; a single-line grid is the legacy image row and
9
+ /// renders everywhere. These rules live here, not in the CarPlay factory, so they are testable
10
+ /// off-device.
13
11
  enum SectionPresentation: Equatable {
14
12
  case list
15
13
  case singleLineRow
16
14
  case wrappingGrid
17
15
 
18
- /// - Parameter supportsWrappingGrid: whether the platform has a wrapping
19
- /// tile container. Injected (rather than read via `#available` here) so
20
- /// the mapping is testable off-device.
16
+ /// - Parameter supportsWrappingGrid: whether the platform has a wrapping tile container; passed
17
+ /// in rather than read with `#available` so the mapping is testable off-device.
21
18
  init(for style: SectionStyle?, supportsWrappingGrid: Bool) {
22
19
  guard style?.display == .grid else {
23
20
  self = .list
@@ -32,33 +29,23 @@ enum SectionPresentation: Equatable {
32
29
  }
33
30
  }
34
31
 
35
- /// The accessory symbol a resolved block actually draws: nil when
36
- /// undeclared, and nil for the `'none'` sentinel — the inheritance escape
37
- /// that restores the derived accessory (a browsable row's chevron). Here,
38
- /// not in the CarPlay factory, so the sentinel rule is testable off-device.
32
+ /// The accessory symbol a block draws: nil when undeclared, and nil for the `"none"` sentinel,
33
+ /// which restores the derived accessory (a browsable row's chevron).
39
34
  static func effectiveAccessorySymbol(_ style: TrackStyle?) -> String? {
40
35
  guard let symbol = style?.accessorySymbol, symbol != "none" else { return nil }
41
36
  return symbol
42
37
  }
43
38
 
44
- /// The title a tile shelf draws as the list section's header; nil when
45
- /// the image row's own text carries it — here, not in the CarPlay factory,
46
- /// so the rule is testable off-device. CarPlay draws a chevron beside an
47
- /// image row's text whether or not the row has a handler, so only a shelf
48
- /// with a "view all" `path` keeps its title there.
39
+ /// The title a tile shelf draws as the list section's header; nil when the image row's own text
40
+ /// carries it. CarPlay draws a chevron beside an image row's text whether or not the row has a
41
+ /// handler, so only a shelf with a "view all" `path` keeps its title there.
49
42
  ///
50
- /// - Parameter supportsElements: whether the platform has the iOS 26
51
- /// element API; the legacy image row's text is not optional.
43
+ /// - Parameter supportsElements: whether the platform has the iOS 26 element API; without it the
44
+ /// legacy image row's text always carries the title.
52
45
  static func tileSectionHeader(_ section: Section, supportsElements: Bool) -> String? {
53
46
  supportsElements && section.path == nil ? section.title : nil
54
47
  }
55
48
 
56
- /// The element family a tile presentation renders on iOS 26+ — here, not
57
- /// in the CarPlay factory, so the style→family mapping is testable
58
- /// off-device. `gridTile` picks the family (plain by default), in either
59
- /// wrap mode: a plain tile is a row element (title + subtitle), an image
60
- /// tile an image-grid element (title, shape, accessory). Pre-26 has no element API at all: the treatment drops
61
- /// with the legacy image row (decorations drop before layout).
62
49
  enum TileElementFamily: Equatable {
63
50
  case rowElements
64
51
  case imageGridElements
@@ -66,6 +53,9 @@ enum SectionPresentation: Equatable {
66
53
  case condensedElements
67
54
  }
68
55
 
56
+ /// The iOS 26+ element family for a tile presentation, picked by `gridTile` (plain by default)
57
+ /// in either wrap mode. Before iOS 26 there are no elements and the legacy image row drops the
58
+ /// treatment.
69
59
  static func tileFamily(for style: SectionStyle?) -> TileElementFamily {
70
60
  switch style?.gridTile {
71
61
  case .image: .imageGridElements
@@ -1,7 +1,7 @@
1
1
  import Foundation
2
2
  import os.log
3
3
 
4
- /// The stack mutations a top-template replacement is made of:
4
+ /// The stack operations a top-template replacement needs:
5
5
  /// `CPInterfaceController` in the app, a fake in tests.
6
6
  @MainActor
7
7
  protocol TemplateStack {
@@ -15,8 +15,8 @@ protocol TemplateStack {
15
15
  func push(_ template: Template, animated: Bool, completion: @escaping (Bool, Error?) -> Void)
16
16
  }
17
17
 
18
- /// Pushes onto a full template stack by replacing its top template — an
19
- /// unanimated pop, then the push — and holds back every other stack mutation
18
+ /// Pushes onto a full template stack by replacing its top template (an
19
+ /// unanimated pop, then the push) and holds back every other stack mutation
20
20
  /// until both have completed. See "Template Depth" in
21
21
  /// `website/guide/carplay.md`.
22
22
  @MainActor
@@ -24,10 +24,9 @@ final class TopTemplateReplacer {
24
24
  private let logger = Logger(subsystem: "com.audiobrowser", category: "TemplateStack")
25
25
  private var deferred: [() -> Void] = []
26
26
 
27
- /// True from the pop until the push completes.
28
27
  private(set) var isReplacing = false
29
28
 
30
- /// Runs `mutation` now, or — while a replacement is in flight — once it has
29
+ /// Runs `mutation` now or, while a replacement is in flight, once it has
31
30
  /// settled, after the mutations that arrived before it.
32
31
  func whenSettled(_ mutation: @escaping () -> Void) {
33
32
  guard isReplacing else {
@@ -38,11 +37,11 @@ final class TopTemplateReplacer {
38
37
  }
39
38
 
40
39
  /// Pushes `template` onto `stack` in place of its top template. When the
41
- /// push fails, the popped template is pushed back, so the user stays where
42
- /// they were. `completion` reports the push of `template` itself.
40
+ /// push fails, the popped template is pushed back. `completion` reports the
41
+ /// push of `template` itself.
43
42
  ///
44
- /// Refuses a stack with nothing above the root to replace, and a call made
45
- /// while a replacement is in flight: route it through `whenSettled`.
43
+ /// Refuses a stack with nothing above the root, and a call made while a
44
+ /// replacement is in flight: route it through `whenSettled`.
46
45
  func push<Stack: TemplateStack>(
47
46
  _ template: Stack.Template,
48
47
  replacingTopOf stack: Stack,
@@ -5,9 +5,9 @@ import Foundation
5
5
  #endif
6
6
 
7
7
  extension PlayerCapabilities {
8
- /// The remote commands the capabilities enable: each one unless set to false. `favorite`
9
- /// enables none: no iOS 16+ surface invokes `likeCommand`; CarPlay has its own heart button and
10
- /// Siri its affinity intent.
8
+ /// The remote commands to enable: each capability's command unless it is set to false, so an
9
+ /// unset one counts as enabled. `favorite` enables none: no iOS 16+ surface invokes
10
+ /// `likeCommand`; CarPlay has its own heart button and Siri its affinity intent.
11
11
  var remoteCommands: Set<RemoteCommand> {
12
12
  let enabled: [(Bool?, RemoteCommand)] = [
13
13
  (play, .play),
@@ -5,17 +5,14 @@ import AVFoundation
5
5
  #endif
6
6
 
7
7
  extension ChapterMetadata {
8
- /// Creates an array of ChapterMetadata from AVTimedMetadataGroup array.
9
8
  static func from(groups: [AVTimedMetadataGroup]) -> [ChapterMetadata] {
10
9
  groups.map { group in
11
10
  let startTime = CMTimeGetSeconds(group.timeRange.start)
12
11
  let endTime = CMTimeGetSeconds(group.timeRange.start) + CMTimeGetSeconds(group.timeRange.duration)
13
12
 
14
- // Extract metadata from chapter items
15
- // TODO: Artwork extraction missing. Requires converting binary data
16
- // to a URL (base64 data URL or temp file).
17
- // See also: Android implementation in MetadataAdapter.kt
18
13
  var title: String?
14
+ // TODO: chapter artwork is not extracted; it needs its binary data turned into a URL (a
15
+ // base64 data URL or a temp file). Android has the same gap: MetadataAdapter.kt
19
16
  let url: String? = nil
20
17
 
21
18
  for item in group.items {
@@ -1,20 +1,8 @@
1
1
  import NitroModules
2
2
 
3
- // Workaround for a Nitro Modules upstream issue.
4
- //
5
- // Nitrogen-generated Swift code (e.g. Func_void_std__vector_Track_.swift) calls
6
- // .map() on std::vector<T>, which requires CxxRandomAccessCollection conformance.
7
- // Swift's C++ interop synthesizes this conformance lazily, but in incremental
8
- // builds the conformance may not be available in the compilation batch that needs
9
- // it, causing: "Value of type 'std::vector<T>' has no member 'map'"
10
- //
11
- // This should be fixed upstream in Nitro Modules. Until then, explicitly
12
- // declaring the conformance here guarantees it's available regardless of
13
- // compilation order.
14
- //
15
- // To identify which types need conformance, search the generated Swift files for
16
- // .map() calls on bridge.std__vector_<T>_ types:
17
- //
3
+ // Works around a Nitro Modules issue: nitrogen-generated Swift calls .map() on std::vector<T>,
4
+ // which needs CxxRandomAccessCollection. Swift's C++ interop synthesizes that conformance lazily,
5
+ // so an incremental build can fail with "Value of type 'std::vector<T>' has no member 'map'".
6
+ // Declare it here for each vector the generated code maps; find them with
18
7
  // grep -r '\.map(' nitrogen/generated/ios/swift/ | grep std__vector
19
-
20
8
  extension margelo.nitro.audiobrowser.bridge.swift.std__vector_Track_: @retroactive CxxRandomAccessCollection {}
@@ -1,8 +1,8 @@
1
1
  import Foundation
2
2
 
3
3
  extension NavigationError {
4
- /// Converts a generic Error to a NavigationError.
5
- /// Handles BrowserError, HttpClient.HttpException, URLError, and fallback.
4
+ /// Maps any thrown error to a NavigationError. `BrowserError.invalidConfiguration`,
5
+ /// and any error that is not a BrowserError, HttpException or URLError, becomes `.unknownError`.
6
6
  static func from(_ error: Error) -> NavigationError {
7
7
  if let browserError = error as? BrowserError {
8
8
  switch browserError {
@@ -22,7 +22,7 @@ extension NavigationError {
22
22
  }
23
23
  }
24
24
 
25
- /// Returns the default user-facing formatted error.
25
+ /// The English copy passed to the app's `formatNavigationError`, and used when it has none.
26
26
  func defaultFormatted() -> FormattedNavigationError {
27
27
  let title: String = switch code {
28
28
  case .contentNotFound:
@@ -40,13 +40,11 @@ extension NavigationError {
40
40
  case .unknownError:
41
41
  "Error"
42
42
  case .emptyContent:
43
- // Not a failure — a container that resolved with no children. Neutral copy;
44
- // the message (carried on the NavigationError) is typically empty. See ADR 0001.
43
+ // Not a failure: a container with no children (ADR 0001).
45
44
  "Nothing here"
46
45
  case .timeout:
47
46
  "Couldn't load"
48
47
  }
49
- // Omit an empty message so it renders as title-only (e.g. the empty-content case).
50
48
  return FormattedNavigationError(title: title, message: message.isEmpty ? nil : message)
51
49
  }
52
50
  }
@@ -59,7 +57,6 @@ extension NavigationError {
59
57
  }
60
58
 
61
59
  extension NavigationErrorKind {
62
- /// The kind of request a navigation error on `path` came from.
63
60
  init(path: String) {
64
61
  self = BrowserPathHelper.isSearchPath(path) ? .search : .browse
65
62
  }
@@ -1,6 +1,5 @@
1
1
  import Foundation
2
2
 
3
3
  extension PlayerCapabilities {
4
- /// Whether the favorite/like control is enabled.
5
4
  var favoriteEnabled: Bool { favorite ?? false }
6
5
  }
@@ -1,12 +1,8 @@
1
1
  import NitroModules
2
2
 
3
3
  extension RequestConfig {
4
- /// Returns a copy of this RequestConfig with only the specified fields changed.
5
- ///
6
- /// `RequestConfig` is a C++-backed Nitro struct whose fields are get-only, so
7
- /// "mutation" means rebuilding via the initializer. Uses double-optional
8
- /// (`T??`) so callers can distinguish omitted (keep), `.some(nil)` (clear),
9
- /// and `.some(value)` (set).
4
+ /// Returns a copy with only the given fields changed: an omitted argument keeps the field,
5
+ /// `.some(nil)` clears it. The Nitro struct's fields are get-only, hence the rebuild.
10
6
  func copying(
11
7
  method: HttpMethod?? = nil,
12
8
  path: String?? = nil,
@@ -3,14 +3,8 @@
3
3
  #endif
4
4
 
5
5
  extension ResolvedTrack {
6
- /// Returns a copy of this ResolvedTrack with only the specified fields changed.
7
- ///
8
- /// Uses double-optional (`T??`) so callers can distinguish between:
9
- /// - Omitted argument → keep existing value
10
- /// - `.some(nil)` → set field to nil
11
- /// - `.some(value)` → set field to value
12
- ///
13
- /// `path` and `title` use single-optional since they are non-optional on ResolvedTrack.
6
+ /// Returns a copy with the given fields replaced. An omitted argument keeps the field;
7
+ /// `.some(nil)` clears it. `path` and `title` are required, so they can only be replaced.
14
8
  func copying(
15
9
  path: String? = nil,
16
10
  style: SectionStyle?? = nil,
@@ -3,8 +3,8 @@
3
3
  #endif
4
4
 
5
5
  extension SearchParams {
6
- /// The query params this search sends: `q` plus whichever filters are set, as on Android and
7
- /// web. Also the search's cache identity, so a field added here distinguishes both.
6
+ /// `q` plus whichever filters are set, matching Android and web. Also the search's cache
7
+ /// identity (`cacheKey`), so a field added here distinguishes both.
8
8
  var queryParams: [String: String] {
9
9
  var query: [String: String] = ["q": query]
10
10
  if let mode { query["mode"] = mode.stringValue }
@@ -17,8 +17,8 @@ extension SearchParams {
17
17
  return query
18
18
  }
19
19
 
20
- /// The cache identity: `queryParams`, sorted so key order is stable and `\u{1}`-delimited so
21
- /// two param sets cannot serialize alike.
20
+ /// `queryParams` sorted so key order is stable, and joined with `\u{1}` rather than a
21
+ /// printable separator so two different param sets don't serialize alike.
22
22
  var cacheKey: String {
23
23
  queryParams
24
24
  .sorted { $0.key < $1.key }
@@ -3,10 +3,8 @@
3
3
  #endif
4
4
 
5
5
  extension Section {
6
- /// Returns a copy of this Section with only the specified fields changed.
7
- ///
8
- /// Same double-optional (`T??`) convention as the other copying helpers;
9
- /// `children` is single-optional since it is non-optional on Section.
6
+ /// Returns a copy with the given fields replaced. An omitted argument keeps the field;
7
+ /// `.some(nil)` clears it. `children` is required, so it can only be replaced.
10
8
  func copying(
11
9
  title: String?? = nil,
12
10
  style: SectionStyle?? = nil,
@@ -21,8 +19,7 @@ extension Section {
21
19
  )
22
20
  }
23
21
 
24
- /// One untitled section — the canonical wrap of a flat track list
25
- /// (`children` authoring sugar, search results — ADR 0010).
22
+ /// The canonical wrap of a flat track list into one section (ADR 0010).
26
23
  static func untitled(_ children: [Track]) -> Section {
27
24
  Section(title: nil, style: nil, path: nil, children: children)
28
25
  }
@@ -1,11 +1,11 @@
1
1
  import Foundation
2
2
 
3
3
  extension String {
4
- /// Re-decodes an ICY `StreamTitle` that AVFoundation decoded as Latin-1 with the
5
- /// charset the track declares. AVFoundation keeps no raw bytes, so the tell is the
6
- /// shape: every scalar at or below U+00FF with at least one at or above U+0080. A
7
- /// title already decoded to another script contains higher scalars and is returned
8
- /// as is, as is pure ASCII, an unknown charset, or bytes the charset cannot decode.
4
+ /// Re-decodes an ICY title that AVFoundation decoded as Latin-1, using the IANA `charset`
5
+ /// the track declares. AVFoundation keeps no raw bytes, so a Latin-1 decode is recognised
6
+ /// by its shape: every scalar at or below U+00FF and at least one at or above U+0080.
7
+ /// Returns `self` for pure ASCII, a title with higher scalars (already decoded), an unknown
8
+ /// charset, or bytes the charset cannot decode.
9
9
  func redecodingIcyTitle(charset: String) -> String {
10
10
  var high = false
11
11
  for scalar in unicodeScalars {
@@ -5,27 +5,23 @@ import AVFoundation
5
5
  #endif
6
6
 
7
7
  extension TimedMetadata {
8
- /// Creates TimedMetadata from AVMetadataItem array, detecting the metadata format.
9
- /// `icyCharset` is the track's declared charset for ICY titles AVFoundation
10
- /// decoded as Latin-1; it never touches ID3 or common metadata.
8
+ /// Reads the ICY items if there are any, else the ID3 items, else the common identifiers;
9
+ /// nil when the chosen set yields no field. `icyCharset` re-decodes an ICY title AVFoundation
10
+ /// decoded as Latin-1 and never applies to ID3 or common metadata.
11
11
  static func from(items: [AVMetadataItem], icyCharset: String? = nil) -> TimedMetadata? {
12
- // Check for ICY metadata (Shoutcast/Icecast streams)
13
12
  let icyItems = items.filter { $0.keySpace == .icy }
14
13
  if !icyItems.isEmpty {
15
14
  return fromIcy(items: icyItems, icyCharset: icyCharset)
16
15
  }
17
16
 
18
- // Check for ID3 metadata (MP3)
19
17
  let id3Items = items.filter { $0.keySpace == .id3 }
20
18
  if !id3Items.isEmpty {
21
19
  return fromId3(items: id3Items)
22
20
  }
23
21
 
24
- // Fall back to common metadata identifiers (covers QuickTime, iTunes, etc.)
25
22
  return fromCommon(items: items)
26
23
  }
27
24
 
28
- /// Creates TimedMetadata from ICY (Shoutcast/Icecast) metadata.
29
25
  static func fromIcy(items: [AVMetadataItem], icyCharset: String? = nil) -> TimedMetadata? {
30
26
  var title: String?
31
27
 
@@ -45,7 +41,6 @@ extension TimedMetadata {
45
41
  )
46
42
  }
47
43
 
48
- /// Creates TimedMetadata from ID3 metadata (MP3).
49
44
  static func fromId3(items: [AVMetadataItem]) -> TimedMetadata? {
50
45
  var title: String?
51
46
  var artist: String?
@@ -61,10 +56,11 @@ extension TimedMetadata {
61
56
  artist = item.stringValue
62
57
  case .id3MetadataAlbumTitle, .id3MetadataOriginalAlbumTitle:
63
58
  album = item.stringValue
59
+ // TDRC (ID3v2.4) wins over TYER (ID3v2.3) whichever comes first.
64
60
  case .id3MetadataRecordingTime:
65
- date = item.stringValue // TDRC takes precedence (ID3v2.4, more precise)
61
+ date = item.stringValue
66
62
  case .id3MetadataYear:
67
- date = date ?? item.stringValue // TYER only if TDRC not found (ID3v2.3)
63
+ date = date ?? item.stringValue
68
64
  case .id3MetadataContentType:
69
65
  genre = item.stringValue
70
66
  default:
@@ -82,7 +78,6 @@ extension TimedMetadata {
82
78
  )
83
79
  }
84
80
 
85
- /// Creates TimedMetadata from common metadata identifiers.
86
81
  static func fromCommon(items: [AVMetadataItem]) -> TimedMetadata? {
87
82
  var title: String?
88
83
  var artist: String?
@@ -101,7 +96,6 @@ extension TimedMetadata {
101
96
  case .commonIdentifierCreationDate:
102
97
  date = item.stringValue
103
98
  default:
104
- // Check by commonKey for broader compatibility
105
99
  if let commonKey = item.commonKey {
106
100
  switch commonKey {
107
101
  case .commonKeyTitle:
@@ -2,9 +2,8 @@ import AVFoundation
2
2
  import Foundation
3
3
  import NitroModules
4
4
 
5
- /// Extension to make Nitro Track work with AVPlayer
6
5
  extension Track {
7
- /// Builds an `ImageSource` from the track's artwork fields, skipping SF Symbol strings.
6
+ /// `artworkSource` if set, else `artwork.url`; nil when that names an SF Symbol rather than an image.
8
7
  var artworkImageSource: ImageSource? {
9
8
  if let source = artworkSource {
10
9
  source
@@ -3,14 +3,8 @@
3
3
  #endif
4
4
 
5
5
  extension Track {
6
- /// Returns a copy of this Track with only the specified fields changed.
7
- ///
8
- /// Uses double-optional (`T??`) so callers can distinguish between:
9
- /// - Omitted argument → keep existing value
10
- /// - `.some(nil)` → set field to nil
11
- /// - `.some(value)` → set field to value
12
- ///
13
- /// `title` uses single-optional (`String?`) since it is non-optional on Track.
6
+ /// Returns a copy with only the given fields changed. For a `T??` argument, omitting it keeps
7
+ /// the field and `.some(nil)` clears it; `title` is non-optional on Track, so it can't be cleared.
14
8
  func copying(
15
9
  id: String?? = nil,
16
10
  path: String?? = nil,
@@ -2,15 +2,10 @@
2
2
  import NitroModules
3
3
  #endif
4
4
 
5
- /// A track's identity: the opaque `id` when present (non-blank), else the
6
- /// playable `src`. Two tracks refer to the same item iff their identities are
7
- /// equal. Browsable-only tracks (neither `id` nor `src`) have no identity —
8
- /// they are addressed by `path` instead.
9
- ///
10
- /// This is THE comparison rule for favorites matching, section scoping,
11
- /// skip-in-place, the car now-playing row indicator, and the contextual
12
- /// `__trackId` — see ADR 0008. Mirrors `trackIdentity` on the TS side.
13
5
  extension Track {
6
+ /// `id` when non-empty, else `src`; nil for a browsable-only track, which is addressed by `path`.
7
+ /// Two tracks are the same item iff their identities are equal. Must match the TS and Android
8
+ /// rule: docs/adr/0008-track-identity-is-id-falling-back-to-src.md.
14
9
  var identity: String? {
15
10
  if let id, !id.isEmpty { return id }
16
11
  return src
@@ -18,7 +13,7 @@ extension Track {
18
13
  }
19
14
 
20
15
  extension Track {
21
- /// Playable and not Disabled: a track the library may queue and play.
16
+ /// Has a `src` and isn't disabled: a track the library may queue and play.
22
17
  var isPlayable: Bool {
23
18
  src != nil && disabled != true
24
19
  }
@@ -5,7 +5,9 @@ import AVFoundation
5
5
  #endif
6
6
 
7
7
  extension TrackMetadata {
8
- /// Creates TrackMetadata from AVMetadataItem array using common identifiers.
8
+ /// Reads common, ID3 and iTunes metadata items. A common identifier wins over the other key
9
+ /// spaces; among those, the first item to set a field keeps it. `creationYear` falls back to the
10
+ /// first four characters of `creationDate`.
9
11
  static func from(items: [AVMetadataItem]) -> TrackMetadata {
10
12
  var title: String?
11
13
  var artist: String?
@@ -21,7 +23,6 @@ extension TrackMetadata {
21
23
  var creationYear: String?
22
24
 
23
25
  for item in items {
24
- // Try common identifiers first
25
26
  switch item.identifier {
26
27
  case .commonIdentifierTitle:
27
28
  title = item.stringValue
@@ -37,7 +38,6 @@ extension TrackMetadata {
37
38
  break
38
39
  }
39
40
 
40
- // Also check commonKey for broader compatibility
41
41
  if let commonKey = item.commonKey {
42
42
  switch commonKey {
43
43
  case .commonKeyTitle:
@@ -59,29 +59,27 @@ extension TrackMetadata {
59
59
  }
60
60
  }
61
61
 
62
- // Check ID3-specific identifiers for additional fields
63
62
  if item.keySpace == .id3, let key = item.key as? String {
64
63
  switch key {
65
- case "TIT3": // Subtitle
64
+ case "TIT3":
66
65
  subtitle = subtitle ?? item.stringValue
67
- case "TRCK": // Track number
66
+ case "TRCK":
68
67
  trackNumber = trackNumber ?? item.stringValue
69
- case "TCOM": // Composer
68
+ case "TCOM":
70
69
  composer = composer ?? item.stringValue
71
- case "TPE3": // Conductor
70
+ case "TPE3":
72
71
  conductor = conductor ?? item.stringValue
73
- case "TCON": // Content type (genre)
72
+ case "TCON":
74
73
  genre = genre ?? item.stringValue
75
- case "TDRC": // Recording time (ID3v2.4)
74
+ case "TDRC": // ID3v2.4 recording time; v2.3 has only TYER, the year
76
75
  creationDate = creationDate ?? item.stringValue
77
- case "TYER": // Year (ID3v2.3)
76
+ case "TYER":
78
77
  creationYear = creationYear ?? item.stringValue
79
78
  default:
80
79
  break
81
80
  }
82
81
  }
83
82
 
84
- // Check iTunes-specific identifiers
85
83
  switch item.identifier {
86
84
  case .iTunesMetadataSongName:
87
85
  title = title ?? item.stringValue
@@ -104,7 +102,6 @@ extension TrackMetadata {
104
102
  }
105
103
  }
106
104
 
107
- // Extract year from creationDate if creationYear not set
108
105
  if creationYear == nil, let date = creationDate, date.count >= 4 {
109
106
  creationYear = String(date.prefix(4))
110
107
  }
@@ -1,26 +1,18 @@
1
1
  import UIKit
2
2
 
3
3
  extension UIApplication {
4
- /// The scene showing the app's own UI: the foreground-active one, else any
5
- /// connected window scene. Nil when the app has no UI scene at all (running
6
- /// headless for CarPlay), which callers must handle rather than assume.
7
- ///
8
- /// Replaces the deprecated `UIScreen.main` / `keyWindow` idioms — and exists
9
- /// once because the walk was previously written out at each use, so the two
10
- /// copies had already drifted apart.
4
+ /// The foreground-active window scene, else any connected window scene. Nil when the app has
5
+ /// no UI scene at all (running headless for CarPlay).
11
6
  var activeWindowScene: UIWindowScene? {
12
7
  let scenes = connectedScenes.compactMap { $0 as? UIWindowScene }
13
8
  return scenes.first { $0.activationState == .foregroundActive } ?? scenes.first
14
9
  }
15
10
  }
16
11
 
17
- /// The scale to rasterise at for the app's own screen.
18
- ///
19
- /// `UITraitCollection.current` rather than the deprecated `UIScreen.main.scale`
20
- /// (also unavailable on visionOS, which the podspec targets): on the main actor
21
- /// it already reflects the environment being rendered for. CarPlay surfaces do
22
- /// NOT use this — they rasterise at `carTraitCollection.displayScale`, the car
23
- /// screen's own scale.
12
+ /// The scale to rasterise at for the app's own screen. CarPlay surfaces use
13
+ /// `carTraitCollection.displayScale` instead.
14
+ // `UITraitCollection.current` reflects the environment being rendered for only on the main actor.
15
+ // Not `UIScreen.main.scale`: deprecated, and unavailable on visionOS, which the podspec targets.
24
16
  @MainActor
25
17
  var appDisplayScale: CGFloat {
26
18
  UITraitCollection.current.displayScale
@@ -1,19 +1,9 @@
1
1
  import Foundation
2
2
 
3
- /// Reading the `artwork` union, which is either one URL or a URL per appearance.
4
- ///
5
- /// Nitro surfaces it as `.first(String)` / `.second(ArtworkVariants)`. Call
6
- /// sites want one of two things — the URL to display, or both URLs so a
7
- /// `UIImageAsset` can adapt without re-fetching — so those are the only
8
- /// accessors here, and nothing below the boundary repeats the unwrap.
9
- ///
10
- /// Deliberately Foundation-only: this is part of the SPM testable target, which
11
- /// also builds for macOS, so it cannot reach for `UIUserInterfaceStyle` to name
12
- /// an appearance. Picking between the two URLs is CarPlay's job anyway — it
13
- /// registers both and lets UIKit choose.
3
+ // Foundation only: this file is in the SPM test target, which also builds for macOS, so it
4
+ // cannot use UIKit to pick an appearance. CarPlay registers both URLs and lets UIKit choose.
14
5
  extension Variant_String_ArtworkVariants {
15
- /// Both URLs, when the track ships a pair; `nil` for a single URL, which
16
- /// needs no per-appearance handling.
6
+ /// Both URLs when the artwork is a light/dark pair; `nil` for a single URL.
17
7
  var variants: ArtworkVariants? {
18
8
  switch self {
19
9
  case .first: nil
@@ -21,13 +11,9 @@ extension Variant_String_ArtworkVariants {
21
11
  }
22
12
  }
23
13
 
24
- /// The URL to use where appearance is unknown or does not apply — now-playing
25
- /// metadata, JS-facing values, the artwork transform pipeline.
26
- ///
27
- /// Resolves a pair to its dark URL. CarPlay dark is the common case, Android
28
- /// Auto is dark-only, and it is what a single-URL track would have shipped
29
- /// anyway — so a caller that cannot express appearance gets the same image it
30
- /// got before pairs existed.
14
+ /// The URL for where appearance is unknown or does not apply (now-playing metadata, values
15
+ /// sent to JS, the artwork transform). A pair resolves to its dark URL: CarPlay is usually
16
+ /// dark, Android Auto is dark-only, and it is the image a single-URL track ships.
31
17
  var url: String {
32
18
  switch self {
33
19
  case let .first(url): url
@@ -36,9 +22,9 @@ extension Variant_String_ArtworkVariants {
36
22
  }
37
23
  }
38
24
 
25
+ // The Nitro-generated enum declares no Equatable conformance; `TabBarEntries.same` and the
26
+ // test stubs' synthesised `Track: Equatable` need it.
39
27
  extension Variant_String_ArtworkVariants: Equatable {
40
- /// Needed by `TabBarEntries.same`, and by the synthesised `Track: Equatable`
41
- /// in the test stubs; the generated enum declares no conformance itself.
42
28
  public static func == (lhs: Self, rhs: Self) -> Bool {
43
29
  switch (lhs, rhs) {
44
30
  case let (.first(l), .first(r)): l == r