mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Merge pull request #490 from damian-ds7/media-check-ignored-players
Add a check if blacklisted before adding to specific or generic players
This commit is contained in:
@@ -38,12 +38,19 @@ Singleton {
|
||||
let allPlayers = Mpris.players.values
|
||||
let finalPlayers = []
|
||||
const genericBrowsers = ["firefox", "chromium", "chrome"]
|
||||
const blacklist = (Settings.data.audio && Settings.data.audio.mprisBlacklist) ? Settings.data.audio.mprisBlacklist : []
|
||||
|
||||
// Separate players into specific and generic lists
|
||||
let specificPlayers = []
|
||||
let genericPlayers = []
|
||||
for (var i = 0; i < allPlayers.length; i++) {
|
||||
const identity = String(allPlayers[i].identity || "").toLowerCase()
|
||||
const match = blacklist.find(b => {
|
||||
const s = String(b || "").toLowerCase()
|
||||
return s && (identity.includes(s))
|
||||
})
|
||||
if (match)
|
||||
continue
|
||||
if (genericBrowsers.some(b => identity.includes(b))) {
|
||||
genericPlayers.push(allPlayers[i])
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user