Skip to content

Adding season and episode number to Season and Episode objects#55

Closed
ttufts wants to merge 1 commit intopushingkarmaorg:masterfrom
ttufts:master
Closed

Adding season and episode number to Season and Episode objects#55
ttufts wants to merge 1 commit intopushingkarmaorg:masterfrom
ttufts:master

Conversation

@ttufts
Copy link
Copy Markdown

@ttufts ttufts commented May 4, 2016

Added season_number and episode_number by pulling 'index' and 'parentIndex' in as episode_number and season_number respectively. This works for almost all situations, except when all episodes are pulled from a Show object, without going through seasons, the solution here is to check for 'parentIndex' when building the Episode object, if it is missing, the season() function is called and the season_number is pulled in from the Season object. This works in every situation that you can access an Episode or Season object, whether directly from the Show, or from the Season object.

…Index' in as episode_number and season_number respectively. This works for almost all situations, except when all episodes are pulled from a Show object, without going through seasons, the solution here is to check for 'parentIndex' when building the Episode object, if it is missing, the season() function is called and the season_number is pulled in from the Season object. This works in every situation that you can access an Episode or Season object, whether directly from the Show, or from the Season object.
@pkkid
Copy link
Copy Markdown
Collaborator

pkkid commented May 20, 2016

A implemented it slightly differently, but kept the main idea you had here. I realize what originally happened was during the v2 update last month I inadvertently removed the self.index attribute from the Show, Season, and Episode classes which had me confused and broke the old method of getting the season numbers. Anyway, thanks for the bug report and code! Let me know if this change works for you.

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

@pkkid pkkid closed this May 20, 2016
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