File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,15 @@ struct State {
135
135
any_player_state_stream : futures:: stream:: SelectAll < zbus:: PropertyStream < ' static , String > > ,
136
136
}
137
137
138
+ fn filter_firefox_players ( players : & mut Vec < MprisPlayer > ) {
139
+ if players
140
+ . iter ( )
141
+ . any ( |e| e. name ( ) == "org.mpris.MediaPlayer2.plasma-browser-integration" )
142
+ {
143
+ players. retain ( |e| !e. name ( ) . starts_with ( "org.mpris.MediaPlayer2.firefox." ) ) ;
144
+ }
145
+ }
146
+
138
147
impl State {
139
148
async fn new ( ) -> Result < Self , zbus:: Error > {
140
149
let conn = Connection :: session ( ) . await ?;
@@ -154,6 +163,7 @@ impl State {
154
163
}
155
164
}
156
165
}
166
+ filter_firefox_players ( & mut players) ;
157
167
158
168
// pre-sort by path so that the same player is always selected
159
169
players. sort_by ( |a, b| a. name ( ) . cmp ( & b. name ( ) ) ) ;
@@ -180,6 +190,7 @@ impl State {
180
190
}
181
191
} ;
182
192
self . players . push ( player) ;
193
+ filter_firefox_players ( & mut self . players ) ;
183
194
self . players . sort_by ( |a, b| a. name ( ) . cmp ( & b. name ( ) ) ) ;
184
195
self . update_any_player_state_stream ( ) . await ;
185
196
}
You can’t perform that action at this time.
0 commit comments