| Total Complexity | 3 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Coverage | 41.67% |
| 1 | 1 | from plugin.sync.core.enums import SyncData, SyncMedia, SyncMode |
|
| 10 | 1 | class PersonalLists(Lists): |
|
| 11 | 1 | data = [SyncData.Personal] |
|
| 12 | 1 | mode = SyncMode.FastPull |
|
| 13 | |||
| 14 | 1 | @elapsed.clock |
|
| 15 | def run(self): |
||
| 16 | # Retrieve sections |
||
| 17 | p_sections, p_sections_map = self.sections() |
||
| 18 | |||
| 19 | # Retrieve playlists |
||
| 20 | p_playlists = dict(self.get_playlists()) |
||
| 21 | |||
| 22 | # Process list changes |
||
| 23 | self.process(SyncData.Personal, p_playlists, p_sections_map) |
||
| 24 | |||
| 25 | 1 | def create_playlist(self, uri, name): |
|
| 26 | # Check if playlist creation is enabled |
||
| 27 | if self.configuration['sync.lists.personal.playlists'] is False: |
||
| 28 | log.info('No playlist found named %r ("Create playlist in plex" not enabled)', name) |
||
| 29 | return None |
||
| 30 | |||
| 31 | # Create playlist |
||
| 32 | return super(PersonalLists, self).create_playlist(uri, name) |
||
| 33 |