python-plexapi
python-plexapi copied to clipboard
Feature: Add librarySectionTitle for playlist items
Description
Similarly to https://github.com/pkkid/python-plexapi/pull/1335, add librarySectionTitle, this is present on local playlist entries.
The source attribute should be on
- [x] Movie
- [x] Episode
- [x] Track
- [x] Photo (Already present: cf56d9a13)
The diff of local/remove items can be seen here:
- https://github.com/pkkid/python-plexapi/pull/1335#issuecomment-1880296495
Type of change
Please delete options that are not relevant.
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] 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
This was already present on Photo: cf56d9a13c8c8e48ed2170564bb19033f628a7c0, should other attributes like librarySectionID, librarySectionKey be added as well? Is the comment "(local playlist item only)" correct? valuable?
Also: What about tagline, titleSort?
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?
🚧 Never link to branches, share a permalink 🚧
- see https://news.ycombinator.com/item?id=8046710 and https://help.github.com/articles/getting-permanent-links-to-files/ and https://docs.gitlab.com/ee/user/shortcuts.html#project-files
- hit
y - and perhaps for https://github.com/josephfrazier/octopermalinker (GitHub)
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.
I know librarySectionTitle works on Video items (Movie and Episode), the others I copied to be alike https://github.com/pkkid/python-plexapi/pull/1335
Ok, misread, I see what you mean, Episode and Movie extend from Video class, so yes. they should work.
🚧 Never link to branches, share a permalink 🚧
- see https://news.ycombinator.com/item?id=8046710 and https://help.github.com/articles/getting-permanent-links-to-files/ and https://docs.gitlab.com/ee/user/shortcuts.html#project-files
- hit
y- and perhaps for https://github.com/josephfrazier/octopermalinker (GitHub)
NOTE: edit your post and fix it with a permalink!
PS: gitlab has a bug and you need to reload a page before
yworks.
Github mobile app doesn't do permalinks.
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")
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.
yes. removeItems fails with 404 errors, as it loads from wrong server.
building a proper _server may be difficult, as it requires URL and token. or are they available from myPlex?