Code Duplication    Length = 22-26 lines in 2 locations

Trakttv.bundle/Contents/Libraries/Shared/plugin/sync/modes/push/shows.py 1 location

@@ 100-125 (lines=26) @@
97
        self.run_shows()
98
        self.run_episodes()
99
100
    @elapsed.clock
101
    def run_shows(self):
102
        # Iterate over plex shows
103
        for sh_id, guid, p_show in self.p_shows:
104
            # Increment one step
105
            self.current.progress.group(Shows, 'matched:shows').step()
106
107
            # Process `p_guid` (map + validate)
108
            match = GuidParser.parse(guid)
109
110
            if not match.supported:
111
                mark_unsupported(self.p_shows_unsupported, sh_id, guid)
112
                continue
113
114
            if not match.found:
115
                log.info('Unable to find identifier for: %s/%s (rating_key: %r)', guid.service, guid.id, sh_id)
116
                continue
117
118
            # Process show
119
            self.run_show(sh_id, match, p_show)
120
121
            # Task checkpoint
122
            self.checkpoint()
123
124
        # Stop progress group
125
        self.current.progress.group(Shows, 'matched:shows').stop()
126
127
    def run_show(self, sh_id, match, p_show):
128
        # Try retrieve `pk` for `key`

Trakttv.bundle/Contents/Libraries/Shared/plugin/sync/modes/fast_pull/shows.py 1 location

@@ 86-107 (lines=22) @@
83
        self.run_shows()
84
        self.run_episodes()
85
86
        # Log details
87
        log_unsupported(log, 'Found %d unsupported show(s)', self.p_shows_unsupported)
88
89
    def run_shows(self):
90
        # Iterate over plex shows
91
        for sh_id, guid, p_show in self.p_shows:
92
            # Increment one step
93
            self.current.progress.group(Shows, 'shows').step()
94
95
            # Parse guid
96
            match = GuidParser.parse(guid)
97
98
            if not match.supported:
99
                mark_unsupported(self.p_shows_unsupported, sh_id, guid)
100
                continue
101
102
            if not match.found:
103
                log.info('Unable to find identifier for: %s/%s (rating_key: %r)', guid.service, guid.id, sh_id)
104
                continue
105
106
            # Process show
107
            self.run_show(sh_id, match, p_show)
108
109
        # Stop progress group
110
        self.current.progress.group(Shows, 'shows').stop()