outofgum / dukeftp

Duke FTP
1 stars 3 forks source link

Create a syntax for trading rules #34

Open outofgum opened 9 years ago

outofgum commented 9 years ago

section;path;rule key=value;rule key=value

for example:

mp3;/mp3/$month$day;year>=2014;flag internal=true;flag abook=true

motharussia commented 8 years ago

Rulesystem

Various ways of support rules:

  1. Via templates
  2. Via site specific rules

MP3 examples

1. Rules via templates

there's an option to use tempates. define template by [template.section.template_name]

Example template

# Name the template:
[template.mp3.template_name_mp3]

# Set general settings for named template:
[template.mp3.template_name_mp3]
    internal = ["no"]
    year = ["$year"]
    language = ["en"]
    maxdisc = ["5"]
    blacklist_group = ["Group1,Group2,Group3"] # these groups will never be traded for this section
    whitelist_group = ["Group1,Group2,Group3"] # these groups will always be traded before any rule is checked

# set flags for template
[template.mp3.template_name_mp3.flags]
    abook = ["yes"]
    live allowed = ["yes"]
    retail only = ["yes"]

# set tags for template
[template.mp3.template_name_mp3.tags] 
    cpop = ["no"]
    jpop = ["no"]
    kpop = ["no"]
    digipak = ["yes"]
    mag = ["yes"]
    promo = ["yes"]
    reissue = ["yes"]
    remastered = ["yes"]
    remix = ["yes"]
    sampler = ["yes"]
    ost = ["yes"]

Using a template

# enable template in general rules for siteName
[site.siteName.mp3.general]
    path = ["/today-mp3/"]
    use_template = ["yes"] # activate the usage of section specific template
    use_template_name = ["template_name_mp3"] # set template to use

2. Site specific rules

# Set general options for siteName
[site.siteName.general]
    internal = ["yes/no"]
    blacklist_group = ["Group1,Group2,Group3"] # these groups will never be traded for this section
    whitelist_group = ["Group1,Group2,Group3"] # these groups will always be traded before any rule is checked

# Set section specific rules for siteName
[site.siteName.mp3]
    path = ["/today-mp3/"]
    use_template = ["no"]
    year = ####
    language = language_audio.ini
    maxdisc = # 
    internal = ["yes/no"]
    blacklist_group = ["Group4"] # blacklist on section level will compliment 'general' blacklist (so Group4 will be skipped only for mp3, but Group1,2,3 too because of general blacklist)
    whitelist_group = ["Group5"] # whitelist on section level will compliment 'general' whitelist (so Group4 will be whitelisted only for mp3, but group1,2,3 too because of general whitelist)

[site.siteName.mp3.flags]
    abook = ["yes/no"]
    live allowed = ["yes/no"]
    retail only = ["yes/no"]

[site.siteName.mp3.tags]
    cpop = ["yes/no"]
    jpop = ["yes/no"]
    kpop = ["yes/no"]
    digipak = ["yes/no"]
    mag = ["yes/no"]
    promo = ["yes/no"]
    reissue = ["yes/no"]
    remastered = ["yes/no"]
    remix = ["yes/no"]
    sampler = ["yes/no"]
    ost = ["yes/no"]

Movie example

[template.x264-1080.template_name_x264-1080]
[template.x264-1080.template_name_x264-1080.general]
    language = language_general.ini 
    country = language_general.ini 
    skip_genre = ["genres,to,be,skipped"]
    dubbed = ["yes/no"]
    subbed = ["yes/no"]
    imdb_min_year = ####
    imdb_stv = ["yes/no"]
    imdb_limited = ["yes/no"]
    imdb_festival = ["yes/no"]
    imdb_docu = ["yes/no"]
    imdb_min_votes = #
    imdb_min_rating = ["#.#"]
    blacklist_group = ["Group1,Group2,Group3"] # these groups will never be traded for this section
    whitelist_group = ["Group1,Group2,Group3"] # these groups will always be traded before any rule is checked

[template.x264-1080.template_name_x264-1080.tags]
    bonus = ["yes/no"]
    complete = ["yes/no"]
    criterion = ["yes/no"]
    custom = ["yes/no"]
    cut = ["yes/no"] # allow director/editor/whatever cut?
    deluxe = ["yes/no"]
    edition = ["yes/no"]
    extended = ["yes/no"]
    extras = ["yes/no"]
    remastered = ["yes/no"]
    restored = ["yes/no"]
    sync = ["yes/no"]
    uncut = ["yes/no"]
    unrated = ["yes/no"]

[template.x264-1080.template_name_x264-1080.flags]
    3d = ["yes/no"]
    dts = ["yes/no"]
    dual = ["yes/no"]
    fs = ["yes/no"]
    hr = ["yes/no"]
    ld = ["yes/no"]
    md  = ["yes/no"]
    multisubs = ["yes/no"]
    sample = ["yes/no"]
    samplefix = ["yes/no"]
    subfix = ["yes/no"]
    syncfix = ["yes/no"]
    subs = ["yes/no"]
    ws = ["yes/no"]

TV example

[template.tv-720.template_name_tv-720.general]
    internal = ["yes/no"]
    language = language_general.ini
    country = language_general.ini
    classification = ["Allowed,Classifications,Here"]
    genre = ["Allowed,Genres,Here"]
    status = ["Allowed,Status,Here"]
    min_premiere_year = ####
    skip_network = ["Networks,To,Be,Skipped"]
    sports = ["yes/no"]
    webrip = ["yes/no"]
    blacklist_group = ["Group1,Group2,Group3"] # these groups will never be traded for this section
    whitelist_group = ["Group1,Group2,Group3"] # these groups will always be traded before any rule is checked

Games example

[template.games.template_name_games]
    multi = ["yes/no"]
    linux = ["yes/no"]
    mac = ["yes/no"]
    dlc = ["yes/no"]
    dox = ["yes/no"]
    clone = ["yes/no"]

Sites with multiple paths for subsections

# site 'siteName' has seperate folders for windows games, linux games, windows dox and linux dox. dlc are sent to dox.
[site.siteName.general]
[site.siteName.games.sub1]
    path = ["/games/"]
    multi = ["yes"]
    windows = ["yes"]
    linux = ["no"]
    mac = ["no"]
    dlc = ["no"]
    dox = ["no"]
    clone = ["no"]
[site.siteName.games.sub2]
    path = ["/games-linux/"]
    multi = ["yes"]
    windows = ["no"]
    linux = ["yes"]
    mac = ["no"]
    dlc = ["no"]
    dox = ["no"]
    clone = ["no"]
[site.siteName.games.sub3]
    path = ["/dox/"]
    multi = ["yes"]
    windows = ["yes"]
    linux = ["no"]
    mac = ["no"]
    dlc = ["yes"]
    dox = ["yes"]
    clone = ["no"]
[site.siteName.games.sub4]
    path = ["/dox-linux/"]
    multi = ["yes"]
    windows = ["no"]
    linux = ["yes"]
    mac = ["no"]
    dlc = ["yes"]
    dox = ["yes"]
    clone = ["no"]