Skip to content

Post Processing Queue Management

kevinlekiller edited this page Dec 29, 2016 · 62 revisions

Post-Processing attempts up to 6 times for each release, prioritising new releases over the ones it has tried previously. Should there be many thousands queued for post-processing it may appear that the releases are not being processed, however this is seldom the case.

Note: Some of the queries below ARE out of date. e.g. When min/max size to post-process are non-zero. They remain here as examples.

This query provides the total number of releases needing post-processing:

SELECT passwordstatus, count(*) FROM releases r LEFT JOIN categories c ON c.id = r.categories_id WHERE r.passwordstatus BETWEEN -6 AND -1 AND r.haspreview = -1 AND c.disablepreview = 0 GROUP BY r.passwordstatus;

Various SQL Queries for the Post-Processing Queues

NFO

const NFO_FAILED = -9; // We failed to get a NFO after admin set max retries.
const NFO_UNPROC = -1; // Release has not been processed yet.
const NFO_NONFO  =  0; // Release has no NFO.
const NFO_FOUND  =  1; // Release has an NFO.

Count Queued

> SELECT nfostatus,COUNT(*) FROM releases WHERE nzbstatus = 1 AND nfostatus between -8 and -1 group by nfostatus;

Find Queued

> SELECT ID,nfostatus,guid,searchname FROM releases WHERE nfostatus between -8 and -1;

Clear Queued

> update releases set nfostatus = -9 where nfostatus between -8 and -1;

Audio

Count Queued

> select count(*) from releases WHERE musicinfo_ID IS NULL and nzbstatus = 1 and categories_ID BETWEEN 3000 AND 3999;

Find Queued

> select ID,musicinfo_ID,name from releases WHERE musicinfo_ID IS NULL and nzbstatus = 1 and categories_ID BETWEEN 3000 AND 3999;

Clear Queued

> update releases set musicinfo_ID = '-2' where musicinfo_ID IS NULL and nzbstatus = 1 and categories_ID BETWEEN 3000 AND 3999;

TV

const PROCESS_TVDB   =  0;   // Process TVDB First
const PROCESS_TVMAZE = -1;   // Process TVMaze Second
const PROCESS_TMDB   = -2;   // Process TMDB Third
const PROCESS_TRAKT  = -3;   // Process Trakt Fourth
const PROCESS_IMDB   = -4;   // Process IMDB Fifth
const PROCESS_TVRAGE = -5;   // Process TvRage Sixth
const NO_MATCH_FOUND = -6;   // Failed All Methods
const FAILED_PARSE   = -100; // Failed Parsing

Count Queued

> SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 AND categories_id BETWEEN 5000 AND 5999 AND categories_id != 5070 AND videos_id = 0 AND tv_episodes_id BETWEEN -3 AND 0 AND size > 1048576;

Find Queued

> SELECT id, passwordstatus, name from releases WHERE nzbstatus = 1 AND categories_id BETWEEN 5000 AND 5999 AND categories_id != 5070 AND videos_id = 0 AND tv_episodes_id BETWEEN -3 AND 0 AND size > 1048576;

Movies

Count Queued

> select count(*) FROM releases WHERE imdbID IS NULL and categories_ID BETWEEN 2000 AND 2999 AND nzbstatus = 1;

Find Queued

> select id,passwordstatus,name FROM releases WHERE imdbID IS NULL and categories_ID BETWEEN 2000 AND 2999 AND nzbstatus = 1;

Set imdbID

> update example: update releases set imdbID = 1686784 WHERE id = 3789422; 

Reset for re-postprocessing

> update releases set imdbID = NULL WHERE imdbID = 0 and categories_ID BETWEEN 2000 AND 2999; 

Misc (Additional)

This is the sum of PC(4000), Pron(6000) and Misc(7000).

Count Queued

> SELECT count(*) FROM releases r left join categories c on c.ID = r.categories_ID where (r.passwordstatus between -6 and -1) and (r.haspreview = -1 and c.disablepreview = 0);

Find Queued

> SELECT r.ID,r.passwordstatus,adddate,name FROM releases r left join categories c on c.ID = r.categories_ID where (r.passwordstatus between -6 and -1) and (r.haspreview = -1 and c.disablepreview = 0);

Clear Queued

> update releases r left join categories c on c.ID = r.categories_ID set passwordstatus = 0 where (r.passwordstatus between -6 and -1) and (r.haspreview = -1 and c.disablepreview = 0);

Console

Count Queued

> SELECT COUNT(*) FROM releases WHERE nzbstatus = 1 AND categories_id BETWEEN 1000 AND 1999 AND consoleinfo_id IS NULL;
Clone this wiki locally