-
Notifications
You must be signed in to change notification settings - Fork 125
Rewrite #2
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
Open
NotVinny
wants to merge
55
commits into
plex-unofficial:master
Choose a base branch
from
NotVinny:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Rewrite #2
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Created the GenerateMenu function, which reads in a dictionary of menu items, and turns them into DirectoryObjects and returns them in a ObjectContainer. Used this function everywhere I could to cut down on repetition and lines of code. Created a language file to hold some string constants. But most importantly, I found some artwork to use as the background... And I couldn't decide which one to use so I have 2 alternates sitting in the Resources folder. In v0.3 I plan to create preferences for artwork (and other options), as well as fix up the MemberMenu function to filter out empty directories.
Updated the service to not only select the best possible resolution, but to actually return all available resolutions. This involves using the deferred decorator (which is apparently evil, but it seems to work for me... I've only tested on Roku/Android clients, and I've read threads from 2013ish that say Plex Home Theatre doesn't work well with it).
Added preferences to select the background/icon art for the channel. Also added a no_cache option for the GenerateMenu function. Finally, I fixed up the way localization was done (for the few strings that I actually localized...) by using Plex's built in Locale functionality rather than my own file of constants.
I have changed the channel so that instead of jumping right to the Video Clip Object, you are sent to another Directory Object which will contain the Video Clip Object, as well as related videos, playlists the video is in, and porn stars in the video. I have not yet added the new features, just "laid the foundation" by creating the new menu and adding the Video Clip Object to it. Will be adding new functionality shortly.
Porn stars from the video now appear in the menu. If only one porn star, then they are displayed immediately. If multiple, they are shown in a separate Directory Object
Was previously displaying the wrong sorting options for a porn star's videos. This commit fixes that
The video's channel (if any) now shows in the video menu
Forgot to comment the code
You can now see related videos.
You can now see playlists that contain the video from the video menu. It's unfortunately limited to 4 playlists, but it's still helpful to traverse the channel.
Added thumbnails for Related Videos and Playlists. Also includes a bit more error handling, and an extra comment for that sweet sweet readability.
Duration was previously missing from both MetadataObjectForURL and MediaObjectsForURL. I am now obtaining a JSON object with more metadata, fixing this problem. xPath is still used as a backup.
Added photo album of thumbnails to video sub menu.
Added a menu that shows time stamps for actions (e.g. different positions). I made it using recursive DirectoryObjects because I didn't really know how else to display information like that. So you can technically click through that menu infinitely and never get anywhere, but hopefully after a few clicks you will realize what is happening and start backing out. If Plex was able to start a video from a certain time that would be sweet, because it would be trivial to modify this to add a VideoClipObject with a time offset if that existed. If it does, I don't know how to do it.
Porn Stars menus were missing the next page button. Browse All Videos and Category pages were missing the next page button from page 2 onward. Pagination seems to be working for everything now
Added duration to the directory objects that point to the video sub menu.
Shortened the titles in the video menu, and lengthened the summary
I've thrown a lot of extra options into the video menu lately. In case anyone wants to tone that down, you can now filter them out using Preferences.
Added the ability to view Channels that Members have created, and also Channels that Members are subscribed to.
Now the items in the Member menu only show up if they contain items
Hiding Playlists with 0 videos
You can now see what Porn Stars a Member is subscribed to. Also fixed up a comments that didn't make sense (due to lazy copypasta)
Forgot to pass along the page limit in the NextPageObject
You can now view a Member's subscribers, Member subscriptions, and friends. Also re-organized the menu a little bit to bring the content closer to the top. One thing to note is that while the xPath to check for a Member's subscribers/Member subscriptions/friends is fairly accurate, there are times when it is inaccurate. I will be addressing this in a forthcoming commit where I will add the option to get accurate results for those menu options (at the expense of 1 extra HTTP request each). It will be configurable in the Preferences if you don't want to create any extra HTTP requests
There are now overrides to get more accurate Member menu options at the expense of extra HTTP requests. It's possible to override subscriptions, however I think the default xPath is good enough so it is set to false by default for now.
Turned off caching on Member menu, so that Preferences are reflected immediately. Also set the default for subscriber override to false, as I think the default xPath is good enough for that (though ugly).
You can now override multiple checks per each Preference override. This is because in cases like Playlists, you can check if a user has Public or Favorite Playlists from the same URL.
…r menu It is now possible to only make one HTTP request in the Member menu, which increases speed greatly but reduces accuracy and removes certain menu options altogether. Every Preference you turn on for Member menu adds one HTTP request, but makes your results more accurate and shows all possible menu items.
Changes for v1.1 release
I want to separate the data and logic in my code more. I want the SharedCodeService to act as a model, and __init__.py (and other files in that directory) to work as a controller. This commit is the first step to that. I have moved all of the more basic xPath logic into the SharedCodeService, removing xPath entirely from several of the "controllers". There is still much more work to be done on this front, v1.2 will largely be a code rewrite with only a couple new features. With any luck though, the code rewrite will allow other features to be added more easily in the future (and the code should be a bit clearer, hopefully)
Moving more xPath code into Shared Code. Also moved the function to get video meta data JSON into Shared Code, as that code was repeated throughout this repository.
More of the same from the last two commits... Reorganizing code.
Moved two functions into shared code
The "Playlists - Most Viewed Daily" menu was broken, I have fixed the URL parameters. Also found that the Member Menu was making two extra HTTP requests, those have been removed.
Although this is not in use yet, this function returns the metadata about the member who uploaded the video. This will be used eventually.
The new layout of the website broke the plugin because the XPath selectors in function GetVideos were too specific. I have simplified those so that they should work even with newer versions of the website. I have also added error-handling to said function so that a single malformed video-section does not make the whole plugin crash.
Simplified XPath selectors for video listing, added error routine
Messed up xpath was crashing plugin, fixed the string.
The format to find the video files changed, now they can be found again.
It's awful, but it's PornHub's fault, not mine. Works though.
Merging some bug fixes from v1.2 branch
Thanks to @mnemouse for pointing this out.
Fixed whitespace issues.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This channel wasn't working for me, so I have forked it and re-written it from scratch. I believe the only remaining things from the original project are some icons.