Skip to content

Commit c101337

Browse files
committed
fix: Dont process builtin rows
1 parent 7e0a9e2 commit c101337

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build:
55
cargo build --release
66

77
docker-build:
8-
docker build -t ghcr.io/sarendsen/replex:test --target nginx . -f docker/Dockerfile
8+
docker build -t ghcr.io/sarendsen/replex-nginx:test --target nginx . -f docker/Dockerfile
99

1010
# docker-build:
1111
# docker buildx build -t ghcr.io/sarendsen/replexnonginx:latest --platform linux/amd64 --target replex . -f docker/Dockerfile
@@ -14,7 +14,7 @@ docker-build:
1414
# docker run --rm -it -p 3001:80 -e REPLEX_HOST="http://46.4.30.217:42405" ghcr.io/sarendsen/replex:test
1515

1616
docker-run:
17-
docker run --rm -it -p 3001:80 -e RUST_LOG="info,replex=debug" -e REPLEX_HOST="http://46.4.30.217:42405" ghcr.io/sarendsen/replex:test
17+
docker run --rm -it -p 3001:80 -e RUST_LOG="info,replex=info" -e REPLEX_TMDB_API_KEY=0d73e0cb91f39e670b0efa6913afbd58 -e REPLEX_HOST="http://46.4.30.217:42405" ghcr.io/sarendsen/replex-nginx:test
1818

1919
# push-docker:
2020
# docker push ghcr.io/sarendsen/replex:latest

src/routes.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ pub async fn get_hubs_promoted(req: &mut Request, res: &mut Response) {
7777
let params: PlexParams = req.extract().await.unwrap();
7878
let plex_client = PlexClient::from_request(req, params.clone());
7979
let content_type = get_content_type_from_headers(req.headers_mut());
80-
8180
// not sure anymore why i have this lol
8281
// let content_directory_id_size =
8382
// params.clone().content_directory_id.unwrap().len();
@@ -160,7 +159,6 @@ pub async fn get_hubs_sections(req: &mut Request, res: &mut Response) {
160159
let params: PlexParams = req.extract().await.unwrap();
161160
let plex_client = PlexClient::from_request(req, params.clone());
162161
let content_type = get_content_type_from_headers(req.headers_mut());
163-
164162
// Hack, as the list could be smaller when removing watched items. So we request more.
165163
if let Some(original_count) = params.clone().count {
166164
// let count_number: i32 = original_count.parse().unwrap();
@@ -214,6 +212,7 @@ pub async fn get_collections_children(
214212
let collection_ids = req.param::<String>("ids").unwrap();
215213
let collection_ids: Vec<u32> = collection_ids
216214
.split(',')
215+
.filter(|&v| !v.parse::<u32>().is_err())
217216
.map(|v| v.parse().unwrap())
218217
.collect();
219218
let plex_client = PlexClient::from_request(req, params.clone());

src/transform.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ impl TransformBuilder {
233233

234234
for t in self.transforms.clone() {
235235
// dbg!(&t);
236+
236237
t.transform_mediacontainer(
237238
&mut container.media_container,
238239
self.plex_client.clone(),
@@ -242,6 +243,11 @@ impl TransformBuilder {
242243
}
243244

244245
for item in container.media_container.children_mut() {
246+
if item.is_hub() && !item.is_collection_hub() {
247+
// We dont handle builtin hubs
248+
continue
249+
}
250+
245251
for t in self.transforms.clone() {
246252
t.transform_metadata(
247253
item,
@@ -439,16 +445,16 @@ impl Transform for HubMixTransform {
439445
let mut new_hubs: Vec<MetaData> = vec![];
440446
// let mut library_section_id: Vec<Option<u32>> = vec![]; //librarySectionID
441447
for mut hub in item.children_mut() {
442-
if !config.include_watched {
443-
hub.children_mut().retain(|x| !x.is_watched());
444-
}
445-
446448
// we only process collection hubs
447449
if !hub.is_collection_hub() {
448450
new_hubs.push(hub.to_owned());
449451
continue;
450452
}
451453

454+
if !config.include_watched {
455+
hub.children_mut().retain(|x| !x.is_watched());
456+
}
457+
452458
let p = new_hubs.iter().position(|v| v.title == hub.title);
453459
if hub.r#type != "clip" {
454460
hub.r#type = "mixed".to_string();

0 commit comments

Comments
 (0)