1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-29 14:32:08 -04:00

feat(mpris): allow excluding specific media players by identity (#2712)

* feat(mpris): allow excluding specific media players by identity

* chore(translation): update settings search index and clean trailing whitespace
This commit is contained in:
Huỳnh Thiện Lộc
2026-06-29 23:01:19 +07:00
committed by GitHub
parent a874f76d72
commit de3e8cffa0
6 changed files with 238 additions and 2 deletions
+27
View File
@@ -448,6 +448,7 @@ Singleton {
property string audioScrollMode: "volume"
property int audioWheelScrollAmount: 5
property bool audioDeviceScrollVolumeEnabled: false
property var mediaExcludePlayers: []
property bool clockCompactMode: false
property int focusedWindowSize: 1
property bool focusedWindowCompactMode: false
@@ -3062,6 +3063,32 @@ Singleton {
saveSettings();
}
function addMediaExcludePlayer(identity) {
if (identity === undefined || identity === null)
return;
var normalizedIdentity = identity.toString().trim().toLowerCase();
if (!normalizedIdentity)
return;
var list = mediaExcludePlayers ? mediaExcludePlayers.slice() : [];
var normalizedList = list.map(function(id) {
return id ? id.toString().trim().toLowerCase() : "";
});
if (normalizedList.indexOf(normalizedIdentity) >= 0)
return;
list.push(normalizedIdentity);
mediaExcludePlayers = list;
saveSettings();
}
function removeMediaExcludePlayer(index) {
var list = mediaExcludePlayers ? mediaExcludePlayers.slice() : [];
if (index < 0 || index >= list.length)
return;
list.splice(index, 1);
mediaExcludePlayers = list;
saveSettings();
}
property bool _pendingExpandNotificationRules: false
property int _pendingNotificationRuleIndex: -1