https://bugs.kde.org/show_bug.cgi?id=511238

            Bug ID: 511238
           Summary: strange behavior with mpris b-bus when using plasma
                    browser integration
    Classification: Plasma
           Product: plasma-browser-integration
      Version First unspecified
       Reported In:
          Platform: Arch Linux
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Firefox
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

I have been working on a music visualizer for the past year ish, and I have
noticed some strange things regarding plasma browser integration and mpris.  I
use mpris for a lot of different functionality in my app and the plasma browser
integration mpris service is unreliable at best. I use gnome on my desktop pc
and I use KDE plasma for my laptop, so that is where I found the bug. the way I
found it first is on my laptop the mpris service for firefox only has the song
title and nothing else, no image no artist no album, nothing but the title. it
does seem to give the correct song length, though.  so I had it use the mpris
service for plasma browser integration. well that has its own issues. the main
issue that I see is that the song length it gives it very very wrong.  the
length seems to be the total time you have had thing playing continuously plus
30 seconds. I use youtube music for my music and it works great most of the
time, but it has one issue that really messes with a lot of things. for most
songs it preloads them for seamless play, but if the song does not have an
album release, it wont preload it. this causes there to be a pause in the songs
which causes the pipewire node to get deleted  (I dont know why, it only
happens on youtube music). but whats even stranger is that when that happens 
plasma browser integration starts going crazy, first it starts spamming the
changed properties signal, which makes my app try to fetch the new information,
it then just returns with all of the values except time set to NONE. these
issues just dont happen with any other de.

app that I made that shows the bug https://github.com/mrhoomanwastaken/gvis
all you need to do to see this bug is to start some music and then poke around
the mpris service to see the strange values that it gives.


Operating System: Arch Linux 
KDE Plasma Version: 6.5.0
KDE Frameworks Version: 6.19.0
Qt Version: 6.10.0
Kernel Version: 6.17.5-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 8640HS w/ Radeon 760M Graphics
Memory: 8 GiB of RAM (5.5 GiB usable)
Graphics Processor: AMD Radeon 760M Graphics

logs from gvis:
{'Metadata': <{'kde:pid': <90970>, 'mpris:artUrl':
<'https://lh3.googleusercontent.com/o7L7dDamGEHP-gEhb-I9zYq6rkbiykY04fDUC2-hv_a4dbah8eldjVCz_JUd6IzC3Mymol66IEcxT0Q=w544-h544-l90-rj'>,
'mpris:length': <int64 136678571>, 'mpris:trackid': <objectpath
'/org/kde/plasma/browser_integration/1337'>, 'xesam:album': <'SUGAR RUSH'>,
'xesam:artist': <['AZALI']>, 'xesam:title': <'SUGAR RUSH'>, 'xesam:url':
<'https://music.youtube.com/watch?v=OQ4e5PH7Tuc&list=RDAMVMv5C9l2fTwj0'>}>}
##song change##
@a{sv} {}
Traceback (most recent call last):
  File "/home/mrhooman/gitrepos/gvis/gvis.py", line 330, in
on_properties_changed
    self.update_info()
    ~~~~~~~~~~~~~~~~^^
  File "/home/mrhooman/gitrepos/gvis/gvis.py", line 334, in update_info
    update_info(self , scrobble_enabled, network)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mrhooman/gitrepos/gvis/src/update_info.py", line 27, in
update_info
    metadata_variant = self.source.call_sync(
        "org.freedesktop.DBus.Properties.Get",
    ...<3 lines>...
        None
    )
gi.repository.GLib.GError: g-dbus-error-quark:
GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name is not
activatable (2)
Traceback (most recent call last):
  File "/home/mrhooman/gitrepos/gvis/gvis.py", line 337, in update_progress
    return update_progress(self)
  File "/home/mrhooman/gitrepos/gvis/src/update_info.py", line 147, in
update_progress
    elif self.source.get_cached_property("PlaybackStatus").unpack() ==
'Playing':
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'unpack'
{'CanControl': <true>, 'CanGoNext': <false>, 'CanGoPrevious': <false>,
'CanPause': <true>, 'CanPlay': <true>, 'CanSeek': <true>, 'LoopStatus':
<'None'>, 'MaximumRate': <32.0>, 'Metadata': <{'kde:pid': <90970>,
'mpris:length': <int64 282935147>, 'mpris:trackid': <objectpath
'/org/kde/plasma/browser_integration/1337'>, 'xesam:album':
<'https://music.youtube.com'>, 'xesam:title': <'YouTube Music'>, 'xesam:url':
<'https://music.youtube.com/'>}>, 'MinimumRate': <0.01>, 'PlaybackStatus':
<'Playing'>, 'Position': <int64 0>, 'Rate': <1.0>, 'Volume': <1.0>}
cant find accurate position in song assuming song just started
No album image available.
Failed to scrobble: 'NoneType' object is not subscriptable
Error type: <class 'TypeError'>
Traceback (most recent call last):
  File "/home/mrhooman/gitrepos/gvis/src/update_info.py", line 133, in
update_info
    print(f"Attempting to scrobble: {artist_name[0]} - {song_name} -
{album_name}")
                                     ~~~~~~~~~~~^^^
TypeError: 'NoneType' object is not subscriptable

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to