Merge branch 'main' into sdfs
This commit is contained in:
commit
ab4070aac9
5 changed files with 27 additions and 5 deletions
11
.github/workflows/check-format.yml
vendored
11
.github/workflows/check-format.yml
vendored
|
|
@ -7,9 +7,8 @@ on:
|
|||
pull_request:
|
||||
|
||||
jobs:
|
||||
check-format:
|
||||
check-qml:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
container:
|
||||
image: ghcr.io/${{ github.repository_owner }}/shell-arch-env:latest
|
||||
|
||||
|
|
@ -24,6 +23,14 @@ jobs:
|
|||
end
|
||||
python3 scripts/qml-lint-conventions.py
|
||||
|
||||
check-cpp:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/${{ github.repository_owner }}/shell-arch-env:latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Check C++ format
|
||||
shell: fish {0}
|
||||
run: |
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ Item {
|
|||
|
||||
anchors.fill: parent
|
||||
|
||||
source: Players.active?.trackArtUrl ?? "" // qmllint disable incompatible-type
|
||||
source: Players.getArtUrl(Players.active)
|
||||
asynchronous: true
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
sourceSize.width: width
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ Item {
|
|||
|
||||
anchors.fill: parent
|
||||
|
||||
source: Players.active?.trackArtUrl ?? "" // qmllint disable incompatible-type
|
||||
source: Players.getArtUrl(Players.active)
|
||||
asynchronous: true
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
sourceSize.width: width
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Item {
|
|||
|
||||
Image {
|
||||
anchors.fill: parent
|
||||
source: Players.active?.trackArtUrl ?? "" // qmllint disable incompatible-type
|
||||
source: Players.getArtUrl(Players.active)
|
||||
|
||||
asynchronous: true
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
|
|
|
|||
|
|
@ -20,6 +20,21 @@ Singleton {
|
|||
return alias?.to ?? player.identity;
|
||||
}
|
||||
|
||||
function getArtUrl(player: MprisPlayer): string {
|
||||
if (!player)
|
||||
return "";
|
||||
if (player.trackArtUrl)
|
||||
return player.trackArtUrl;
|
||||
|
||||
const url = player.metadata["xesam:url"] ?? "";
|
||||
if (url.startsWith("https://www.youtube.com/watch")) {
|
||||
// Fallback for youtube
|
||||
const id = url.match(/[?&]v=([\w-]{11})/)?.[1];
|
||||
return id ? `https://img.youtube.com/vi/${id}/hqdefault.jpg` : "";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
Connections {
|
||||
function onPostTrackChanged() {
|
||||
if (!Config.utilities.toasts.nowPlaying) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue