qs: add player blacklist to prevent unnecessary fetch
This commit is contained in:
@@ -1,26 +1,26 @@
|
|||||||
[Settings]
|
[Settings]
|
||||||
gtk-application-prefer-dark-theme=true
|
gtk-theme-name=catppuccin-mocha-blue-standard+default
|
||||||
gtk-button-images=true
|
gtk-icon-theme-name=Papirus
|
||||||
gtk-cursor-blink=true
|
gtk-font-name=Sarasa UI SC 10
|
||||||
gtk-cursor-blink-time=1000
|
|
||||||
gtk-cursor-theme-name=Bibata-Modern-Ice
|
gtk-cursor-theme-name=Bibata-Modern-Ice
|
||||||
gtk-cursor-theme-size=24
|
gtk-cursor-theme-size=24
|
||||||
gtk-decoration-layout=icon:minimize,maximize,close
|
gtk-toolbar-style=3
|
||||||
gtk-enable-animations=true
|
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
|
||||||
|
gtk-button-images=0
|
||||||
|
gtk-menu-images=0
|
||||||
gtk-enable-event-sounds=1
|
gtk-enable-event-sounds=1
|
||||||
gtk-enable-input-feedback-sounds=0
|
gtk-enable-input-feedback-sounds=0
|
||||||
gtk-font-name=Sarasa UI SC, 10
|
gtk-xft-antialias=1
|
||||||
gtk-icon-theme-name=Papirus
|
gtk-xft-hinting=1
|
||||||
gtk-menu-images=true
|
gtk-xft-hintstyle=hintslight
|
||||||
|
gtk-xft-rgba=rgb
|
||||||
|
gtk-application-prefer-dark-theme=1
|
||||||
|
gtk-cursor-blink=true
|
||||||
|
gtk-cursor-blink-time=1000
|
||||||
|
gtk-decoration-layout=icon:minimize,maximize,close
|
||||||
|
gtk-enable-animations=true
|
||||||
gtk-modules=colorreload-gtk-module:appmenu-gtk-module
|
gtk-modules=colorreload-gtk-module:appmenu-gtk-module
|
||||||
gtk-primary-button-warps-slider=true
|
gtk-primary-button-warps-slider=true
|
||||||
gtk-shell-shows-menubar=1
|
gtk-shell-shows-menubar=1
|
||||||
gtk-sound-theme-name=ocean
|
gtk-sound-theme-name=ocean
|
||||||
gtk-theme-name=catppuccin-mocha-blue-standard+default
|
|
||||||
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
|
|
||||||
gtk-toolbar-style=3
|
|
||||||
gtk-xft-antialias=1
|
|
||||||
gtk-xft-dpi=122880
|
gtk-xft-dpi=122880
|
||||||
gtk-xft-hinting=1
|
|
||||||
gtk-xft-hintstyle=hintslight
|
|
||||||
gtk-xft-rgba=rgb
|
|
||||||
|
|||||||
@@ -1,14 +1,7 @@
|
|||||||
[Settings]
|
[Settings]
|
||||||
gtk-application-prefer-dark-theme=true
|
gtk-theme-name=catppuccin-mocha-blue-standard+default
|
||||||
gtk-cursor-blink=true
|
gtk-icon-theme-name=Papirus
|
||||||
gtk-cursor-blink-time=1000
|
gtk-font-name=Sarasa UI SC 10
|
||||||
gtk-cursor-theme-name=Bibata-Modern-Ice
|
gtk-cursor-theme-name=Bibata-Modern-Ice
|
||||||
gtk-cursor-theme-size=24
|
gtk-cursor-theme-size=24
|
||||||
gtk-decoration-layout=icon:minimize,maximize,close
|
gtk-application-prefer-dark-theme=1
|
||||||
gtk-enable-animations=true
|
|
||||||
gtk-font-name=Sarasa UI SC, 10
|
|
||||||
gtk-icon-theme-name=Papirus
|
|
||||||
gtk-primary-button-warps-slider=true
|
|
||||||
gtk-sound-theme-name=ocean
|
|
||||||
gtk-theme-name=catppuccin-mocha-blue-standard+default
|
|
||||||
gtk-xft-dpi=122880
|
|
||||||
|
|||||||
@@ -19,6 +19,13 @@ Singleton {
|
|||||||
// Player state
|
// Player state
|
||||||
// this property will be updated regardless of shouldRun for simplicity
|
// this property will be updated regardless of shouldRun for simplicity
|
||||||
property int internalPosition: 0
|
property int internalPosition: 0
|
||||||
|
readonly property var playerBlacklist: [
|
||||||
|
"mpv",
|
||||||
|
"firefox",
|
||||||
|
"zen",
|
||||||
|
"chromium",
|
||||||
|
"chrome"
|
||||||
|
]
|
||||||
// Reference counting
|
// Reference counting
|
||||||
property var _registered: ({
|
property var _registered: ({
|
||||||
})
|
})
|
||||||
@@ -63,6 +70,14 @@ Singleton {
|
|||||||
root.isFetchingLyrics = false;
|
root.isFetchingLyrics = false;
|
||||||
return ;
|
return ;
|
||||||
} else {
|
} else {
|
||||||
|
// lyricsProcess.request(MediaService.currentPlayer.dbusName);
|
||||||
|
for (const player of root.playerBlacklist) {
|
||||||
|
if (MediaService.currentPlayer.dbusName.toLowerCase().includes(player)) {
|
||||||
|
Logger.d("Lyrics", "Player is blacklisted, skipping lyrics fetch:", MediaService.currentPlayer.dbusName);
|
||||||
|
root.isFetchingLyrics = false;
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
}
|
||||||
lyricsProcess.request(MediaService.currentPlayer.dbusName);
|
lyricsProcess.request(MediaService.currentPlayer.dbusName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -96,6 +111,14 @@ Singleton {
|
|||||||
newLyrics.sort((a, b) => {
|
newLyrics.sort((a, b) => {
|
||||||
return a.time - b.time;
|
return a.time - b.time;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Special case when first lyric dosen't start at 0:00
|
||||||
|
if (newLyrics.length > 0 && newLyrics[0].time > 0) {
|
||||||
|
newLyrics.unshift({
|
||||||
|
"time": 0,
|
||||||
|
"line": ""
|
||||||
|
});
|
||||||
|
}
|
||||||
root.lyrics.clear();
|
root.lyrics.clear();
|
||||||
root.lyrics.append(newLyrics);
|
root.lyrics.append(newLyrics);
|
||||||
root.isFetchingLyrics = false;
|
root.isFetchingLyrics = false;
|
||||||
@@ -129,7 +152,6 @@ Singleton {
|
|||||||
}
|
}
|
||||||
if (root.currentIndex !== bestMatch)
|
if (root.currentIndex !== bestMatch)
|
||||||
root.currentIndex = bestMatch;
|
root.currentIndex = bestMatch;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function increaseOffset() {
|
function increaseOffset() {
|
||||||
|
|||||||
Reference in New Issue
Block a user