-
-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: override include_watched w/ collection label #107
feat: override include_watched w/ collection label #107
Conversation
- Added `include_watched` method to `MetaData` and `MediaContainer` models, looks at both env var and collection label. - Added `HubWatchedTransform` and use it for `get_hubs_sections` and `transform_hubs_home` route handlers. - Removed `WatchedFilter` from `transform_hubs_home` route handler, filtering is now handled by transform. - Removed include_watched logic from `HubMixTransform` (this is now done in `HubWatchedTransform`). - Improve include_watched logic in `LibraryMixTransform`, account for collection label and get correct size.
thanks for this. Ill have look at the code this weekend. One thing is that the naming doesnt make sense anymore (thats my fault). Plex default is include and replex removes that. And adding REPLEX_INCLUDE_WATCHED as a label to exclude watched makes it even weirder. So might be a good time to invert this and replace REPLEX_INCLUDE_WATCHED with REPLEX_EXCLUDE_WATCHED (default value set to false for global env) for both the global setting and the collection label Could you also change the readme for this and info for the new label? |
- Changed include_watched to exclude_watched in config and models. - Inverted logic in trasforms. - Removed logic from limit in route handler, not sure if this is correct. - Updated readme.
The name change makes sense, I've changed include to exclude - not sure if I did the 250 limit thing right though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just keep and adapt the pagination and its good togo.
let mut offset: i32 = 0; | ||
|
||
// in we dont remove watched then we dont need to limit | ||
if config.include_watched { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be adapted and kept. As it enables pagination (not supported when using excluded watched)
let mut limit: i32 = 250; | ||
let mut offset: i32 = 0; | ||
|
||
// in we dont remove watched then we dont need to limit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be adapted and kept. As it enables pagination (not supported when using excluded watched)
I've tried to put pagination back but I should probably dive into how pagination actually works. With Maybe I'm also just missing some context of different clients though, all I've tested on so far is the Plex web app. |
Pagination across clients is messy. Never got it right. the gist is that when watched is excluded pagination wont work. So replex returns the max of 250 per media type to counter that a little bit. When watched is included pagination should work. But in practice the clients are finniky. I think it doesn't work in the main branch properly either so this should be ok. |
@luukleenders pagination in default_transform should be put back again aswell |
Whoops, missed the default_transform - added it back. |
top, nogmaals dank hiervoor. Push gelijk een nieuwe release. |
🎉 This PR is included in version 0.20.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Oh NL haha nice! Maar graag gedaan, was leuk om in te duiken en ik heb er zelf ook wat aan natuurlijk. Het is sowieso een hele mooie toevoeging aan Plex - als je nog andere puten hebt waar ik zou kunnen helpen dan laat maar weten :) |
feat: override include_watched w/ collection label
include_watched
method toMetaData
andMediaContainer
models, looks at both env var and collection label.HubWatchedTransform
and use it forget_hubs_sections
andtransform_hubs_home
route handlers.WatchedFilter
fromtransform_hubs_home
route handler, filtering is now handled by transform.HubMixTransform
(this is now done inHubWatchedTransform
).LibraryMixTransform
, account for collection label and get correct size.feat: change include_watched to exclude_watched