This repository was archived by the owner on Apr 12, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-12
lines changed
Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,8 @@ pub struct PlexContext {
120120 pub platform : Option < Platform > ,
121121 #[ salvo( extract( rename = "X-Plex-Username" ) ) ]
122122 pub username : Option < String > ,
123+ #[ salvo( extract( rename = "path" ) ) ]
124+ pub path : Option < String > ,
123125 #[ serde( default , deserialize_with = "deserialize_screen_resolution" ) ]
124126 #[ salvo( extract( rename = "X-Plex-Device-Screen-Resolution" ) ) ]
125127 pub screen_resolution : Vec < Resolution > ,
Original file line number Diff line number Diff line change @@ -227,20 +227,15 @@ async fn should_skip(
227227 depot : & mut Depot ,
228228 ctrl : & mut FlowCtrl ,
229229) {
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
240235 } ;
241236
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" )
244239 {
245240
246241 let config: Config = Config :: dynamic ( req) . extract ( ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments