@@ -19,6 +19,7 @@ pub struct HubStyleTransform {
19
19
20
20
pub struct ClientHeroStyle {
21
21
pub enabled : bool ,
22
+ pub include_meta : bool ,
22
23
pub r#type : String ,
23
24
pub style : Option < String > ,
24
25
pub child_type : Option < String > ,
@@ -30,6 +31,7 @@ impl Default for ClientHeroStyle {
30
31
fn default ( ) -> Self {
31
32
Self {
32
33
enabled : true ,
34
+ include_meta : true ,
33
35
style : Some ( "hero" . to_string ( ) ) ,
34
36
r#type : "mixed" . to_string ( ) ,
35
37
child_type : None ,
@@ -58,7 +60,7 @@ impl ClientHeroStyle {
58
60
pub fn from_context ( context : PlexContext ) -> Self {
59
61
// pub fn android(product: String, platform_version: String) -> Self {
60
62
let product = context. product . clone ( ) . unwrap_or_default ( ) ;
61
- let device_type = DeviceType :: from_product ( product) ;
63
+ let device_type = DeviceType :: from_product ( product. clone ( ) ) ;
62
64
let platform = context. platform . clone ( ) . unwrap_or_default ( ) ;
63
65
let platform_version =
64
66
context. platform_version . clone ( ) . unwrap_or_default ( ) ;
@@ -92,7 +94,11 @@ impl ClientHeroStyle {
92
94
Platform :: Ios => ClientHeroStyle :: ios_style ( ) ,
93
95
Platform :: TvOS => ClientHeroStyle :: tvos_style ( ) ,
94
96
_ => {
95
- ClientHeroStyle :: default ( )
97
+ if product. clone ( ) . to_lowercase ( ) == "plex web" {
98
+ ClientHeroStyle :: web ( )
99
+ } else {
100
+ ClientHeroStyle :: default ( )
101
+ }
96
102
}
97
103
// _ => {
98
104
// if product.starts_with("Plex HTPC") {
@@ -118,6 +124,15 @@ impl ClientHeroStyle {
118
124
}
119
125
}
120
126
127
+ pub fn web ( ) -> Self {
128
+ Self {
129
+ include_meta : false ,
130
+ cover_art_as_art : true ,
131
+ cover_art_as_thumb : true ,
132
+ ..ClientHeroStyle :: default ( )
133
+ }
134
+ }
135
+
121
136
pub fn htpc_style ( ) -> Self {
122
137
Self {
123
138
..ClientHeroStyle :: default ( )
@@ -184,7 +199,10 @@ impl Transform for HubStyleTransform {
184
199
item. style = style. style ;
185
200
186
201
item. r#type = style. r#type ;
187
- item. meta = Some ( hero_meta ( ) ) ;
202
+
203
+ if style. include_meta {
204
+ item. meta = Some ( hero_meta ( ) ) ;
205
+ }
188
206
189
207
let mut futures = FuturesOrdered :: new ( ) ;
190
208
// let now = Instant::now();
0 commit comments