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:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check-format:
|
check-qml:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
container:
|
container:
|
||||||
image: ghcr.io/${{ github.repository_owner }}/shell-arch-env:latest
|
image: ghcr.io/${{ github.repository_owner }}/shell-arch-env:latest
|
||||||
|
|
||||||
|
|
@ -24,6 +23,14 @@ jobs:
|
||||||
end
|
end
|
||||||
python3 scripts/qml-lint-conventions.py
|
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
|
- name: Check C++ format
|
||||||
shell: fish {0}
|
shell: fish {0}
|
||||||
run: |
|
run: |
|
||||||
|
|
|
||||||
|
|
@ -181,7 +181,7 @@ Item {
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
source: Players.active?.trackArtUrl ?? "" // qmllint disable incompatible-type
|
source: Players.getArtUrl(Players.active)
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Image.PreserveAspectCrop
|
||||||
sourceSize.width: width
|
sourceSize.width: width
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ Item {
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
source: Players.active?.trackArtUrl ?? "" // qmllint disable incompatible-type
|
source: Players.getArtUrl(Players.active)
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Image.PreserveAspectCrop
|
||||||
sourceSize.width: width
|
sourceSize.width: width
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ Item {
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
source: Players.active?.trackArtUrl ?? "" // qmllint disable incompatible-type
|
source: Players.getArtUrl(Players.active)
|
||||||
|
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
fillMode: Image.PreserveAspectCrop
|
fillMode: Image.PreserveAspectCrop
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,21 @@ Singleton {
|
||||||
return alias?.to ?? player.identity;
|
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 {
|
Connections {
|
||||||
function onPostTrackChanged() {
|
function onPostTrackChanged() {
|
||||||
if (!Config.utilities.toasts.nowPlaying) {
|
if (!Config.utilities.toasts.nowPlaying) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue