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

[interfaces/json-rpc] Allow VideoLibrary.Clean by directory #18562

Merged
merged 1 commit into from Oct 15, 2020

Conversation

CastagnaIT
Copy link
Collaborator

Description

Add directory parameter to VideoLibrary.Clean, as done on VideoLibrary.Scan

Motivation and Context

there are two ways to remove items that no longer exist from the Kodi library
call single jsonRPC's (e.g. VideoLibrary.RemoveEpisode) for each file or clean the library

The first method (each call per file) is intensive when you have to delete hundreds of files, and have side effect to show loading screen (e.g. if you are doing the operation while watching a video)

The second method you do only one call, at the end of your addon operations, is very fast and easy to do because you do not need a separate job to collect the list of paths to remove.

Why add directory parameter:

How Has This Been Tested?

Tested on windows 10 with Jellyfin library items and netflix library items at same time
When i set VideoLibrary.Clean to netflix folder check only the netflix kodi library path

Another test is done on the issue referenced before, with nf+samba library source

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)

Checklist:

  • My code follows the Code Guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the Contributing document
  • I have added tests to cover my change
  • All new and existing tests passed

@Montellese Montellese added API change: JSON-RPC Component: JSON-RPC Type: Improvement non-breaking change which improves existing functionality labels Oct 13, 2020
@Montellese Montellese added this to In progress in General (roadmap) via automation Oct 13, 2020
@Montellese Montellese added Type: Feature non-breaking change which adds functionality and removed Type: Improvement non-breaking change which improves existing functionality labels Oct 13, 2020
@Montellese Montellese self-requested a review October 13, 2020 09:43
Copy link
Member

@Montellese Montellese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good apart from the minors.

xbmc/Application.h Outdated Show resolved Hide resolved
xbmc/interfaces/json-rpc/schema/methods.json Outdated Show resolved Hide resolved
General (roadmap) automation moved this from In progress to Reviewer approved Oct 13, 2020
@DaveTBlake DaveTBlake added this to the Matrix 19.0-alpha 3 milestone Oct 13, 2020
xbmc/Application.h Outdated Show resolved Hide resolved
@Montellese
Copy link
Member

Thanks for the changes. jenkins build this please

@dagwieers
Copy link
Contributor

Will this work also for plugin://-type locations?
That would be a requirement for Kodi Library integrations from add-ons.

@CastagnaIT
Copy link
Collaborator Author

I have not tested i have no addon ready to this,
but theoretically it should work because the directory sent in the param is searched directly in the kodi database
if someone has the opportunity to confirm

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

Successfully merging this pull request may close these issues.

None yet

4 participants