Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
application/cache/
application/config/config.php
application/config/database.php
application/config/iarchive_uploader.php
Expand Down
2 changes: 1 addition & 1 deletion application/config/migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

$config['migration_enabled'] = TRUE;
$config['migration_type'] = 'sequential';
$config['migration_version'] = 4;
$config['migration_version'] = 5;
$config['migration_path'] = APPPATH . 'migrations/';
2 changes: 1 addition & 1 deletion application/controllers/private/Iarchive_upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function upload()

//update the project
$update['url_iarchive'] = $config['iarchive_project_page'] . '/' . $params['project_slug'];
$update['zip_url'] = 'https://www.archive.org/download/' . $params['project_slug'] . '/' . $params['project_slug'] . '_64kb_mp3.zip';
$update['zip_url'] = 'https://archive.org/compress/' . $params['project_slug'] . '/formats=64KBPS MP3&file=/' . $params['project_slug'] . '.zip';

$this->project_model->update($project->id, $update);

Expand Down
18 changes: 18 additions & 0 deletions application/migrations/005_fix_zip_urls_2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

defined('BASEPATH') OR exit('No direct script access allowed');

class Migration_Fix_zip_urls_2 extends CI_Migration {

public function up()
{
$this->db->query('
UPDATE projects
SET zip_url = REGEXP_REPLACE(zip_url, ".*archive.org/download/(.*)/(.*)_[0-9]+kb_mp3.zip", "https://archive.org/compress/\\\1/formats=64KBPS MP3&file=/\\\2.zip")
WHERE zip_url LIKE "%archive.org/download/%"
');
}

public function down(): void
{}
}