Feature: Add librarySectionTitle for playlist items by glensc · Pull Request #1461 · pushingkarmaorg/python-plexapi

@glensc

Description

Similarly to #1335, add librarySectionTitle, this is present on local playlist entries.

The source attribute should be on

  • Movie
  • Episode
  • Track
  • Photo (Already present: cf56d9a)

The diff of local/remove items can be seen here:

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • 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

@glensc

@glensc glensc changed the title Add librarySectionTitle for playlist items Feature: Add librarySectionTitle for playlist items

Aug 31, 2024

@glensc

This was already present on Photo: cf56d9a, should other attributes like librarySectionID, librarySectionKey be added as well? Is the comment "(local playlist item only)" correct? valuable?

Also: What about tagline, titleSort?

@JonnyWong16

@glensc

This comment was marked as resolved.

@glensc

I know librarySectionTitle works on Video items (Movie and Episode), the others I copied to be alike #1335

@glensc

Ok, misread, I see what you mean, Episode and Movie extend from Video class, so yes. they should work.

@JonnyWong16

@glensc

There is one problem, while assigning librarySectionTitle via Video class works, for remote items None is assigned, and accessing None triggers reload. and that reload is made to wrong server (local server)....

I've used such trickery for now:

librarySectionTitle = p.librarySectionTitle if p.__dict__.get("librarySectionTitle") is not None else None

or (easier to the eye)

librarySectionTitle = p._data.attrib.get("librarySectionTitle")

@JonnyWong16

Now that you bring it up, any action on a playlist item from a different server will fail (i.e. editing, playing, etc.) because of the incorrect _server object. I think the proper way to fix this (and your other related comment) is to fix it at a much lower level by setting the correct _server for the playlist object when they are built. I don't know how to do that yet, but I will think about it.

@glensc

yes. removeItems fails with 404 errors, as it loads from wrong server.

@glensc

building a proper _server may be difficult, as it requires URL and token. or are they available from myPlex?