Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add librarySectionTitle for playlist items #1461

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

glensc
Copy link
Contributor

@glensc glensc commented Aug 31, 2024

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 changed the title Add librarySectionTitle for playlist items Feature: Add librarySectionTitle for playlist items Aug 31, 2024
@glensc
Copy link
Contributor Author

glensc commented Aug 31, 2024

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
Copy link
Collaborator

librarySectionTitle is already on the base Video and Audio object.

https://github.com/pkkid/python-plexapi/blob/master/plexapi%2Fvideo.py#L61

https://github.com/pkkid/python-plexapi/blob/master/plexapi%2Faudio.py#L74

Do those not work in playlists?

@glensc

This comment was marked as resolved.

@glensc
Copy link
Contributor Author

glensc commented Sep 1, 2024

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

@glensc
Copy link
Contributor Author

glensc commented Sep 1, 2024

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

@glensc glensc closed this Sep 1, 2024
@JonnyWong16
Copy link
Collaborator

🚧 Never link to branches, share a permalink 🚧

NOTE: edit your post and fix it with a permalink!

PS: gitlab has a bug and you need to reload a page before y works.

Github mobile app doesn't do permalinks.

@glensc
Copy link
Contributor Author

glensc commented Sep 1, 2024

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")

@glensc glensc reopened this Sep 1, 2024
@JonnyWong16
Copy link
Collaborator

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
Copy link
Contributor Author

glensc commented Sep 2, 2024

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

@glensc
Copy link
Contributor Author

glensc commented Sep 2, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants