Skip to content

Removing all tags does not return empty list #660

@JonnyWong16

Description

@JonnyWong16

Describe the issue
The changes in #594 prevent empty tags from being reloaded since you cannot overwrite an attribute with an empty list

Code snipppets

>>> from plexapi.server import PlexServer
>>> plex = PlexServer()
>>> movie = plex.fetchItem(414)
>>> movie.labels
[]
>>> movie.addLabel("Test")
>>> movie.reload()
>>> movie.labels
[<Label:1302:Test>]
>>> movie.removeLabel("Test")
>>> movie.reload()
>>> movie.labels  # this should be an empty list
[<Label:1302:Test>]

The label is removed from Plex and it doesn't show up in the movie's XML, but movie.labels still shows it after reloading.

image

The current workaround is to fetch the item again instead of reloading.

>>> movie = plex.fetchItem(414)
>>> movie.labels
[]

Expected behavior
Tags should return an empty list after they are all removed from Plex.

Enviroment (please complete the following information):

  • OS: Windows
  • Plex version 1.21.2.3997
  • Python Version 3.9.0
  • PlexAPI version 4.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions