Ignore "prevent sleep" request from a specific app I sometimes have the problem that my macbook won't sleep, even with the lid closed.
After some investigation I tracked the problem down to Spotify app; when the app is open, even if no song is playing, my macbook won't go to sleep and eventually go out of battery power.
I don't have need of spotify keeping my mac awake (for obvious reason I'm ok with a video player or a game instead); is there a way to ignore its request for preventing sleep without affecting other applications?
I know I could quit spotify when not using it, but I am prone to forget it and it's very annoying to find my mac completely drained...

EDIT: to be clearer, I am not looking for a solution about Spotify specifically (I could simply uninstall it and forget about it), I am just looking for an option which is the default in both Linux and Windows, that is that the user always overrides any setting when he/she closes the lid.
Your MacBook should always sleep when the lid is closed. If your Mac is not sleeping with the lid closed, this suggests a problem.

There are exceptions:


Some MacBooks can be plugged into external displays and, once connected, the MacBook's lid can be safely closed without triggering system wide sleep.
Previously it has been possible to install a third party kernel extension to override macOS's behaviour and stop sleep with the lid closed. Doing this carries risk and should be avoided.


Blocking Sleep

It is difficult for user space processes to block sleep. Sleep assertions should never block a user initiated sleep, either via closing the lid or requesting sleep from the Finder. Use pmset to view current power assertions:

pmset -g assertions