Conditions | 3 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
1 | 1 | from plugin.sync.core.enums import SyncData, SyncMode, SyncMedia |
|
14 | @elapsed.clock |
||
15 | def run(self): |
||
16 | # Retrieve plex sections |
||
17 | p_sections, p_sections_map = self.sections() |
||
18 | |||
19 | # Retrieve plex playlists |
||
20 | p_playlists = dict(self.get_playlists()) |
||
21 | |||
22 | # Retrieve trakt lists |
||
23 | t_lists = self.trakt[(SyncMedia.Lists, SyncData.Liked)] |
||
24 | |||
25 | if t_lists is None: |
||
26 | log.warn('Unable to retrieve liked lists') |
||
27 | return |
||
28 | |||
29 | # Process trakt lists |
||
30 | for _, t_list in t_lists.items(): |
||
31 | self.process(SyncData.Liked, p_playlists, p_sections_map, t_list) |
||
32 | |||
41 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.