Skip to content

Library totalSize overwritten when using search with libtype #695

Description

@JonnyWong16

Describe the issue
The library cached _total_size value is overwritten when using search with a different libtype than the main library type.

https://github.com/pkkid/python-plexapi/blob/4.4.1/plexapi/library.py#L380

This causes the totalSize property to return the cached value instead of the correct value.

https://github.com/pkkid/python-plexapi/blob/4.4.1/plexapi/library.py#L393

Code snipppets

>>> library = plex.library.section("TV Shows")
>>> print(library.totalSize)
2  # This is the number of TV Shows in the library
>>> library.searchEpisodes()  # This calls library.search(libtype='episode')
>>> print(library.totalSize)
51  # This is now the number of episodes in the library.

Expected behavior
Library totalSize should always be the number of items of the main library type (i.e. number of shows).

Enviroment (please complete the following information):

  • PlexAPI version: 4.4.1

Activity

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions