| Total Complexity | 5 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Coverage | 44.44% |
| 1 | 1 | from plugin.sync.core.enums import SyncMode |
|
| 9 | 1 | class Push(Mode): |
|
| 10 | 1 | mode = SyncMode.Push |
|
| 11 | |||
| 12 | 1 | children = [ |
|
| 13 | Movies, |
||
| 14 | Shows |
||
| 15 | ] |
||
| 16 | |||
| 17 | 1 | @elapsed.clock |
|
| 18 | def construct(self): |
||
| 19 | # Start progress tracking |
||
| 20 | self.current.progress.start() |
||
| 21 | |||
| 22 | # Construct children |
||
| 23 | self.execute_children('construct') |
||
| 24 | |||
| 25 | @elapsed.clock |
||
| 26 | def start(self): |
||
| 27 | # Fetch changes from trakt.tv |
||
| 28 | self.trakt.refresh() |
||
| 29 | |||
| 30 | # Build key table for lookups |
||
| 31 | self.trakt.build_table() |
||
| 32 | |||
| 33 | # Start children |
||
| 34 | self.execute_children('start') |
||
| 35 | |||
| 36 | @elapsed.clock |
||
| 37 | def run(self): |
||
| 38 | with self.plex.prime(): |
||
| 39 | # Run children |
||
| 40 | self.execute_children('run') |
||
| 41 | |||
| 42 | # Send artifacts to trakt |
||
| 43 | self.current.artifacts.send() |
||
| 44 | |||
| 45 | @elapsed.clock |
||
| 46 | def stop(self): |
||
| 47 | # Stop children |
||
| 48 | self.execute_children('stop') |
||
| 49 | |||
| 50 | # Stop progress tracking |
||
| 51 | self.current.progress.stop() |
||
| 52 |