Comments (6)
Expect a pull request for this added functionality in the next few hours. Working on it now.
from python-plexapi.
The major problem with implementing this is the modular way that the XML parsing is done. When an item is built it doesn't have any context of where it was in the XML that came from Plex.
To pass this info down to the Season/Episode objects will require passing down an 'index' parameter into the object.
OR
after an item has been built, if it is part of a list it's index can be added to the item as an 'index' attribute, which could then be read. The downside to this is that the object is already created, and the listItems function doesn't know what type of object it is. It's a bit ugly to put in a 'if type == season' conditional in the listItems function, but it's also very ugly to persist 'index' as a parameter way down to the leaf object constructors.
from python-plexapi.
I've been thinking about this problem a bit as well. The Season objects used to include index
and parentTitle
attributes, but seems to have been removed sometime in the last few months. not sure about the best way to solve it.
The problem with knowing where you came from is not ideal either because you may not always go through a Season object through it's Show (you can go directly there if you wanted). Maybe we do a combination of both. Pass in the index if we have it, make a second request to the Show (from the Season) if we request index and do not have it yet?
from python-plexapi.
I'm currently testing a solution that uses a little bit of both.
I'm adding an 'index' attribute to 'elem' when looping through listItems. Then retrieving that attribute from 'data' in the Season and Episode '_loadData' functions. The only thing I haven't tested is your suggestion, getting all episodes from a Show, instead of from Season. This uses allLeaves, so it will probably lose the index. I like your suggestion of a combination of both. I'll experiment with it and see what I can do.
from python-plexapi.
Pull Request #55 should solve this issue. Only added 5 lines I think. Was pretty easy to add and I think it's a fairly elegant solution.
from python-plexapi.
commit 36b5d12
Author: Michael Shepanski [email protected]
Date: Thu May 19 23:42:06 2016 -0400
Add back missing index value from Show,Season,Episode; Make season numbers a bit easier to fetch
from python-plexapi.
Related Issues (20)
- Unable to connect to a Plex HTPC client HOT 3
- Add Type Hints to Improve Codebase Readability and Maintainability HOT 1
- Show and Season from the video module use wrong key to get subtitleLanguage attribute
- Add support for track genres in music libraries HOT 1
- feat: python class for available filters HOT 3
- Add support for Plex Profile Watch History and Ratings
- Library section lookup clobbered when multiple libraries have the same title
- editAlbum Missing ... HOT 1
- Unable to find Libraries after using PlexApi based python script. HOT 5
- locations is empty when casting to dict HOT 2
- Add 'merge' method for music albums
- Ability to Modify MovieHistory & EpisodeHistory details HOT 1
- Bad Request response when adding library with default language
- Issues creating `PlexClient` instances from `PlexServer` sessions in 4.15.8 HOT 1
- feat: Endpoint for computing sonic adventure
- Add View History Manually HOT 2
- Streams in MediaParts empty (reload() has no effect)
- `totalSize` of MediaContainer
- createPlaylist does not guard smart=True and non-empty items HOT 2
- "Invalid library sectionID: None" after PlexPartialObject.reload() HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-plexapi.