Giter Club home page Giter Club logo

Comments (6)

ttufts avatar ttufts commented on May 5, 2024

Expect a pull request for this added functionality in the next few hours. Working on it now.

from python-plexapi.

ttufts avatar ttufts commented on May 5, 2024

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.

pkkid avatar pkkid commented on May 5, 2024

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.

ttufts avatar ttufts commented on May 5, 2024

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.

ttufts avatar ttufts commented on May 5, 2024

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.

pkkid avatar pkkid commented on May 5, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.