Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

classifier multiple classifier*.yml configurations #379

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rraymondgh
Copy link
Contributor

I have been running torznab profiles with tag filters. sonarr RSS runs well, when torrents are pre-tagged and filtered by these tags. I have an hypothesis that 100 torrent limit means that sonarr does not poll all the torrents on content type filter alone. (I have not observed enough requests to torznab endpoint) Running a classifier config equivalent to:

flag_definitions:
  radarr: string_list
  sonarr: string_list
  sonarr_latest: string_list

workflows:
  tagcontent:
    - if_else:
        condition: "result.contentSource == 'tmdb' "
        if_action:
          add_tag: contentattached

  tagandkeep:
    # tag active content
    - find_match:
      - if_else:
          condition:
            and:
              - "result.contentType == contentType.tv_show"
              - "result.contentSource == 'tmdb' "
              - "result.contentId in flags.sonarr "
              - "result.episodes.filter(e, result.contentId + '_' + e in flags.sonarr_latest).size() > 0"
          if_action:
            add_tag: active
          else_action: unmatched

      - if_else:
          condition:
            and:
              - "result.contentType == contentType.tv_show"
              - "result.contentSource == 'tmdb' "
              - "result.contentId in flags.sonarr "
          if_action:
            add_tag: sonarr
          else_action: unmatched

      - if_else:
          condition:
            and:
              - "result.contentType == contentType.movie"
              - "result.contentSource == 'tmdb' "
              - "result.contentId in flags.radarr "
          if_action:
            add_tag: radarr
          else_action: unmatched

  tmdbproxy:
    - run_workflow: default
    - run_workflow: tagcontent
    - run_workflow: tagandkeep

This is far better server by keeping often changing flag lists in separate YaML files. Hence reason for this PR. Changing flag list files can be created with a scheduler, currently with a restart of bitmagnet.

I will look into fsnotify for watching used YaML files to automatically trigger a regeneration of CEL environment as a subsequent change.

A few notes on implementation

  • due to use of filepath.Glob(glob) code will not try to open a none existent file. Hence no checking for that any more
  • have mostly kept interfaces the same. There are some, hence amendments to two existing unit tests. Have focused on de-duplication of code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant