Skip to content

Conversation

@Dr-Blank
Copy link
Contributor

@Dr-Blank Dr-Blank commented Feb 21, 2024

Description

fetchItems returns a MediaContainer, exactly how server does and is also a python list! Hence it would not break any current api.
additionally, it now supports totalSize attr

The only breaking change is that MediaContainer can now only accept initpath and parent as keword-only arguments in its initialisation, which I don't think anyone would be using.

Fixes #1372

Type of change

Please delete options that are not relevant.

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 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

@Dr-Blank Dr-Blank changed the title MediaContainer class is now a list MediaContainer class is now a list Feb 21, 2024
- can now support totalSize as returned from server
@Dr-Blank Dr-Blank marked this pull request as ready for review February 21, 2024 18:52
@Dr-Blank

This comment was marked as resolved.

@Dr-Blank

This comment has been minimized.

@JonnyWong16
Copy link
Collaborator

This looks greats. It seems to be mostly working, but is it possible to load the other MediaContainer attributes as well?

>> results = plex.library.section("Movies (Test)").all()  # results is now a MediaContainer
>> results.librarySectionID  # this is None
<MediaContainer size="17" allowSync="1" art="/:/resources/movie-fanart.jpg" identifier="com.plexapp.plugins.library" librarySectionID="41" librarySectionTitle="Movies (Test)" librarySectionUUID="e9535986-3fd3-4f88-9793-77a50b04dd01" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1708667686" thumb="/:/resources/movie.png" title1="Movies (Test)" title2="All Movies (Test)" viewGroup="movie" viewMode="65592">

results is initialized with empty data = Element('MediaContainer') which never gets updated with the attributes from the XML.
subresults gets initialized with the actual data from the XML (from items inside findItems()).

@Dr-Blank
Copy link
Contributor Author

Dr-Blank commented Mar 31, 2024

is it possible to load the other MediaContainer attributes as well?

06819fa solves this

test fails seems unrelated

@JonnyWong16 JonnyWong16 merged commit b836d24 into pushingkarmaorg:master Mar 31, 2024
@Dr-Blank Dr-Blank deleted the mediaContainer branch April 1, 2024 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

totalSize of MediaContainer

2 participants