Add ignore options for Kizzy and Metrolist activities
Allow users to prevent activity display when Kizzy or Metrolist is playing.
This commit is contained in:
parent
d31f1c128d
commit
866fa06212
3 changed files with 52 additions and 1 deletions
|
|
@ -50,6 +50,8 @@ const Constants = {
|
|||
listeningTo: true,
|
||||
ignoreSpotify: true,
|
||||
ignoreYouTubeMusic: true,
|
||||
ignoreKizzy: true,
|
||||
ignoreMetrolist: true,
|
||||
verboseLogging: false,
|
||||
service: undefined as ServiceType | undefined,
|
||||
librefmUsername: "",
|
||||
|
|
|
|||
|
|
@ -96,6 +96,34 @@ class PluginManager {
|
|||
setDebugInfo("isYouTubeMusicIgnored", false);
|
||||
}
|
||||
|
||||
// skip if Kizzy is playing and user wants to ignore it
|
||||
if (currentSettings.ignoreKizzy) {
|
||||
const kizzyActivity = SelfPresenceStore.findActivity(
|
||||
(act) => act.name && act.name.toLowerCase() === "kizzy",
|
||||
);
|
||||
if (kizzyActivity) {
|
||||
logVerbose("Kizzy is currently playing, clearing activity");
|
||||
setDebugInfo("isKizzyIgnored", true);
|
||||
clearActivity();
|
||||
return;
|
||||
}
|
||||
setDebugInfo("isKizzyIgnored", false);
|
||||
}
|
||||
|
||||
// skip if Metrolist is playing and user wants to ignore it
|
||||
if (currentSettings.ignoreMetrolist) {
|
||||
const metrolistActivity = SelfPresenceStore.findActivity(
|
||||
(act) => act.name && act.name.toLowerCase() === "metrolist",
|
||||
);
|
||||
if (metrolistActivity) {
|
||||
logVerbose("Metrolist is currently playing, clearing activity");
|
||||
setDebugInfo("isMetrolistIgnored", true);
|
||||
clearActivity();
|
||||
return;
|
||||
}
|
||||
setDebugInfo("isMetrolistIgnored", false);
|
||||
}
|
||||
|
||||
incrementApiCall();
|
||||
const lastTrack = await serviceFactory
|
||||
.getCurrentService()
|
||||
|
|
|
|||
|
|
@ -367,6 +367,27 @@ function DisplaySettingsPage() {
|
|||
forceUpdate();
|
||||
}}
|
||||
/>
|
||||
<TableSwitchRow
|
||||
label="Ignore Kizzy"
|
||||
subLabel="Don't show activity when Kizzy is playing"
|
||||
value={get("ignoreKizzy", Constants.DEFAULT_SETTINGS.ignoreKizzy)}
|
||||
onValueChange={(value: boolean) => {
|
||||
set("ignoreKizzy", value);
|
||||
forceUpdate();
|
||||
}}
|
||||
/>
|
||||
<TableSwitchRow
|
||||
label="Ignore Metrolist"
|
||||
subLabel="Don't show activity when Metrolist is playing"
|
||||
value={get(
|
||||
"ignoreMetrolist",
|
||||
Constants.DEFAULT_SETTINGS.ignoreMetrolist,
|
||||
)}
|
||||
onValueChange={(value: boolean) => {
|
||||
set("ignoreMetrolist", value);
|
||||
forceUpdate();
|
||||
}}
|
||||
/>
|
||||
</TableRowGroup>
|
||||
</Stack>
|
||||
<RN.View style={{ height: 64 }} />
|
||||
|
|
@ -568,7 +589,7 @@ export default function Settings() {
|
|||
subLabel="Show off your music status from multiple services"
|
||||
/>
|
||||
<TableRow label="Author" subLabel="kmmiio99o" />
|
||||
<TableRow label="Version" subLabel="1.1.1" />
|
||||
<TableRow label="Version" subLabel="1.2.0" />
|
||||
</TableRowGroup>
|
||||
</Stack>
|
||||
<RN.View style={{ height: 64 }} />
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue