Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove wmctrl dependency #67

Closed
gmdfalk opened this issue Nov 14, 2015 · 2 comments
Closed

Remove wmctrl dependency #67

gmdfalk opened this issue Nov 14, 2015 · 2 comments

Comments

@gmdfalk
Copy link
Owner

gmdfalk commented Nov 14, 2015

Blockify currently uses wmctrl to find the Spotify window and extract its title.

This isn't necessary as DBus provides enough metadata to detect if the current track is an ad:

a) Commercials have title information but blank artist info
b) Commercials have a different track url (https://open.spotify.com/ad/id instead of https://open.spotify.com/track/id)

Metadata can be checked via dbusclient.py, e.g. python dbusclient.py get all

To implement this, the current_song_is_ad() method could look like this return self.dbus.get_song_title() and not self.dbus.get_song_artist() and the wmctrl resp. get_windows logic could be removed entirely.

@Feltzer
Copy link

Feltzer commented Jan 3, 2016

Just a quick remark. While working on updating our bash adblocker I've run into quite a few ads that weren't as straightforward to identify. For some reason DBus isn't updated with some ads, making ad detection solely based on the track metadata somewhat unreliable. Because of this I've opted to stay with the older window properties based detection method for now.

@gmdfalk
Copy link
Owner Author

gmdfalk commented Jan 3, 2016

Thanks for the heads up. Looks like I'm testing this live.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants