Skip to content
This repository was archived by the owner on Apr 12, 2025. It is now read-only.

Commit 48f95b3

Browse files
committed
fix: #137
1 parent 87f6bb7 commit 48f95b3

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ run:
3333
REPLEX_ENABLE_CONSOLE=0 \
3434
REPLEX_CACHE_TTL=0 \
3535
REPLEX_HUB_RESTRICTIONS=1 \
36-
RUST_LOG="info,replex=debug,replex::transform=debug" \
36+
RUST_LOG="info,replex=info,replex::transform=debug" \
3737
REPLEX_NTF_WATCHLIST_FORCE=0 \
3838
RUSTFLAGS=-Awarnings \
3939
cargo watch -w src -x run

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Settings are set via [environment variables](https://kinsta.com/knowledgebase/wh
8484
| REPLEX_DISABLE_CONTINUE_WATCHING | false | Disable/remove the continue watching row |
8585
| REPLEX_DISABLE_USER_STATE | true | Remove watched badges from hub items. * does not work on all clients |
8686
| REPLEX_DISABLE_LEAF_COUNT| false | Remove episode count label from show artwork. |
87-
| REPLEX_HERO_ROWS | | Comma seperated list of hubidentifiers to make builtin hubs hero style. For custom collections see [Hhb style](#-hub-style). Options are: <br />home.movies.recent<br />movies.recent <br />movie.recentlyadded<br />movie.topunwatched<br />movie.recentlyviewed<br />hub.movie.recentlyreleased<br />movie.recentlyreleased<br />home.television.recent<br />tv.recentlyadded<br />tv.toprated<br />tv.inprogress<br />tv.recentlyaired |
87+
| REPLEX_HERO_ROWS | | Comma seperated list of hubidentifiers to make builtin hubs hero style. For custom collections see [Hhb style](#-hub-style). Options are: <br />home.movies.recent<br />movies.recent <br />movie.recentlyadded<br />movie.topunwatched<br />movie.recentlyviewed<br />hub.movie.recentlyreleased<br />movie.recentlyreleased<br />home.television.recent<br />tv.recentlyadded<br />tv.toprated<br />tv.inprogress<br />tv.recentlyaired |
8888
| REPLEX_FORCE_MAXIMUM_QUALITY | false | This will force clients to use the maximum quality. Meaning that if a client requests anything other then the maximum quality this will be ignored and the maximum quality (direct play/stream when server allows for original) is used instead. This doesn't prevent transcoding. It only sets the bitrate to original quality. So if a client needs a different codec, container or audio it should still transcode.
8989
| REPLEX_FORCE_DIRECT_PLAY_FOR | false | Force direct play for the given resolutions. Options are "4k", "1080" and "720". This wil result in an error message if the client does not support directplay. Not recommended
9090
| REPLEX_VIDEO_TRANSCODE_FALLBACK_FOR | | If the selected media triggers a video transcode. Fallback to another version of the media. Only triggers on video transcoding. Remuxing is still allowed. <br />Options are "4k" and "1080". <br /> <br /> Example if REPLEX_VIDEO_TRANSCODE_FALLBACK_FOR is set to "4k" then 4k transcodes will fallback to another version if avaiable |

src/routes.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,6 @@ pub async fn get_hubs_sections(
672672
count = 50;
673673
}
674674

675-
add_query_param_salvo(req, "count".to_string(), count.to_string());
676675

677676
// we want guids for banners
678677
add_query_param_salvo(req, "includeGuids".to_string(), "1".to_string());
@@ -799,7 +798,14 @@ pub async fn default_transform(
799798
let mut url = Url::parse(req.uri_mut().to_string().as_str()).unwrap();
800799
url.set_path(&rest_path);
801800
req.set_uri(hyper::Uri::try_from(url.as_str()).unwrap());
802-
801+
802+
803+
// patch, plex seems to pass wrong contentdirid, probaply cause we all load it inti the first
804+
let mut queries = req.queries().clone();
805+
queries.remove("contentDirectoryID");
806+
replace_query(queries, req);
807+
808+
//dbg!(&req);
803809
let upstream_res = plex_client.request(req).await?;
804810
match upstream_res.status() {
805811
reqwest::StatusCode::OK => (),
@@ -817,9 +823,11 @@ pub async fn default_transform(
817823
// container.media_container.meta
818824

819825
TransformBuilder::new(plex_client, params.clone())
826+
.with_filter(HubRestrictionsFilter)
820827
.with_transform(MediaStyleTransform { style: style })
821828
.with_transform(UserStateTransform)
822829
.with_transform(HubWatchedTransform)
830+
.with_transform(HubKeyTransform)
823831
.apply_to(&mut container)
824832
.await;
825833

src/transform.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ impl Transform for HubInterleaveTransform {
358358
) -> MediaContainer {
359359
let config: Config = Config::figment().extract().unwrap();
360360
let mut new_hubs: Vec<MetaData> = vec![];
361-
361+
362362
if !config.interleave {
363363
return item;
364364
}
@@ -965,7 +965,7 @@ impl Transform for HubKeyTransform {
965965
plex_client: PlexClient,
966966
options: PlexContext,
967967
) {
968-
968+
969969
if item.is_hub()
970970
&& item.key.is_some()
971971
&& !item.key.clone().unwrap().starts_with("/replex")

0 commit comments

Comments
 (0)