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

Blacklist doesn't work for one program #129

Closed
aacater opened this issue Jan 18, 2024 · 18 comments
Closed

Blacklist doesn't work for one program #129

aacater opened this issue Jan 18, 2024 · 18 comments
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@aacater
Copy link

aacater commented Jan 18, 2024

If I have blacklisted a program, the extension ignores the blacklist when I open the blacklisted program.

However, if the extension already sees the program and has controls for it and then I blacklist the program, the extension properly ignores the program. But then if I restart the program, the extension ignores the blacklist again and shows controls for the blacklisted program.

The program I am trying to block is freetube, installed as a flatpak (link). The extension properly blocks Spotify however, also installed as a flatpak. So maybe this is a problem with freetube and not the extension?

Info:

  • Extension Version 34
  • Fedora Silverblue 39.20240117.0
  • Gnome 45.3

P.S. I really like the rewrite, good work!

@aacater aacater changed the title Blacklist doesn't work Blacklist doesn't work for one program Jan 18, 2024
@sakithb sakithb added the question Further information is requested label Jan 18, 2024
@sakithb
Copy link
Owner

sakithb commented Jan 18, 2024

I just installed Freetube and tried blacklisting it, and it worked as expected, the extension does not show up when opening Freetube if its is blacklisted. The last update was a total rewrite of the extension so it was rather a huge update, so can you try removing all blacklisted players and adding them one by one?

@aacater
Copy link
Author

aacater commented Jan 18, 2024

The only app I want to block is freetube so my blacklist is empty except for it. I have removed and re-added it multiple times.

Since its just me, I'll continue to test. Like seeing if it happens on my laptop or if its just my desktop for some reason.

@aacater aacater closed this as completed Jan 18, 2024
@aacater
Copy link
Author

aacater commented Jan 18, 2024

Same behavior on my laptop. Also running Fedora Silverblue.

Also tested blocking Firefox, it works as expected. So it seems I am only having trouble with Freetube for some reason.

@aacater aacater reopened this Jan 18, 2024
@sakithb
Copy link
Owner

sakithb commented Jan 20, 2024

Does the extension show the correct freetube icon?

@aacater
Copy link
Author

aacater commented Jan 20, 2024

No, it does not. However the icon is show properly in the blacklist settings.

Screenshot from 2024-01-20 08-06-15

@aacater
Copy link
Author

aacater commented Jan 21, 2024

  • I have discovered, for some reason, sometimes it works. I haven't tracked down the exact steps to reproduce it yet. But sometimes I will be using freetube and then notice its blacklisted properly. But if I restart freetube then it will be back to not blacklisted.
  • The icon in the extension will show up sometimes. I think it has something to do with switching between apps in the extension. Once I switch back to freetube, the icon is there. If I restart freetube the icon is missing again.

@sakithb
Copy link
Owner

sakithb commented Jan 21, 2024

I noticed that Freetube exposes two MPRIS services (this extensions uses these services to identify media players), one was called Freetube and the other was called chromium (this makes sense assuming Freetube uses Electron), maybe this plays a part in the issue, I am not sure, but I will look into it. The odd thing is I always get the correct Freetube icon in the extension. What is your freetube version?

@aacater
Copy link
Author

aacater commented Jan 21, 2024

I am currently using v0.19.1 Beta.

@sakithb
Copy link
Owner

sakithb commented Jan 29, 2024

Im on the same version. It's really weird that it works for me, but not for you. Is you laptop on Fedora Silverblue as well?

@aacater
Copy link
Author

aacater commented Jan 30, 2024

Yes, laptop is running Fedora Silverblue as well.


Random information/thoughts that may or may not be helpful:

  • I noticed freetube changes the window's name based on the video playing. Could that be interfering with the blacklist?
  • you can open multiple freetube windows to play multiple videos at once, but the extension only shows one freetube. The extension will show controls for the last video that was started/stopped.
    • next time I notice the blacklist working I am going to test if opening a second window breaks the blacklist.
    • Two windows does not break the blacklist.
  • this is happening on both X11 and wayland. I run X11 on my desktop and wayland on my laptop.

I am still trying to track down the exact circumstances of when blacklist works and when it doesn't. Currently it seems to work after a certain amount of time. Or something I do infrequently makes it work.

It definitely doesn't work right after I reboot and/or login. Which is weird to me, I would expect it to work then if at all...

Is there any debug logs I can provide or something like that?

@sakithb
Copy link
Owner

sakithb commented Feb 1, 2024

Can you post the output of this command?
gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.ListNames | grep -Poi "'org.mpris.Mediaplayer2\..+?'" | xargs -I{} gdbus introspect --session --dest {} --object-path /org/mpris/MediaPlayer2

This command will list all the active media players and fetch their information via gdbus. Make sure the freetube is open and playing a video before running this command.

@aacater
Copy link
Author

aacater commented Feb 1, 2024

gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.ListNames | grep -Poi "'org.mpris.Mediaplayer2\..+?'" | xargs -I{} gdbus introspect --session --dest {} --object-path /org/mpris/MediaPlayer2

node /org/mpris/MediaPlayer2 {
};
node /org/mpris/MediaPlayer2 {
  interface org.freedesktop.DBus.Properties {
    methods:
      Get(in  s interface_name,
          in  s property_name,
          out v value);
      GetAll(in  s interface_name,
             out a{sv} properties);
      Set(in  s interface_name,
          in  s property_name,
          in  v value);
    signals:
      PropertiesChanged(s interface_name,
                        a{sv} changed_properties,
                        as invalidated_properties);
    properties:
  };
  interface org.freedesktop.DBus.Introspectable {
    methods:
      Introspect(out s xml_data);
    signals:
    properties:
  };
  interface org.freedesktop.DBus.Peer {
    methods:
      Ping();
      GetMachineId(out s machine_uuid);
    signals:
    properties:
  };
  interface org.mpris.MediaPlayer2 {
    methods:
      Raise();
      Quit();
    signals:
    properties:
      readonly b CanQuit = true;
      readonly b CanSetFullscreen = false;
      readonly b CanRaise = true;
      readonly b HasTrackList = false;
      readonly s Identity = 'Spotify';
      readonly s DesktopEntry = 'spotify';
      readonly as SupportedUriSchemes = ['spotify'];
      readonly as SupportedMimeTypes = [];
  };
  interface org.mpris.MediaPlayer2.Player {
    methods:
      Next();
      Previous();
      Pause();
      PlayPause();
      Stop();
      Play();
      Seek(in  x Offset);
      SetPosition(in  o TrackId,
                  in  x Position);
      OpenUri(in  s Uri);
    signals:
      Seeked(x Position);
    properties:
      readonly s PlaybackStatus = 'Paused';
      readwrite s LoopStatus = 'None';
      readwrite d Rate = 1.0;
      readwrite b Shuffle = true;
      readonly a{sv} Metadata = {'mpris:trackid': <'/com/spotify/track/6m4HWTYMRSJkaUuvXTaNmE'>, 'mpris:length': <uint64 203066000>, 'mpris:artUrl': <'https://i.scdn.co/image/ab67616d0000b273c3c0ca7a4929d96f2f1c5774'>, 'xesam:album': <'The Good, The Bad and The Ugly (Original Motion Picture Soundtrack) [Remastered Edition]'>, 'xesam:albumArtist': <['Ennio Morricone']>, 'xesam:artist': <['Ennio Morricone']>, 'xesam:autoRating': <0.54000000000000004>, 'xesam:discNumber': <1>, 'xesam:title': <"The Ecstasy of Gold - L'Estasi Dell'oro">, 'xesam:trackNumber': <20>, 'xesam:url': <'https://open.spotify.com/track/6m4HWTYMRSJkaUuvXTaNmE'>};
      readwrite d Volume = 0.4516060120546273;
      readonly x Position = 124503000;
      readonly d MinimumRate = 1.0;
      readonly d MaximumRate = 1.0;
      readonly b CanGoNext = true;
      readonly b CanGoPrevious = true;
      readonly b CanPlay = true;
      readonly b CanPause = true;
      readonly b CanSeek = true;
      readonly b CanControl = true;
  };
};

gdbus call --session --dest org.freedesktop.DBus --object-path /org/freedesktop/DBus --method org.freedesktop.DBus.ListNames | grep -Poi "'org.mpris.Mediaplayer2\..+?'"

'org.mpris.MediaPlayer2.chromium.instance2'
'org.mpris.MediaPlayer2.spotify'

gdbus introspect --session --dest org.mpris.MediaPlayer2.chromium.instance2 --object-path /org/mpris/MediaPlayer2

node /org/mpris {
  node MediaPlayer2 {
  };
};

These commands were run when I was playing a video in freetube and the extension's blacklist was not working properly.

@sakithb
Copy link
Owner

sakithb commented Feb 3, 2024

That's very weird, I guess the empty node is Freetube.

@sakithb sakithb added the help wanted Extra attention is needed label Feb 3, 2024
@sakithb
Copy link
Owner

sakithb commented Feb 3, 2024

Are you able to control freetube properly through the extension?

@aacater
Copy link
Author

aacater commented Feb 5, 2024

Yes, the extension is able to control freetube properly.

Since freetube's node is empty, does that mean this is a freetube bug? Or maybe even gbus?

@sakithb
Copy link
Owner

sakithb commented Feb 8, 2024

I think this is a chromium bug. I've noticed this issue in some chrome versions. Not sure if it is fixed in the latest.

@sakithb
Copy link
Owner

sakithb commented Apr 21, 2024

@aacater Is this fixed now?

@aacater
Copy link
Author

aacater commented May 7, 2024

I think so. At least I haven't noticed it happening but I am also using freetube less.

Thanks!

@aacater aacater closed this as completed May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants