diff --git a/Makefile b/Makefile index 0f39ca5..a41fc95 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,7 @@ docker-run: run: - REPLEX_REDIRECT_STREAMS=1 REPLEX_DISABLE_LEAF_COUNT=0 REPLEX_DISABLE_USER_STATE=1 REPLEX_TMDB_API_KEY=0d73e0cb91f39e670b0efa6913afbd58 REPLEX_ENABLE_CONSOLE=0 REPLEX_CACHE_TTL=0 REPLEX_HOST=https://46-4-30-217.01b0839de64b49138531cab1bf32f7c2.plex.direct:42405 RUST_LOG="info,replex=info" cargo watch -x run + REPLEX_DISABLE_LEAF_COUNT=0 REPLEX_DISABLE_USER_STATE=1 REPLEX_ENABLE_CONSOLE=0 REPLEX_CACHE_TTL=0 REPLEX_HOST=https://46-4-30-217.01b0839de64b49138531cab1bf32f7c2.plex.direct:42405 RUST_LOG="info,replex=info" cargo watch -x run # run: # REPLEX_ENABLE_CONSOLE=0 REPLEX_CACHE_TTL=0 REPLEX_HOST=https://46-4-30-217.01b0839de64b49138531cab1bf32f7c2.plex.direct:42405 RUST_LOG="info" cargo run diff --git a/src/transform.rs b/src/transform.rs index c82c2a1..a41c142 100644 --- a/src/transform.rs +++ b/src/transform.rs @@ -629,40 +629,37 @@ impl Transform for TMDBArtTransform { options: PlexParams, ) { let config: Config = Config::figment().extract().unwrap(); - - if config.tmdb_api_key.is_some() { - let style = item.style.clone().unwrap_or("".to_string()).to_owned(); - if item.is_hub() && ["clip", "hero"].contains(&style.as_str()) { - // let mut children: Vec = vec![]; - - let mut futures = FuturesOrdered::new(); - // let now = Instant::now(); - - for child in item.children() { - // let style = item.style.clone().unwrap(); - let client = plex_client.clone(); - futures.push_back(async move { - let mut c = child.clone(); - - let art = child.get_hero_art(client).await; - if art.is_some() { - c.art = art.clone(); - } - // big screen uses thumbs for artwork.... while mobile uses the artwork. yeah... - c.thumb = c.art.clone(); - c - }); - } - // let elapsed = now.elapsed(); - // println!("Elapsed: {:.2?}", elapsed); - // let now = Instant::now(); - - let children: Vec = futures.collect().await; - item.set_children(children); - } else { - // keep this blocking for now. AS its loaded in the background - self.transform(item, plex_client.clone()).await; + let style = item.style.clone().unwrap_or("".to_string()).to_owned(); + if item.is_hub() && ["clip", "hero"].contains(&style.as_str()) { + // let mut children: Vec = vec![]; + + let mut futures = FuturesOrdered::new(); + // let now = Instant::now(); + + for child in item.children() { + // let style = item.style.clone().unwrap(); + let client = plex_client.clone(); + futures.push_back(async move { + let mut c = child.clone(); + + let art = child.get_hero_art(client).await; + if art.is_some() { + c.art = art.clone(); + } + // big screen uses thumbs for artwork.... while mobile uses the artwork. yeah... + c.thumb = c.art.clone(); + c + }); } + // let elapsed = now.elapsed(); + // println!("Elapsed: {:.2?}", elapsed); + // let now = Instant::now(); + + let children: Vec = futures.collect().await; + item.set_children(children); + } else { + // keep this blocking for now. AS its loaded in the background + self.transform(item, plex_client.clone()).await; } } }