A single-commit snapshot of better-remote (7a8c4cb plus the uncommitted remote.js work), with every DRM-bearing piece replaced by a stub that keeps the same interface: - src/ui/drm.js: no DRM pipelines; needsDrm/isDrmUrl false, bestEncryptedTranscoding null, playDrmAudio rejects. The engine switcher and drmVjs* helpers stay as no-ops. - src/electron/drm.ts: initCdm/setupLicenseCors no-ops; the drm:license and api:stream:drm-info IPC handlers reject with "DRM is not available". - src/api/soundcloud.ts: resolveEncryptedStream keeps its signature, rejects. - src/electron/main.ts: license host dropped from the header rewrite. - src/ui/pb-lease.js: the expiry self-check uses a placeholder URL instead of a captured DRM manifest URL (same policy values, still passes). - scripts/vmp-sign.js, forge.config.js vmpSign: Widevine signing skipped, so no castLabs EVS account is needed to run or package. - README: says DRM is stubbed here. Go+ tracks SoundCloud only serves encrypted are unplayable and skipped; previews and everything else play as before. No history: the private branches' DRM code is not reachable from this commit. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
98 lines
2.3 KiB
JavaScript
Executable File
98 lines
2.3 KiB
JavaScript
Executable File
const { Notification } = require('electron');
|
|
const { getSettings } = require('./settings.js');
|
|
|
|
function safe(str, fallback = 'Unknown') {
|
|
return (typeof str === 'string' && str.trim()) ? str.trim() : fallback;
|
|
}
|
|
|
|
function allowed(type) {
|
|
const s = getSettings();
|
|
if (!s.notificationsEnabled) return false;
|
|
return s.notificationTypes?.[type] !== false;
|
|
}
|
|
|
|
function showNowPlaying(title, artist) {
|
|
if (!allowed('nowPlaying')) return;
|
|
new Notification({
|
|
title: 'Now Playing',
|
|
body: `Song: ${safe(title)}\nArtist: ${safe(artist)}`,
|
|
silent: false
|
|
}).show();
|
|
}
|
|
|
|
function showPaused(title, artist) {
|
|
if (!allowed('paused')) return;
|
|
new Notification({
|
|
title: 'Paused',
|
|
body: `Song: ${safe(title)}\nArtist: ${safe(artist)}`,
|
|
silent: false
|
|
}).show();
|
|
}
|
|
|
|
function showLiked(title, artist) {
|
|
if (!allowed('liked')) return;
|
|
new Notification({
|
|
title: 'Liked Song',
|
|
body: `Song: ${safe(title)}\nArtist: ${safe(artist)}`,
|
|
silent: false
|
|
}).show();
|
|
}
|
|
|
|
function showUnliked(title, artist) {
|
|
if (!allowed('unliked')) return;
|
|
new Notification({
|
|
title: 'Unliked Song',
|
|
body: `Song: ${safe(title)}\nArtist: ${safe(artist)}`,
|
|
silent: false
|
|
}).show();
|
|
}
|
|
|
|
function showVerificationRequired() {
|
|
if (!allowed('verificationRequired')) return;
|
|
new Notification({
|
|
title: 'CrossSound — Verification Required',
|
|
body: 'SoundCloud is being a little fucking bitch again. Go verify so it can stop complaining...',
|
|
urgent: true,
|
|
silent: false
|
|
}).show();
|
|
}
|
|
|
|
function showTorStarted() {
|
|
if (!allowed('torStarted')) return;
|
|
new Notification({
|
|
title: 'Tor Started',
|
|
body: 'Tor is running. Traffic is now routed through the Tor network.',
|
|
silent: false
|
|
}).show();
|
|
}
|
|
|
|
function showTorStopped() {
|
|
if (!allowed('torStopped')) return;
|
|
new Notification({
|
|
title: 'Tor Stopped',
|
|
body: 'Tor has been stopped. Traffic is no longer routed through Tor.',
|
|
silent: false
|
|
}).show();
|
|
}
|
|
|
|
function showTorCrashed() {
|
|
if (!allowed('torCrashed')) return;
|
|
new Notification({
|
|
title: 'Tor Crashed',
|
|
body: 'Tor exited unexpectedly. The Tor toggle has been disabled.',
|
|
urgent: true,
|
|
silent: false
|
|
}).show();
|
|
}
|
|
|
|
module.exports = {
|
|
showNowPlaying,
|
|
showPaused,
|
|
showLiked,
|
|
showUnliked,
|
|
showVerificationRequired,
|
|
showTorStarted,
|
|
showTorStopped,
|
|
showTorCrashed,
|
|
};
|