sweeper/webif/plugin/sweeper/schema.js

422 lines
7.7 KiB
JavaScript
Raw Permalink Normal View History

2016-12-19 10:14:50 +00:00
var queueselect = {
decrypt: 'Decryption',
shrink: 'Shrink',
mp3: 'Audio Extraction',
mpg: 'Conversion to MPG'
};
2014-06-01 23:35:24 +00:00
var schema = {
criterion: {
lcn: {
2014-06-05 21:12:25 +00:00
'class': 'all',
2014-06-01 23:35:24 +00:00
type: 'int',
2014-06-03 17:23:03 +00:00
desc: 'Logical Channel Number',
negate: true,
2014-06-03 17:23:03 +00:00
def: "0"
2014-06-01 23:35:24 +00:00
},
duration: {
2014-06-05 21:12:25 +00:00
'class': 'all',
2014-06-01 23:35:24 +00:00
type: 'int',
2014-06-03 17:23:03 +00:00
desc: 'Recording duration (in minutes)',
negate: true,
2014-06-03 17:23:03 +00:00
def: "0"
2014-06-01 23:35:24 +00:00
},
schedduration: {
2014-06-05 21:12:25 +00:00
'class': 'all',
2014-06-01 23:35:24 +00:00
type: 'int',
2014-06-03 17:23:03 +00:00
desc: 'Scheduled duration (in minutes)',
negate: true,
2014-06-03 17:23:03 +00:00
def: "0"
2014-06-01 23:35:24 +00:00
},
size: {
2014-06-05 21:12:25 +00:00
'class': 'all',
2014-06-01 23:35:24 +00:00
type: 'int',
2014-06-03 17:23:03 +00:00
desc: 'Recording size (in bytes)',
negate: true,
2014-06-03 17:23:03 +00:00
def: "0"
2014-06-01 23:35:24 +00:00
},
hour: {
2014-06-05 21:12:25 +00:00
'class': 'all',
2014-06-01 23:35:24 +00:00
type: 'int',
2014-06-03 17:23:03 +00:00
desc: 'Hour in which the recording started',
negate: true,
2014-06-03 17:23:03 +00:00
def: "0"
2014-06-01 23:35:24 +00:00
},
age: {
2014-06-05 21:12:25 +00:00
'class': 'all',
2014-06-01 23:35:24 +00:00
type: 'int',
2014-06-03 17:23:03 +00:00
desc: 'Age (in hours)',
negate: true,
2014-06-03 17:23:03 +00:00
def: "0"
2014-06-01 23:35:24 +00:00
},
wage: {
2014-06-05 21:12:25 +00:00
'class': 'all',
2014-06-01 23:35:24 +00:00
type: 'int',
2014-06-03 17:23:03 +00:00
desc: 'Time since last watched, or recorded (in hours)',
negate: true,
2014-06-03 17:23:03 +00:00
def: "0"
2014-06-01 23:35:24 +00:00
},
bookmarks: {
'class': 'all',
type: 'int',
desc: 'Number of bookmarks',
negate: true,
def: "0"
},
2014-07-03 18:46:52 +00:00
now: {
'class': 'all',
type: 'int',
desc: 'Current time in 24-hour format (HHMM)',
negate: true,
def: "0"
},
2014-06-01 23:35:24 +00:00
title: {
2014-06-05 21:12:25 +00:00
'class': 'all',
2014-06-01 23:35:24 +00:00
type: 'substr',
2014-06-03 17:23:03 +00:00
desc: 'Recording Title contains',
2014-06-09 22:24:50 +00:00
idesc: 'Recording Title does not contain',
negate: true,
2014-06-03 17:23:03 +00:00
def: 'Enter text here...'
2014-06-01 23:35:24 +00:00
},
synopsis: {
2014-06-05 21:12:25 +00:00
'class': 'all',
2014-06-01 23:35:24 +00:00
type: 'substr',
2014-06-03 17:23:03 +00:00
desc: 'Synopsis contains',
2014-06-09 22:24:50 +00:00
idesc: 'Synopsis does not contain',
negate: true,
2014-06-03 17:23:03 +00:00
def: 'Enter text here...'
2014-06-01 23:35:24 +00:00
},
guidance: {
2014-06-05 21:12:25 +00:00
'class': 'all',
2014-06-01 23:35:24 +00:00
type: 'substr',
2014-06-03 17:23:03 +00:00
desc: 'Guidance Text contains',
2014-06-09 22:24:50 +00:00
idesc: 'Guidance Text does not contain',
negate: true,
2014-06-03 17:23:03 +00:00
def: 'Enter text here...'
2014-06-01 23:35:24 +00:00
},
genre: {
2014-06-05 21:12:25 +00:00
'class': 'all',
2014-06-01 23:35:24 +00:00
type: 'select',
2014-06-03 17:23:03 +00:00
desc: 'Recording Genre',
negate: true,
2014-06-01 23:35:24 +00:00
select: {
Unclassified: 'Unclassified',
Film: 'Film',
Children: 'Children',
2014-06-06 23:25:10 +00:00
'News & Factual': 'News & Factual',
2014-06-01 23:35:24 +00:00
Entertainment: 'Entertainment',
Sport: 'Sport',
Education: 'Education',
Lifestyle: 'Lifestyle',
Drama: 'Drama'
2014-06-03 17:23:03 +00:00
},
def: 'Unclassified'
2014-06-01 23:35:24 +00:00
},
definition: {
2014-06-05 21:12:25 +00:00
'class': 'all',
2014-06-01 23:35:24 +00:00
type: 'select',
2014-06-03 17:23:03 +00:00
desc: 'Recording Definition',
negate: true,
2014-06-01 23:35:24 +00:00
select: {
SD: 'Standard Definition',
HD: 'High Definition'
2014-06-03 17:23:03 +00:00
},
def: 'SD'
2014-06-01 23:35:24 +00:00
},
flag: {
2014-06-05 21:12:25 +00:00
'class': 'all',
2014-06-01 23:35:24 +00:00
type: 'select',
2014-06-03 17:23:03 +00:00
desc: 'Recording Flagged as',
2014-06-09 22:24:50 +00:00
idesc: 'Recording not Flagged as',
negate: true,
2014-06-01 23:35:24 +00:00
select: {
Locked: 'Locked',
New: 'New',
2017-05-27 09:26:16 +00:00
Encrypted: 'Protected (Enc)',
2014-06-01 23:35:24 +00:00
Guidance: 'Guidance',
2017-05-27 09:26:16 +00:00
ODEncrypted: 'Encrypted',
2014-06-01 23:35:24 +00:00
Shrunk: 'Shrunk',
2016-01-31 20:15:25 +00:00
Deduped: 'De-duplicated',
Radio: 'Radio Programme'
2014-06-03 17:23:03 +00:00
},
def: 'New'
2014-06-01 23:35:24 +00:00
},
2016-12-19 10:14:50 +00:00
queue: {
'class': 'all',
type: 'select',
desc: 'Recording Queued for',
idesc: 'Recording not Queued for',
negate: true,
select: $.extend({any: '-- Anything --'}, queueselect),
def: 'any'
},
2014-06-01 23:35:24 +00:00
lock: {
2014-06-05 21:12:25 +00:00
'class': 'all',
2014-06-01 23:35:24 +00:00
type: 'select',
2014-06-03 17:23:03 +00:00
desc: 'Change Recording Lock',
negate: true,
2014-06-01 23:35:24 +00:00
select: {
1: 'Lock Recording',
0: 'Unlock Recording'
2014-06-03 17:23:03 +00:00
},
2014-06-05 21:12:25 +00:00
def: 1,
deprecated: true
},
2014-06-09 22:24:50 +00:00
filename: {
'class': 'all',
type: 'substr',
desc: 'Filename contains',
idesc: 'Filename does not contain',
negate: true,
2014-06-09 22:24:50 +00:00
def: 'Enter text here...'
},
2014-06-05 21:12:25 +00:00
fflag: {
2014-06-19 19:11:33 +00:00
'class': 'all',
2014-06-05 21:12:25 +00:00
type: 'string',
desc: 'Folder flagged as',
2014-06-09 22:24:50 +00:00
idesc: 'Folder not flagged as',
negate: true,
2014-06-09 22:24:50 +00:00
def: 'nosweep'
},
2014-06-19 19:11:33 +00:00
foldername: {
'class': 'all',
type: 'string',
desc: 'Folder name contains',
idesc: 'Folder name does not contain',
negate: true,
def: 'Enter text here...'
},
2014-06-19 21:39:04 +00:00
lastrule: {
'class': 'all',
type: 'noarg',
desc: 'Previous Rule Matched',
idesc: "Previous Rule didn't match",
negate: true,
def: ""
},
2014-06-29 21:53:27 +00:00
series: {
'class': 'folder',
type: 'noarg',
desc: 'Folder was created by series recording',
idesc: 'Folder was not created by series recording',
negate: true,
def: ""
},
fileexists: {
'class': 'all',
type: 'string',
desc: 'File exists',
idesc: "File does not exist",
negate: true,
def: ""
},
direxists: {
'class': 'all',
type: 'string',
desc: 'Directory exists',
idesc: "Directory does not exist",
negate: true,
def: ""
},
2015-09-04 20:51:43 +00:00
textmatch: {
'class': 'all',
type: 'textmatch',
desc: 'Text comparison',
negate: true,
def: 'Enter text here...'
},
intmatch: {
'class': 'all',
type: 'intmatch',
desc: 'Numeric comparison',
negate: true,
def: "0"
},
2015-11-26 00:33:05 +00:00
varset: {
'class': 'all',
type: 'string',
desc: 'Variable is set',
idesc: 'Variable is not set',
negate: true,
def: ""
},
'or': {
'class': 'all',
type: 'composite',
label: 'Or',
desc: 'If any of...',
negate: false,
def: ''
},
'and': {
'class': 'all',
type: 'composite',
label: 'And',
desc: 'If all of...',
negate: false,
def: ''
2014-06-01 23:35:24 +00:00
}
},
action: {
2014-06-03 17:23:03 +00:00
'continue': {
'class': 'all',
2014-06-01 23:35:24 +00:00
argtype: 'none',
2014-06-04 22:18:42 +00:00
desc: 'Continue on to next rule',
2014-06-05 21:12:25 +00:00
continues: true
2014-06-01 23:35:24 +00:00
},
stop: {
2014-06-03 17:23:03 +00:00
'class': 'all',
2014-06-01 23:35:24 +00:00
argtype: 'none',
2014-06-04 22:18:42 +00:00
desc: 'Do nothing and stop processing rules',
2014-06-05 21:12:25 +00:00
continues: false
2014-06-01 23:35:24 +00:00
},
move: {
2014-06-03 17:23:03 +00:00
'class': 'all',
2014-06-01 23:35:24 +00:00
argtype: 'folder',
2014-06-04 22:18:42 +00:00
desc: 'Move recording to folder...',
2014-06-05 21:12:25 +00:00
continues: false
},
movecreate: {
2014-06-05 21:12:25 +00:00
'class': 'all',
argtype: 'folder',
desc: 'Move recording to folder (creating if necessary)',
continues: false
2014-06-05 21:12:25 +00:00
},
copy: {
2014-06-05 21:12:25 +00:00
'class': 'all',
argtype: 'folder',
desc: 'Copy recording to folder...',
continues: false
2014-06-01 23:35:24 +00:00
},
copycreate: {
2014-06-03 17:23:03 +00:00
'class': 'all',
2014-06-01 23:35:24 +00:00
argtype: 'folder',
desc: 'Copy recording to folder (creating if necessary)',
2014-06-05 21:12:25 +00:00
continues: false
2014-06-01 23:35:24 +00:00
},
fileunder: {
2014-06-03 17:23:03 +00:00
'class': 'folder',
2014-06-01 23:35:24 +00:00
argtype: 'folder',
2014-06-04 22:18:42 +00:00
desc: 'Merge into first folder of same name found under...',
2014-06-05 21:12:25 +00:00
continues: false
2014-06-01 23:35:24 +00:00
},
fileundercreate: {
2014-06-03 17:23:03 +00:00
'class': 'folder',
2014-06-01 23:35:24 +00:00
argtype: 'folder',
2014-06-03 17:23:03 +00:00
desc: 'Merge into or create folder of ' +
2014-06-04 22:18:42 +00:00
'same name found under...',
2014-06-05 21:12:25 +00:00
continues: false
2014-06-09 22:24:50 +00:00
},
renamefile: {
'class': 'all',
argtype: 'filenamebase',
2014-06-09 22:24:50 +00:00
desc: 'Rename recording files to...',
2014-06-10 22:02:48 +00:00
continues: true
},
2014-06-19 19:11:33 +00:00
settitle: {
'class': 'all',
argtype: 'string',
desc: 'Set recording title to...',
continues: true
},
setguidance: {
'class': 'all',
argtype: 'string',
desc: 'Set recording guidance to...',
continues: true
},
2020-11-01 19:11:52 +00:00
setsynopsis: {
'class': 'all',
argtype: 'string',
desc: 'Set recording synopsis to...',
continues: true
},
lock: {
'class': 'all',
argtype: 'none',
desc: 'Lock recording',
continues: true
},
unlock: {
'class': 'all',
argtype: 'none',
desc: 'Unlock recording',
continues: true
},
flag: {
'class': 'all',
2016-12-17 23:34:37 +00:00
argtype: 'select',
desc: 'Set recording flag...',
2016-12-17 23:34:37 +00:00
select: {
2017-02-13 19:35:12 +00:00
lock: 'Locked',
new: 'New',
2017-05-27 09:26:16 +00:00
protect: 'Protected (Enc)',
2017-02-13 19:35:12 +00:00
guidance: 'Guidance',
2017-05-27 09:26:16 +00:00
encrypted: 'Encrypted',
2017-02-13 19:35:12 +00:00
shrunk: 'Shrunk',
2017-05-27 09:50:40 +00:00
dedup: 'De-duplicated',
radio: 'Radio Programme'
2016-12-17 23:34:37 +00:00
},
continues: true
},
unflag: {
'class': 'all',
2016-12-17 23:34:37 +00:00
argtype: 'select',
desc: 'Unset recording flag...',
2016-12-17 23:34:37 +00:00
select: {
2017-05-27 09:50:40 +00:00
lock: 'Locked',
new: 'New',
protect: 'Protected (Enc)',
guidance: 'Guidance',
encrypted: 'Encrypted',
shrunk: 'Shrunk',
dedup: 'De-duplicated',
radio: 'Radio Programme'
2016-12-17 23:34:37 +00:00
},
continues: true
},
queue: {
'class': 'all',
2017-01-09 19:24:23 +00:00
argtype: 'selectx',
2016-12-17 23:34:37 +00:00
desc: 'Queue recording for',
2016-12-19 10:14:50 +00:00
select: queueselect,
2016-12-17 23:34:37 +00:00
continues: true
},
dequeue: {
'class': 'all',
argtype: 'select',
desc: 'De-queue recording for',
2016-12-19 10:14:50 +00:00
select: $.extend({any: '-- Everything --'}, queueselect),
continues: true
},
'delete': {
2014-06-10 22:02:48 +00:00
'class': 'all',
argtype: 'none',
desc: 'Delete recording',
2014-06-10 22:02:48 +00:00
continues: false
2015-11-25 23:01:17 +00:00
},
'log': {
'class': 'all',
argtype: 'string',
desc: 'Log...',
continues: true
},
2015-11-26 00:33:05 +00:00
'set': {
'class': 'all',
argtype: 'string',
desc: 'Set variable...',
continues: true
}
2014-06-01 23:35:24 +00:00
}
};
2016-12-19 10:14:50 +00:00
function register_queue(tag, descr)
{
2017-01-09 19:33:21 +00:00
schema.action.queue.select[tag] = descr;
schema.action.dequeue.select[tag] = descr;
schema.criterion.queue.select[tag] = descr;
2016-12-19 10:14:50 +00:00
}