Code Duplication    Length = 12-12 lines in 2 locations

App/Downloader.php 2 locations

@@ 169-180 (lines=12) @@
166
    {
167
        $this->system->createFolderIfNotExists(LESSONS_FOLDER);
168
        Utils::box('Downloading Lessons');
169
        foreach ($diff['lessons'] as $lesson) {
170
171
            if($this->client->downloadLesson($lesson) === false) {
172
                $counter['failed_lesson']++;
173
            }
174
175
            Utils::write(sprintf("Current: %d of %d total. Left: %d",
176
                $counter['lessons']++,
177
                $new_lessons,
178
                $new_lessons - $counter['lessons'] + 1
179
            ));
180
        }
181
    }
182
183
    /**
@@ 195-206 (lines=12) @@
192
        Utils::box('Downloading Series');
193
        foreach ($diff['series'] as $serie => $episodes) {
194
            $this->system->createSerieFolderIfNotExists($serie);
195
            foreach ($episodes as $episode) {
196
197
                if($this->client->downloadSerieEpisode($serie, $episode) === false) {
198
                    $counter['failed_episode'] = $counter['failed_episode'] +1;
199
                }
200
201
                Utils::write(sprintf("Current: %d of %d total. Left: %d",
202
                    $counter['series']++,
203
                    $new_episodes,
204
                    $new_episodes - $counter['series'] + 1
205
                ));
206
            }
207
        }
208
    }
209