Skip to content
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

Restore related videos, recommendations, and auto-play next functionality #551

Merged
merged 66 commits into from
Jan 15, 2024

Conversation

MoojMidge
Copy link
Collaborator

@MoojMidge MoojMidge commented Jan 8, 2024

Fixes:

New:

  • Update main menu items:
    • New Recommended videos with similar content as YouTube home page (will use login details if available)
    • Old Recommended videos renamed to Related videos (requires either local or remote playback history enabled)
    • Popular right now renamed to Trending

Changed:

  • All existing local user data (local watch history, cache, etc.) will be lost due to updated storage format

- Player monitor was stopping immediately
- This resulted in all play_data for a video being set to zero
- Youtube plugin will show up as a Program Addon as a consequence
- TODO: Find out why the script is required
- TODO: Make the script entry point more useful if required e.g. open settings from Program Addons
- Also make all sequences as tuples rather than lists
- Performing a Container.Update in the internal playlist window should be avoided
- Directory items now fixed in order added, regardless of sort order
- Provider.set_content_type was just a wrapper for XbmcContext methods
  with context passed as a parameter
- Eliminate the redundant wrapper
- All datetime values are now stored internally as timezone aware objects
  with a UTC timezone
- Local datetime values are now converted to timezone aware objects with
  a local timezone rather than using a fixed offset
- Infolabels strip off microseconds and tzinfo as different Kodi getter/setter methods
  handle such values incorrectly
- Old behaviour is retained for backwards compatibility
- Fix (remove) incorrect empty string default fallback for lastplayed
- Fix typo in format string for date infolabel used for Kodi 18
- Remove unnecessary datetime parsing for plugin_created_date
- Also removes some very old code targeting Frodo/Gotham
- This unfortunately doesn't prevent folder items having a 0 count value
  as Kodi sets that by default
- Only return tuple of output and processed input value when necessary
- Intended as a backup means to restore the Default sort order
  which is lost  if another sort method is applied
- Currently only applies to v3 API response items
- Also remove some duplicated code
- Allow for retrieving multiple values using a slice path entry
- Properly handle splitting/divergent paths
- video_id and access_token now need to be supplied as part of data
  parameter (along with anything else) of build_client method
- Partially fix anxdpanic#508
- TODO: Improve support of InnerTube requests to handle configured
  max_result number of results
- TODO: Result is coerced into a V3 Data API result. Support native
  JSON result in ResourceManager
- Prevent unhandled AttributeError when accessing request reponse attributes,
  if response was not received
- Fix up bug introduced in 978312d while trying to maintain Python 2 compatibility
- yt_video originally used Container.Update directly
- This was replaced by existing content_from_description menu item method
- content_from_description used RunPlugin which will fail to load directory listing
- Should no longer be necessary when using common request module
- Dialogs were not being closed on errors and exceptions
- This is just a temporary measure until better thread management is implemented
- Use new Youtube.get_related_videos and local history
- Fix anxdpanic#508
- Response object __bool__ method is wrapper for ok property
- Add status code to JSON error details
- Follow up to b2be81a
- Also test removal of check for search input prior to refresh
  - Should hopefully no longer be necessary after refactors
- Avoids the situation where actions can't be performed if the plugin can't start
  e.g. if access_manager.json is corrupt
- Fix for existing log_notice calls not showing up in Kodi 18 log
- Follow up to 2961cdc which bumped combined size from 10 MB to 20 MB
- Existing data will not be migrated and will be unused unless renamed and copied to new location
- Also ensure correct context menu items are added and pointed to right targets
- If account does not have history tracking enabled then no related videos will be retrieved
@MoojMidge MoojMidge force-pushed the wip-unstable branch 5 times, most recently from b2a920e to 0578fff Compare January 14, 2024 23:38
- Remove patch and use git directly
- Also improve parsing in general by attempting to pre-format input
- TODO: Rewrite YouTube.get_my_subscriptions with better error and thread handling
@MoojMidge MoojMidge marked this pull request as ready for review January 15, 2024 00:49
@MoojMidge MoojMidge merged commit 6f33351 into anxdpanic:master Jan 15, 2024
2 checks passed
@MoojMidge MoojMidge deleted the wip-unstable branch January 15, 2024 23:20
@RNavega
Copy link
Contributor

RNavega commented Jan 17, 2024

This is amazing, lots of work in this. Congratulations.

@MoojMidge
Copy link
Collaborator Author

Few updates to be made for cache and thread handling, but it works pretty well in comparison to my own manual viewing habits.

@misslisa62tx
Copy link

Recomendations and Related Videos both work for me, but MySubscriptions crashes with a Python error.

My setup is Raspberry Pi4, RPI Bookworm (Debian 12), Kodi Nexus 20.3

7.0.3-beta.1.Python Error.MySubscriptions.log

@MoojMidge
Copy link
Collaborator Author

@misslisa62tx - #555

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Queuing from current playlist is broken Recommendations empty & rightclick=>More=>Related Videos error
4 participants