| Conditions | 5 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 5.1158 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | 1 | from plugin.sync.core.playlist.mapper.handlers.base import PlaylistHandler |
|
| 44 | 1 | def build_key(self, item): |
|
| 45 | 1 | i_type = type(item) |
|
| 46 | |||
| 47 | 1 | if i_type is Movie: |
|
| 48 | 1 | return [item.pk] |
|
| 49 | |||
| 50 | 1 | if i_type is Show: |
|
| 51 | 1 | return [item.pk] |
|
| 52 | |||
| 53 | 1 | if i_type is Season: |
|
| 54 | 1 | return [item.show.pk, item.pk] |
|
| 55 | |||
| 56 | 1 | if i_type is Episode: |
|
| 57 | 1 | return [item.show.pk] + list(item.pk) |
|
| 58 | |||
| 59 | log.debug('Ignoring unsupported list item: %r', item) |
||
| 60 | return None |
||
| 61 | |||
| 75 |