Skip to content

Commit 1b0796b

Browse files
authored
feat(Deezer): add option to hide activity when paused (#10336)
1 parent 6969e44 commit 1b0796b

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

websites/D/Deezer/metadata.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
},
2626
"url": "www.deezer.com",
2727
"regExp": "^https?[:][/][/](www[.])?deezer[.]com[/]",
28-
"version": "2.4.1",
28+
"version": "2.4.2",
2929
"logo": "https://cdn.rcd.gg/PreMiD/websites/D/Deezer/assets/logo.png",
3030
"thumbnail": "https://cdn.rcd.gg/PreMiD/websites/D/Deezer/assets/thumbnail.png",
3131
"color": "#a238ff",
@@ -57,7 +57,12 @@
5757
"icon": "fad fa-user-large",
5858
"value": true
5959
},
60-
60+
{
61+
"id": "hidePaused",
62+
"title": "Hide Paused",
63+
"icon": "fad fa-pause-circle",
64+
"value": false
65+
},
6166
{
6267
"id": "showBrowsing",
6368
"title": "Show Browsing Info",

websites/D/Deezer/presence.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ presence.on('UpdateData', async () => {
4141
let strings = await getStrings()
4242
let paused = false
4343

44-
const [buttons, newLang, cover, browseInfo, artistAsTitle, showBrowsing] = await Promise.all([
44+
const [buttons, newLang, cover, browseInfo, artistAsTitle, showBrowsing, hidePaused] = await Promise.all([
4545
presence.getSetting<boolean>('buttons'),
4646
presence.getSetting<string>('lang').catch(() => 'en'),
4747
presence.getSetting<boolean>('cover'),
4848
presence.getSetting<boolean>('browseInfo'),
4949
presence.getSetting<boolean>('artistAsTitle'),
5050
presence.getSetting<boolean>('showBrowsing'),
51+
presence.getSetting<boolean>('hidePaused'),
5152
])
5253
const { pathname, hostname } = document.location
5354
const remainingTest = document.querySelector(
@@ -122,6 +123,9 @@ presence.on('UpdateData', async () => {
122123
if (document.querySelector('[data-testid="play_button_play"]'))
123124
paused = true
124125

126+
if (hidePaused && paused)
127+
return presence.clearActivity()
128+
125129
presenceData.details = document.querySelector(
126130
'[data-testid="item_title"]',
127131
)?.textContent

0 commit comments

Comments
 (0)