You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I decided to try to build it from source (after uninstalling either .snap or .deb) utilizing:
node v20.11.1
npm v10.2.4
And after tossing some Logger.log messages inside the src.scripts.discord.ts I was noticing that it seems to be resolving itself mostly!
The one thing is that I guess on launch, if a music file was already present in tidal hifi, like picking up where the user was previously listening to the track, I was catching a lot of logs w/ my custom log entry of media is paused... but the media wasn't paused it was playing.
In the discord.ts I had just modified this chunk to see some log data:
constgetActivity=(): Presence=>{constpresence: Presence={ ...defaultPresence};if(mediaInfo.status===MediaStatus.paused){Logger.log("media is paused...")presence.details=settingsStore.get<string,string>(settings.discord.idleText)??"Browsing Tidal";}else{constshowSong=settingsStore.get<string,boolean>(settings.discord.showSong)??false;Logger.log("show song is?: "+showSong);if(showSong){Logger.log("show song is present --- : "+showSong)const{ includeTimestamps, detailsPrefix, buttonText }=getFromStore();includeTimeStamps(includeTimestamps);setPresenceFromMediaInfo(detailsPrefix,buttonText);}else{presence.details=settingsStore.get<string,string>(settings.discord.usingText)??"Playing media on TIDAL";Logger.log("showing the details of the precense but no song? ...");}}returnpresence;functiongetFromStore(){constincludeTimestamps=settingsStore.get<string,boolean>(settings.discord.includeTimestamps)??true;constdetailsPrefix=settingsStore.get<string,string>(settings.discord.detailsPrefix)??"Listening to ";constbuttonText=settingsStore.get<string,string>(settings.discord.buttonText)??"Play on TIDAL";Logger.log("detailsPrefix is: "+detailsPrefix);return{ includeTimestamps, detailsPrefix, buttonText };}functionsetPresenceFromMediaInfo(detailsPrefix: any,buttonText: any){if(mediaInfo.url){Logger.log("Here is mediaInfo.url: "+mediaInfo.url);presence.details=`${detailsPrefix}${mediaInfo.title}`;presence.state=mediaInfo.artists ? mediaInfo.artists : "unknown artist(s)";presence.largeImageKey=mediaInfo.image;if(mediaInfo.album){presence.largeImageText=mediaInfo.album;}presence.buttons=[{label: buttonText,url: mediaInfo.url}];}else{presence.details=`Watching ${mediaInfo.title}`;presence.state=mediaInfo.artists;}}functionincludeTimeStamps(includeTimestamps: any){if(includeTimestamps){constcurrentSeconds=timeToSeconds(mediaInfo.current.split(":"));constdurationSeconds=timeToSeconds(mediaInfo.duration.split(":"));constdate=newDate();constnow=(date.getTime()/1000)|0;constremaining=date.setSeconds(date.getSeconds()+(durationSeconds-currentSeconds));presence.startTimestamp=now;presence.endTimestamp=remaining;}}};/** * Set up the discord rpc and listen on globalEvents.updateInfo */exportconstinitRPC=()=>{rpc=newClient({transport: "ipc"});rpc.login({ clientId }).then(()=>{rpc.on("ready",()=>{Logger.log("rpc is ready...")rpc.setActivity(getActivity());});ipcMain.on(globalEvents.updateInfo,observer);},()=>{Logger.log("Can't connect to Discord, is it running?");});};
Workaround
Even if it is displaying media is paused when the media is playing at first launch, the moment you switch to another track it resolves itself to actually show that track information in Discord accurately.
Questions
I guess I'm curious as to what the difference is between running this from source off the master branch in comparison to running this off a .deb / .snap package.
As with running from an installed .deb package in my system, for some reason, Discord isn't really getting any updates from Tidal HiFi, it just seems to hang at "Browsing Tidal".
Additional context, Discord is installed on my little rig via just the package manager.
I think for now, just doing an npm compile & npm run start alleviates Discord from not seeing updates - wondering though if it's possible to debug the .deb package to see what differences might be in the loadout.
The text was updated successfully, but these errors were encountered:
Will have to look at the startup sequence & variable instantiation 😄.
Thanks for the solid issue!
Luckily it doesn't affect anything after the first song.
I guess I'm curious as to what the difference is between running this from source off the master branch in comparison to running this off a .deb / .snap package.
As with running from an installed .deb package in my system, for some reason, Discord isn't really getting any updates from Tidal HiFi, it just seems to hang at "Browsing Tidal".
Snaps are sandboxed by default and need to be allowed to talk to system interfaces.
Hey there, this project is awesome!
I was noticing some strange issues with Tidal HiFi updating Discord with either a:
On my loadout (system) of:
I decided to try to build it from source (after uninstalling either .snap or .deb) utilizing:
And after tossing some
Logger.log
messages inside thesrc.scripts.discord.ts
I was noticing that it seems to be resolving itself mostly!The one thing is that I guess on launch, if a music file was already present in tidal hifi, like picking up where the user was previously listening to the track, I was catching a lot of logs w/ my custom log entry of
media is paused...
but the media wasn't paused it was playing.In the
discord.ts
I had just modified this chunk to see some log data:Workaround
Even if it is displaying media is paused when the media is playing at first launch, the moment you switch to another track it resolves itself to actually show that track information in Discord accurately.
Questions
master
branch in comparison to running this off a .deb / .snap package.As with running from an installed .deb package in my system, for some reason, Discord isn't really getting any updates from Tidal HiFi, it just seems to hang at "Browsing Tidal".
Additional context, Discord is installed on my little rig via just the package manager.
I think for now, just doing an
npm compile
&npm run start
alleviates Discord from not seeing updates - wondering though if it's possible to debug the .deb package to see what differences might be in the loadout.The text was updated successfully, but these errors were encountered: