mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-14 09:42:10 -04:00
try to handle image better
This commit is contained in:
@@ -128,17 +128,28 @@ Rectangle {
|
|||||||
source: activePlayer && activePlayer.trackArtUrl
|
source: activePlayer && activePlayer.trackArtUrl
|
||||||
|| lastValidArtUrl || ""
|
|| lastValidArtUrl || ""
|
||||||
onSourceChanged: {
|
onSourceChanged: {
|
||||||
if (activePlayer && activePlayer.trackArtUrl)
|
if (activePlayer && activePlayer.trackArtUrl
|
||||||
|
&& albumArt.status !== Image.Error)
|
||||||
lastValidArtUrl = activePlayer.trackArtUrl
|
lastValidArtUrl = activePlayer.trackArtUrl
|
||||||
}
|
}
|
||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Image.PreserveAspectCrop
|
||||||
smooth: true
|
smooth: true
|
||||||
cache: true
|
cache: true
|
||||||
|
asynchronous: true
|
||||||
|
onStatusChanged: {
|
||||||
|
if (status === Image.Error) {
|
||||||
|
console.warn("Failed to load album art:", source)
|
||||||
|
source = ""
|
||||||
|
if (activePlayer && activePlayer.trackArtUrl === source) {
|
||||||
|
lastValidArtUrl = ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: albumArt.status !== Image.Ready
|
visible: albumArt.status !== Image.Ready || !albumArt.source
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
DankIcon {
|
DankIcon {
|
||||||
|
|||||||
Reference in New Issue
Block a user