~jhodapp/ubuntu-settings-components/set-albumart-size-with-fallback-image

« back to all changes in this revision

Viewing changes to plugins/Ubuntu/Settings/Menus/MediaPlayerMenu.qml

  • Committer: Jim Hodapp
  • Date: 2016-06-16 15:10:41 UTC
  • Revision ID: jim.hodapp@canonical.com-20160616151041-m9t9nio5locbusgf
Make sure there's an image always loaded for album art, even when the thumbnailer couldn't display one.

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
                    fillMode: Image.PreserveAspectFit
88
88
                    sourceSize: Qt.size(width, height)
89
89
                    anchors.centerIn: parent
 
90
 
 
91
                    onStatusChanged: {
 
92
                        // FIXME: This currently results in no other images being able to be set
 
93
                        // for some reason. I believe there is a bug in indicator-sound as the
 
94
                        // artUrl from media-hub is still set from media-hub but does not appear
 
95
                        // to be reset by indicator-sound (or something else) as I see no evidence
 
96
                        // of the albumArtImage.status changing in this case.
 
97
                        if (albumArtImage.status === Image.Error) {
 
98
                            console.debug("Hit an error while loading image, using fallback image")
 
99
                            albumArtImage.source = "file:///usr/lib/arm-linux-gnueabihf/unity-scopes/mediascanner-music/album_missing.svg";
 
100
                        }
 
101
                    }
90
102
                }
91
103
            }
92
104