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

Added Season scene exception indicators to displayShow #82

Merged
merged 1 commit into from
Mar 7, 2016

Conversation

p0psicles
Copy link
Contributor

This PR is here for everyone to review and give his/here approval.
If things are missing, we need to add features or whatever, let me know. Will push against this PR.

If approved i'll merge.

, using the scene_exceptions saved in the cache scene_exceptions table.

Xem season scene mappings are shown through the xem icon, through the img elements title attribute. Sickrage's scene name exceptions are indicated through the sickrage ico file.

We do need to change the sickrage logo to the Medusa logo.

Xem scene exceptions are mapped from the season to sceneseason json.
Season excepions from the sickrage github file are directly mapped to the season number.

#50

@medariox
Copy link
Contributor

medariox commented Mar 3, 2016

2016-03-03 15:41:40 Thread-18 :: [f98aec4] Failed doing webui callback: Traceback (most recent call last):
  File "/home/orangepi/.sickrage-exc/sickbeard/webserve.py", line 287, in async_call
    result = function(**kwargs)
TypeError: getSeasonSceneExceptions() takes exactly 3 arguments (2 given)

2016-03-03 15:41:12 Thread-16 :: [f98aec4] Failed doing webui callback: Traceback (most recent call last):
  File "/home/orangepi/.sickrage-exc/sickbeard/webserve.py", line 287, in async_call
    result = function(**kwargs)
TypeError: getSeasonSceneExceptions() takes exactly 3 arguments (2 given)

2016-03-03 15:40:25 Thread-20 :: [f98aec4] Failed doing webui callback: Traceback (most recent call last):
  File "/home/orangepi/.sickrage-exc/sickbeard/webserve.py", line 287, in async_call
    result = function(**kwargs)
TypeError: getSeasonSceneExceptions() takes exactly 3 arguments (1 given)

2016-03-03 15:39:25 Thread-19 :: [f98aec4] Failed doing webui callback: Traceback (most recent call last):
  File "/home/orangepi/.sickrage-exc/sickbeard/webserve.py", line 287, in async_call
    result = function(**kwargs)
TypeError: getSeasonSceneExceptions() takes exactly 3 arguments (2 given)

Every time I open a show page I get this error.

Either you make sure that 'indexer' exists, or you set a default value for it, like:
getSeasonSceneExceptions(self, indexer_id, indexer=1)
and don't forget the snake_case (get_season_scene_exceptions)!

for tvdb_season_ep, anidb_season_ep in get_xem_numbering_for_show(indexer_id, indexer).iteritems():
if not xem_numbering_season.get(str(tvdb_season_ep[0])):
xem_numbering_season[str(tvdb_season_ep[0])] = str(anidb_season_ep[0])

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just?

for season, xem_season in get_xem_numbering_for_show(indexer_id, indexer).items():
            xem_numbering_season[season[0]] = xem_season[0]

.items() for py3 compatibility. Don't need str() and I would avoid it everywhere it's not needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@medariox and even better yet, make it a dict comprehension:

xem_numbering_season = {
    season[0]: xem[0] 
    for season, xem in get_xem_numbering_for_show(indexer_id, indexer).items()
}

also exceptionLists should be both snake_case (and keys shouldn't be camel case) and a dict literal e.g.:

exception_lists = {
    'season_exceptions': sickbeard.scene_exceptions.get_all_scene_exceptions(indexer_id),
    'xem_numbering': xem_numbering_season,  # can also use dict comprehension here directly.
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Items() is slow and memory expensive in python2. Actually i Used items() but changed it after feedback. I need the string there else its passed as int. If someone wants to commit the snakecase, i think it's fine.

…ne_exceptions saved in the cache scene_exceptions table.

Xem season scene mappings are shown through the xem icon, through the img elements title attribute. Sickrage's scene name exceptions are indicated through the sickrage ico file.

We do need to change the sickrage logo to the Medusa logo.
@p0psicles p0psicles force-pushed the thexem-per-season-indication branch from 2eb9430 to 45a8b10 Compare March 7, 2016 09:06
@medariox
Copy link
Contributor

medariox commented Mar 7, 2016

Approved

Approved with PullApprove

medariox added a commit that referenced this pull request Mar 7, 2016
Added Season scene exception indicators to displayShow
@medariox medariox merged commit 36c23f2 into develop Mar 7, 2016
@fernandog fernandog deleted the thexem-per-season-indication branch March 7, 2016 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants