fix MPRIS bigints

This commit is contained in:
Ottomated 2024-05-18 18:03:24 -07:00
parent 9966561079
commit 9be601cf7f
3 changed files with 5 additions and 6 deletions

View File

@ -1 +0,0 @@
declare module "mpris-service";

View File

@ -23,8 +23,8 @@ function toMicroseconds(seconds: number) {
if (settingsStore.get(settings.mpris) && process.platform === "linux") { if (settingsStore.get(settings.mpris) && process.platform === "linux") {
try { try {
const player = Player({ const player = Player({
name: "tidal-hifi2", name: "tidal-hifi",
identity: "tidal-hifi2", identity: "tidal-hifi",
supportedUriSchemes: ["file"], supportedUriSchemes: ["file"],
supportedMimeTypes: [ supportedMimeTypes: [
"audio/mpeg", "audio/mpeg",
@ -34,7 +34,7 @@ if (settingsStore.get(settings.mpris) && process.platform === "linux") {
"audio/wav", "audio/wav",
], ],
supportedInterfaces: ["player"], supportedInterfaces: ["player"],
desktopEntry: "tidal-hifi2", desktopEntry: "tidal-hifi",
}); });
player.on("playPause", playPause); player.on("playPause", playPause);
player.on("next", next); player.on("next", next);
@ -47,7 +47,7 @@ if (settingsStore.get(settings.mpris) && process.platform === "linux") {
player.on("quit", app.quit); player.on("quit", app.quit);
player.getPosition = function () { player.getPosition = function () {
return toMicroseconds($tidalState.getState().currentTrack?.current ?? 0); return Number(toMicroseconds($tidalState.getState().currentTrack?.current ?? 0));
}; };
$tidalState.subscribe(async (state) => { $tidalState.subscribe(async (state) => {

View File

@ -43,7 +43,7 @@ declare module "mpris-service" {
playlists: string[]; playlists: string[];
activePlaylist: string; activePlaylist: string;
getPosition(): number | bigint; getPosition(): number;
seeked(): void; seeked(): void;
getTrackIndex(trackId: number): number; getTrackIndex(trackId: number): number;
getTrack(trackId: number): string; getTrack(trackId: number): string;