Commit c241418 1 parent 52a76d1 commit c241418 Copy full SHA for c241418
File tree 2 files changed +9
-12
lines changed
2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,8 @@ pub struct PlexContext {
120
120
pub platform : Option < Platform > ,
121
121
#[ salvo( extract( rename = "X-Plex-Username" ) ) ]
122
122
pub username : Option < String > ,
123
+ #[ salvo( extract( rename = "path" ) ) ]
124
+ pub path : Option < String > ,
123
125
#[ serde( default , deserialize_with = "deserialize_screen_resolution" ) ]
124
126
#[ salvo( extract( rename = "X-Plex-Device-Screen-Resolution" ) ) ]
125
127
pub screen_resolution : Vec < Resolution > ,
Original file line number Diff line number Diff line change @@ -227,20 +227,15 @@ async fn should_skip(
227
227
depot : & mut Depot ,
228
228
ctrl : & mut FlowCtrl ,
229
229
) {
230
-
231
- // We do this because of a bug in extract. Which taks the body which is needed for proy
232
- let queries: PlexContextProduct = req. parse_queries ( ) . unwrap ( ) ;
233
- let headers: PlexContextProduct = req. parse_headers ( ) . unwrap ( ) ;
234
- let product: Option < String > = if queries. product . is_some ( ) {
235
- queries. product
236
- } else if headers. product . is_some ( ) {
237
- headers. product
238
- } else {
239
- None
230
+ let context: PlexContext = req. extract ( ) . await . unwrap ( ) ;
231
+
232
+ let is_livetv = match context. path . clone ( ) {
233
+ Some ( v) => v. contains ( "livetv" ) ,
234
+ None => false
240
235
} ;
241
236
242
- if product. is_some ( )
243
- && product. clone ( ) . unwrap ( ) . to_lowercase ( ) == "plexamp"
237
+ if is_livetv || ( context . product . is_some ( )
238
+ && context . product . clone ( ) . unwrap ( ) . to_lowercase ( ) == "plexamp" )
244
239
{
245
240
246
241
let config: Config = Config :: dynamic ( req) . extract ( ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments