Skip to content

AttributeError: 'Plex' object has no attribute 'remove_label' when kometa_integration=true #48

@sjabby

Description

@sjabby

This is for the mediux-api branch

Describe the bug
When kometa_integration = true is set in the configuration, the application crashes with an AttributeError because the remove_label method is not implemented in the Plex service class.
Error: AttributeError: 'Plex' object has no attribute 'remove_label'
Full stack trace:
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /root/.local/share/pipx/venvs/mediux-posters/lib64/python3.11/site-packages/mediux_posters/mai │
│ n
.py:381 in sync_posters │
│ │
│ 378 │ │ │ │ │ │ only_priority_usernames=settings.only_priority_usernames, │
│ 379 │ │ │ │ │ ) │
│ 380 │ │ │ │ for set_data in filtered_sets: │
│ ❱ 381 │ │ │ │ │ if not process_set_data( │
│ 382 │ │ │ │ │ │ entry=entry, │
│ 383 │ │ │ │ │ │ set_data=set_data, │
│ 384 │ │ │ │ │ │ mediux=mediux, │
│ │
│ /root/.local/share/pipx/venvs/mediux-posters/lib64/python3.11/site-packages/mediux_posters/mai │
│ n
.py:186 in process_set_data │
│ │
│ 183 │ │ │ │ last_updated=file.last_updated, │
│ 184 │ │ │ ) │
│ 185 │ │
│ ❱ 186 │ process_image( │
│ 187 │ │ obj=entry, │
│ 188 │ │ file_type=FileType.POSTER, │
│ 189 │ │ id_value=entry.tmdb_id, │
│ │
│ /root/.local/share/pipx/venvs/mediux-posters/lib64/python3.11/site-packages/mediux_posters/mai │
│ n
.py:170 in process_image │
│ │
│ 167 │ │ │ return │
│ 168 │ │ │
│ 169 │ │ try: │
│ ❱ 170 │ │ │ success = service.upload_image( │
│ 171 │ │ │ │ object_id=obj.id, image_file=image_file, kometa_integration=kometa_integ │
│ 172 │ │ │ ) │
│ 173 │ │ except ServiceError as err: │
│ │
│ /root/.local/share/pipx/venvs/mediux-posters/lib64/python3.11/site-packages/mediux_posters/servi │
│ ces/plex/service.py:333 in upload_image │
│ │
│ 330 │ │ │ │ │ │ │ body=stream.read(), │
│ 331 │ │ │ │ │ │ ) │
│ 332 │ │ │ │ │ if kometa_integration: │
│ ❱ 333 │ │ │ │ │ │ self.remove_label("Overlay", object_id=object_id) │
│ 334 │ │ │ │ return True │
│ 335 │ │ │ except ServiceError as err: │
│ 336 │ │ │ │ LOGGER.error( │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
To Reproduce

Set kometa_integration = true in ~/.config/mediux-posters/settings.toml
Run any sync operation (e.g., mediux-posters sync)
Wait for the application to download and attempt to upload images
See error when it tries to remove Overlay labels

Expected behavior
When kometa_integration = true, the application should successfully remove the "Overlay" label from media items after uploading posters/backdrops without crashing.
Screenshots
N/A - This is a code error, not a visual issue.
Additional context

Version: mediux-posters v0.5.0
Python: 3.11.11
Branch: mediux-api
Installation method: pipx

Workaround: Setting kometa_integration = false allows the application to work correctly.
Technical details: The error occurs in /services/plex/service.py line 333 where self.remove_label("Overlay", object_id=object_id) is called, but this method doesn't exist in the Plex class.

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions