@Override
    public void patch() throws MalformedURLException, IOException, NoSuchAlgorithmException {
        currentFile = "Reading manifest";
        ReleaseManifest mf = ReleaseManifest.getReleaseManifest(project, targetVersion, branch, type);
        
        ArrayList<LoLPatcher.Archive> archivesToPurge = new ArrayList<>();
        
        ArrayList<ManifestFile> files = new ArrayList<>(mf.files.length);
        Collections.addAll(files, mf.files);
        
        Collections.sort(files, new Comparator<ManifestFile>() {
            @Override
            public int compare(ManifestFile o1, ManifestFile o2) {
                return Integer.compare(o1.releaseInt , o2.releaseInt);
            }
        });
        
        LoLPatcher.Archive lastArchive = null;
        for(ManifestFile f : files){
            if(f.fileType == 22 || f.fileType == 6){
                if(lastArchive == null || !lastArchive.versionName.equals(f.release)){
                    lastArchive = new LoLPatcher.Archive(f.release, new ArrayList<ManifestFile>());
                    archivesToPurge.add(lastArchive);
                }
                lastArchive.files.add(f);
            }
        }
        nArchives = archivesToPurge.size();
        for(int i = 0; i < archivesToPurge.size(); i++){
            globalPercentage = ((float) i / nArchives);
            purgeArchive(archivesToPurge.get(i));
            if(done) return;
        }
        done = true;
        globalPercentage = 1;
        archivePercentage = 0;
    }