Skip to content

Conversation

@JonnyWong16
Copy link
Collaborator

Description

Add logos to music, photos collections, and playlists

Type of change

Please delete options that are not relevant.

  • 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

Copilot AI review requested due to automatic review settings November 18, 2025 17:38
Copilot finished reviewing on behalf of JonnyWong16 November 18, 2025 17:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds logo support to music library items (artists, albums, tracks), photo collections (photoalbums, photos), playlists, and collections by incorporating LogoMixin and LogoUrlMixin into their class definitions.

Key Changes:

  • Added LogoMixin to classes that support editing/uploading (Artist, Album, Photoalbum, Collection, Playlist)
  • Added LogoUrlMixin to classes with read-only access (Track, Photo)
  • Added comprehensive test coverage for the new logoUrl attribute across all affected entities

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
plexapi/audio.py Added LogoMixin to Artist and Album classes, LogoUrlMixin to Track class
plexapi/photo.py Added LogoMixin to Photoalbum class, LogoUrlMixin to Photo class
plexapi/collection.py Added LogoMixin to Collection class
plexapi/playlist.py Added LogoMixin to Playlist class
tests/test_mixins.py Added attr_logoUrl test function to validate logoUrl property
tests/test_audio.py Added logoUrl tests for Artist, Album, and Track
tests/test_photo.py Added logoUrl test for Photoalbum
tests/test_collection.py Added logoUrl test for Collection
tests/test_playlist.py Added logoUrl tests for Playlist
tests/test_video.py Added logoUrl tests for Movie, Show, Season, and Episode
Comments suppressed due to low confidence (1)

tests/test_mixins.py:308

  • The attr_logoUrl function calls _test_mixins_imageUrl(obj, "logo"), which will fail with an AttributeError.

The _test_mixins_imageUrl function at line 292 does if getattr(obj, attr):, which for logos means getattr(obj, "logo"). However, unlike art and thumb attributes that are loaded from XML in _loadData methods, there is no logo attribute on these objects.

The LogoUrlMixin.logoUrl property looks for logos in the images list (checking for type == 'clearLogo'), not from a logo attribute. This is different from how artUrl and posterUrl work.

To fix this, either:

  1. Add self.logo = data.attrib.get('logo') to the _loadData methods of all classes using LogoMixin/LogoUrlMixin (if Plex XML includes a logo attribute), OR
  2. Modify _test_mixins_imageUrl to handle logos specially, perhaps using hasattr with a try-except, or checking the images list directly for logos.
    url = getattr(obj, attr + "Url")
    if getattr(obj, attr):
        assert url.startswith(utils.SERVER_BASEURL)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JonnyWong16 JonnyWong16 merged commit bc74728 into pushingkarmaorg:master Nov 18, 2025
5 checks passed
@JonnyWong16 JonnyWong16 changed the title Add logos to music, photos collections, and playlists Add logos to music, photos, collections, and playlists Nov 18, 2025
@JonnyWong16 JonnyWong16 deleted the feature/logos branch November 18, 2025 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant