mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-29 22:42:11 -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:
@@ -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
|
||||
|
||||
|
||||
@@ -184,6 +184,7 @@ var SPEC = {
|
||||
audioScrollMode: { def: "volume" },
|
||||
audioWheelScrollAmount: { def: 5 },
|
||||
audioDeviceScrollVolumeEnabled: { def: false },
|
||||
mediaExcludePlayers: { def: [] },
|
||||
clockCompactMode: { def: false },
|
||||
focusedWindowCompactMode: { def: false },
|
||||
focusedWindowSize: { def: 1 },
|
||||
|
||||
Reference in New Issue
Block a user