From ae3d3b31e9c2cd649b0e59bc5ae5ca2d4b86efa2 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Fri, 30 Nov 2018 10:22:17 +0100 Subject: [PATCH] Update groupFixRelNames.php --- Changelog | 1 + misc/update/tmux/bin/groupfixrelnames.php | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index 1f82be3cc..8ee051e83 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2018-11-30 DariusIII + * Chg: Update groupFixRelNames.php * Chg: Add prox_crc32 column to releases table and adjust NameFixer class * Chg: Update spatie/laravel-permission to version 2.28 2018-11-29 DariusIII diff --git a/misc/update/tmux/bin/groupfixrelnames.php b/misc/update/tmux/bin/groupfixrelnames.php index 9a8708567..23d9e4aab 100644 --- a/misc/update/tmux/bin/groupfixrelnames.php +++ b/misc/update/tmux/bin/groupfixrelnames.php @@ -37,12 +37,13 @@ switch (true) { SELECT r.id AS releases_id, r.guid, r.groups_id, r.categories_id, r.name, r.searchname, r.proc_nfo, r.proc_uid, r.proc_files, r.proc_par2, r.ishashed, r.dehashstatus, r.nfostatus, - r.size AS relsize, r.predb_id, r.proc_hash16k, r.proc_srr, + r.size AS relsize, r.predb_id, r.proc_hash16k, r.proc_srr, r.proc_crc32, IFNULL(rf.releases_id, 0) AS fileid, IF(rf.ishashed = 1, rf.name, 0) AS filehash, IFNULL(GROUP_CONCAT(rf.name ORDER BY rf.name ASC SEPARATOR '|'), '') AS filestring, IFNULL(UNCOMPRESS(rn.nfo), '') AS textstring, IFNULL(ru.uniqueid, '') AS uid, - IFNULL(ph.hash, 0) AS hash + IFNULL(ph.hash, 0) AS hash, + IFNULL(rf.crc32, '') as crc FROM releases r LEFT JOIN release_nfos rn ON r.id = rn.releases_id LEFT JOIN release_files rf ON r.id = rf.releases_id @@ -65,6 +66,7 @@ switch (true) { OR r.proc_par2 = %d OR r.proc_srr = %d OR r.proc_hash16k = %d + OR r.proc_crc32 = %d OR ( r.ishashed = 1 @@ -86,6 +88,7 @@ switch (true) { NameFixer::PROC_PAR2_NONE, NameFixer::PROC_SRR_NONE, NameFixer::PROC_HASH16K_NONE, + NameFixer::PROC_CRC_NONE, Category::getCategoryOthersGroup(), $maxPerRun ) @@ -125,6 +128,18 @@ switch (true) { } $nameFixer->reset(); + if ((int) $release->proc_crc32 === NameFixer::PROC_CRC_NONE && ! empty($release->crc)) { + $colorCli->primaryOver('C'); + $nameFixer->crcCheck($release, true, 'CRC32, ', 1, 1); + } + // Not all gate requirements in query always set column status as PP Add check is in query + $nameFixer->_updateSingleColumn('proc_crc32', NameFixer::PROC_CRC_DONE, $release->releases_id); + + if ($nameFixer->matched) { + continue; + } + $nameFixer->reset(); + if ((int) $release->proc_srr === NameFixer::PROC_SRR_NONE) { $colorCli->primaryOver('sr'); $nameFixer->srrNameCheck($release, true, 'SRR, ', 1, 1);