Add support for using freeleech tokens if available

This commit is contained in:
Daniel Mason 2025-07-11 10:12:43 +12:00
parent 74f777340e
commit 3656a68a27
Signed by: idanoo
GPG key ID: 387387CDBC02F132
28 changed files with 199 additions and 39 deletions

View file

@ -2018,5 +2018,101 @@ CREATE INDEX release_hybrid_index
FROM irc_network
WHERE server = 'irc.rocket-hd.cc'
);
`, ``,
`ALTER TABLE filter RENAME TO filter_add_col;
DROP INDEX filter_enabled_index;
DROP INDEX filter_priority_index;
CREATE TABLE filter
(
id INTEGER PRIMARY KEY AUTOINCREMENT,
enabled BOOLEAN,
name TEXT NOT NULL,
min_size TEXT,
max_size TEXT,
delay INTEGER,
priority INTEGER DEFAULT 0 NOT NULL,
max_downloads INTEGER DEFAULT 0,
max_downloads_unit TEXT,
announce_types TEXT [] DEFAULT '{}',
match_releases TEXT,
except_releases TEXT,
use_regex BOOLEAN,
match_release_groups TEXT,
except_release_groups TEXT,
match_release_tags TEXT,
except_release_tags TEXT,
use_regex_release_tags BOOLEAN DEFAULT FALSE,
match_description TEXT,
except_description TEXT,
use_regex_description BOOLEAN DEFAULT FALSE,
scene BOOLEAN,
freeleech BOOLEAN,
freeleech_percent TEXT,
freeleech_token BOOLEAN DEFAULT FALSE,
smart_episode BOOLEAN DEFAULT FALSE,
shows TEXT,
seasons TEXT,
episodes TEXT,
resolutions TEXT [] DEFAULT '{}' NOT NULL,
codecs TEXT [] DEFAULT '{}' NOT NULL,
sources TEXT [] DEFAULT '{}' NOT NULL,
containers TEXT [] DEFAULT '{}' NOT NULL,
match_hdr TEXT [] DEFAULT '{}',
except_hdr TEXT [] DEFAULT '{}',
match_other TEXT [] DEFAULT '{}',
except_other TEXT [] DEFAULT '{}',
years TEXT,
months TEXT,
days TEXT,
artists TEXT,
albums TEXT,
release_types_match TEXT [] DEFAULT '{}',
release_types_ignore TEXT [] DEFAULT '{}',
formats TEXT [] DEFAULT '{}',
quality TEXT [] DEFAULT '{}',
media TEXT [] DEFAULT '{}',
log_score INTEGER,
has_log BOOLEAN,
has_cue BOOLEAN,
perfect_flac BOOLEAN,
match_categories TEXT,
except_categories TEXT,
match_uploaders TEXT,
except_uploaders TEXT,
match_record_labels TEXT,
except_record_labels TEXT,
match_language TEXT [] DEFAULT '{}',
except_language TEXT [] DEFAULT '{}',
tags TEXT,
except_tags TEXT,
tags_match_logic TEXT,
except_tags_match_logic TEXT,
origins TEXT [] DEFAULT '{}',
except_origins TEXT [] DEFAULT '{}',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
min_seeders INTEGER DEFAULT 0,
max_seeders INTEGER DEFAULT 0,
min_leechers INTEGER DEFAULT 0,
max_leechers INTEGER DEFAULT 0,
release_profile_duplicate_id INTEGER,
FOREIGN KEY (release_profile_duplicate_id) REFERENCES release_profile_duplicate(id) ON DELETE SET NULL
);
CREATE INDEX filter_enabled_index
ON filter (enabled);
CREATE INDEX filter_priority_index
ON filter (priority);
INSERT INTO filter SELECT id, enabled, name, min_size, max_size, delay, priority, max_downloads, max_downloads_unit, announce_types,
match_releases, except_releases, use_regex, match_release_groups, except_release_groups, match_release_tags, except_release_tags,
use_regex_release_tags, match_description, except_description, use_regex_description, scene, freeleech, freeleech_percent,
false,
smart_episode, shows, seasons, episodes, resolutions, codecs, sources, containers, match_hdr, except_hdr, match_other, except_other,
years, months, days, artists, albums, release_types_match, release_types_ignore, formats, quality, media, log_score, has_log, has_cue, perfect_flac, match_categories, except_categories, match_uploaders, except_uploaders, match_record_labels, except_record_labels, match_language, except_language, tags, except_tags, tags_match_logic, except_tags_match_logic, origins, except_origins, created_at, updated_at, min_seeders, max_seeders, min_leechers, max_leechers, release_profile_duplicate_id
FROM filter_add_col;
DROP TABLE filter_add_col;
`,
}