Commit e993e957 authored by Kourser's avatar Kourser
Browse files

fix: fall back to the podcast artwork in the player and the mini bar

Both showed episode.imageURL and nothing else, but most feeds publish
artwork on the show rather than on each episode, so the player was a
blank placeholder for a reader who asked for "les affiches des podcasts
dans le lecteur".

The precedence here is deliberately the reverse of the cross-podcast
lists, which already fall back through AppModel.artworkURL(for:): there
the show's image is what identifies a row, while in the player the
episode's own art is the better picture whenever a feed bothers to
publish one.

Verified on an iOS 26 simulator with episode.imageURL nulled out — the
reported case — in both the mini bar and the full-screen player.

Co-Authored-By: default avatarClaude Opus 5 <noreply@anthropic.com>
parent fc77469b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -7,6 +7,13 @@ adopte le [versionnage sémantique](https://semver.org/lang/fr/).

## [Non publié]

### Corrigé
- **iOS — affiche manquante dans le lecteur** : la plupart des flux ne publient
  d'affiche qu'au niveau du podcast, pas par épisode. Le lecteur et la barre de
  lecture n'utilisaient que celle de l'épisode et restaient donc vides. Ils
  retombent maintenant sur l'affiche du podcast, tout en gardant celle de
  l'épisode quand le flux en fournit une.

### Modifié
- **Synchronisation et flux automatiques** : la synchronisation ne partait qu'en
  appuyant sur « Synchroniser », et les flux n'étaient rafraîchis que par un
+5 −1
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ import PlaybackKit
/// On macOS the transport is centred (the bar spans the whole window) and the
/// full player opens as a popover; on iOS it opens as a sheet.
struct NowPlayingBar: View {
    @Environment(AppModel.self) private var model
    @Environment(PlaybackController.self) private var playback
    @Environment(PlaybackSettings.self) private var settings
    @State private var showingPlayer = false
@@ -60,7 +61,10 @@ struct NowPlayingBar: View {

    private func info(_ episode: Episode) -> some View {
        HStack(spacing: 14) {
            ArtworkView(url: episode.imageURL, size: 44)
            // Same fallback as the full player: most feeds only publish
            // artwork at the podcast level, and a bare placeholder next to the
            // title looks like a loading failure.
            ArtworkView(url: episode.imageURL ?? model.artworkURL(for: episode), size: 44)

            VStack(alignment: .leading, spacing: 2) {
                Text(episode.title)
+12 −1
Original line number Diff line number Diff line
@@ -16,12 +16,23 @@ struct PlayerView: View {

    private static let rates: [Float] = [0.8, 1.0, 1.2, 1.5, 1.8, 2.0, 2.5, 3.0]

    private var artworkURL: URL? {
        guard let episode = playback.currentEpisode else { return nil }
        // Precedence is deliberately the reverse of the cross-podcast lists:
        // there the show's image is what identifies a row, here the episode's
        // own art is the better picture when a feed bothers to publish one.
        return episode.imageURL ?? model.artworkURL(for: episode)
    }

    var body: some View {
        VStack(spacing: 28) {
            header
            Spacer(minLength: 0)

            ArtworkView(url: playback.currentEpisode?.imageURL, size: 260)
            // Most feeds set artwork on the podcast, not per episode, so the
            // episode's own image is usually nil — hence a blank player. The
            // list rows already fall back to the podcast's image; do the same.
            ArtworkView(url: artworkURL, size: 260)
                .shadow(radius: 14, y: 8)

            Text(playback.currentEpisode?.title ?? "")