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

Adding History object and history deletion #1491

Closed
wants to merge 2 commits into from
Closed

Conversation

blacktwin
Copy link
Collaborator

Description

When requesting history the items object would contain a lot of unnecessary attributes. Adding the History object to only use the available attributes from the XML response. I discovered the Plex Dash allows for deleting history so I've added that functionally as well.

To wipe the history from Library 1:

history = server.history(librarySectionID=1)
for item in history:
    item.delete()

Testing is not applicable due to somewhat recent changes to creating history on a Plex server.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the docstring for new or existing methods
  • I have added tests when applicable

Update history method to user History object. History object allows for deletion of history
@JonnyWong16
Copy link
Collaborator

JonnyWong16 commented Dec 27, 2024

History should be using the PlexHistory object (and the subclasses TrackHistory, MovieHistory, and EpisodeHistory). Maybe there's a bug where it's not automatically using those objects.

class PlexHistory(object):

Edit: or I misunderstood, you want to remove loading the movie attributes here and infested add them to the base PlexHistory object.

Movie._loadData(self, data)

Also side note, I was planning accountID as a parameter into LibrarySection.history() so you can get library history for someone other than the admin account.

@blacktwin
Copy link
Collaborator Author

No bug. Removing my code and it works as expected. I just didn't look in the correct library👎. Closing.

@blacktwin blacktwin closed this Dec 27, 2024
@blacktwin blacktwin deleted the delete_history branch December 27, 2024 21:40
@JonnyWong16
Copy link
Collaborator

Is it still worth it to remove the extra attributes?

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.

2 participants