TIDAL-Discord-Rich-Presence-UNOFFICIAL icon indicating copy to clipboard operation
TIDAL-Discord-Rich-Presence-UNOFFICIAL copied to clipboard

Implemented some changes and new features

Open ungive opened this issue 1 year ago • 7 comments

Hi there, thank you for your efforts in making this application!

In this pull request I have made the following changes, which adds a few enhancements:

Allow passing a custom application ID Allows the user to pass a custom Discord application ID, as an alternative to using the baked-in application ID. This has the benefit that you are not locked in to showing "Playing TIDAL" in your status, but you can create your own application, with a custom name, so it's up to you whatever it says after "Playing ...". Personally, I have made an application with the name "Music", with reads much more naturally as "Playing Music", which is a lot more similar to Spotify's "Listening to Spotify" (which unfortunately doesn't work, #77). I know that your application has assets, namely the pause icon, which is shown when the song is paused. I have removed this feature, as explained below, because I do not like that the status is showing when I'm not playing a song. grafik

Additionally you could change your application name to "Music" or to "Music on TIDAL", so that it reads more naturally with the word "Playing".

Only show status when a song is playing As the title says, the status is only shown when a song is actually playing. When the music is paused, the application transitions to an idle state for 5 seconds and then disconnects from the Discord API (removing the status entirely and any unnecessary connections that might otherwise idle forever). grafik

Always loop the remaining time The remaining time is simply looped when the user plays the song on repeat. Previously it was just stuck at 00:00.

Fix paused state after unpausing The tray menu would still show "Paused" after unpausing a song. This commit fixes that.

Fix missing album name The album name is not put from the API result into the Song datastructure. This commit fixes that (so that we can use the album name later).

Change the look of the TIDAL status

  • Condensed song title and artist into 1 line. This way the text isn't taller than the album image.
  • Hovering over the album cover shows the album name instead of "Playing High-Res Audio".
  • Shows a small TIDAL logo at the bottom right corner that says "Streaming on TIDAL". grafik grafik grafik

Fetch the most recent album Uses the cover of the most recently released album, so that, when listening to an entire album, the album cover does not change to the cover of a song that might have been released as a single earlier.


I hope you agree with these changes and they can be merged with the main branch. If you have any questions or want me to change something, let me know! I'd be happy to help.

ungive avatar Feb 16 '24 16:02 ungive

After using Fetch the most recent album 3db91ac for a while, I've realised it does more harm than good. The order of the API results is already very sane, picking the first one is a good idea imo. E.g., with my change, Santana's "Maria Maria" would get an album cover of "The Best Feel Good Hits In The Galaxy" instead of the original "Supernatural" album cover, which is probably not the best fitting one.

ungive avatar Feb 18 '24 05:02 ungive

This is exactly what I needed! My biggest complaint was that when you paused music, it would forever stay there forever, so I would love to have this implemented!

Ogwy avatar Feb 23 '24 09:02 Ogwy

Hello thanks for the PR. I would like to propose 2 things.

  1. the 5s seems kinda too short maybe it should be something bigger, or make it user configurable
  2. Not exactly PR related but the app should probaly move to the new public TIDAL API

purpl3F0x avatar Mar 02 '24 10:03 purpl3F0x

the 5s seems kinda too short maybe it should be something bigger, or make it user configurable

That's a good point. How would you imagine user configuration to work, on a larger scale (with configuration options possibly being added in the future)? I've only added a rudimentary, positional command-line argument, which is probably a bad idea when it comes to maintainability and backwards-compatibility (imagine that argument becomes obsolete and removing it would break people's settings), it would likely be a better idea to think that through a little more. here are a few options that come to mind:

  • Named command-line switches (like --idle-timeout <number>) would be simple to implement, but they are not very user-friendly. The most user-friendly way to use them I can think of is making a desktop shortcut and adding the arguments there, which is error-prone for non-technical users.
  • Reading from a configuration file. I'd love your input on that before thinking of anything overly sophisticated, as there are a lot of ways to implement that.
  • Extending on the previous point, adding a settings window and saving configuration persistently in said config file. The most amount of work.

I would probably go with named command-line switches for now and sensible defaults, as long as most users won't even want to change the config. If there are more options added in the future where it's likelier that a user will want to change it, a config file might be the next best idea.

Here are command line switches I would add in this PR:

  • --app-id <long long>: Overwrite the internal app id with the given parameter
  • --idle-timeout <int>: Timeout in seconds, after which the app disconnects from Discord RPC.

Not exactly PR related but the app should probaly move to the new public TIDAL API

Probably best to address that in a separate issue/PR, but good to mention!

If there's anything specific you want me to change about this PR, let me know!

ungive avatar Mar 11 '24 12:03 ungive

If you want to make use of these features, I have made a release which you can download on the release page of my fork here: https://github.com/jonasberge/discord-music-presence/releases

The application is installed and used the same as before, the only thing that appears different is the name, as I have changed it to "Discord Music Presence". I did that because I am planning to add support for Qobuz and hopefully other music players in the future, so the application serves as a counterpart to how Spotify is so deeply integrated into Discord.

I'm planning on adding more features in the future and maintaining the application for now (since there doesn't seem to be much activity here), so feel free to submit feature requests or bug reports as an issue in that repository.

@Ogwy @smartwe @mantertius @EsserGaming @CurtAudioFan

ungive avatar Mar 17 '24 02:03 ungive

Exactly what I was looking for, some really great features, thank you.

Can I just ask how I go about passing a custom Discord application ID, so that I can change Playing TIDAL to Playing Music like yourself?

For the life of me cannot work it out, thanks again.

emptywhy avatar Mar 19 '24 14:03 emptywhy

Right-click the exe, create a new shortcut, then open that shortcut's properties and add the application id behind the value in the target field, which effectively passes the id as the first argument:

grafik

You can use my application ID if you want: 1205619376275980288.

I will update the ID within the application on the next release, so it shows "Music" by default.

ungive avatar Mar 19 '24 15:03 ungive