Skip to content

Played And Created Filter Statement Breakdown

terrelsa13 edited this page Aug 17, 2024 · 5 revisions

Description

  • Specify the filter MUMC will use when querying the Emby/Jellyfin server for media_items played a specified time ago.
  • Specify the filter MUMC will use when querying the Emby/Jellyfin server for media_items created a specified time ago.
basic_settings:
  filter_statements:
    media_type:
      played:
        condition_days: integer
        count_equality: string
        count: integer
basic_settings:
  filter_statements:
    media_type:
      created:
        condition_days: integer
        count_equality: string
        count: integer
        behavioral_control: boolean

Notes

Definitions

condition_days can range from:

  • -1 - Disabled
  • 0 thru 730500 - Number of days

count_equality can be one of the following:

  • '>'
  • '<'
  • '>='
  • '<='
  • '=='
  • 'not <'
  • 'not >'
  • 'not <='
  • 'not >='
  • 'not =='

count can range from:

  • -1 - Disabled
  • 0 thru 730500 - Number of times played

behavioral_control is either:

  • true
  • false

Implied negative filter_statement count

Created filter_statements implying negative count: will be evaluted as count: 0 (i.e. unplayed media_items).

  • Find episodes with a played count < 0:

    • ...
    • count_equality: '<'
    • count: 0
  • Find movies with a played count <= 0:

    • ...
    • count_equality: '<='
    • count: 0
  • Find movies with a played count not > 0:

    • ...
    • count_equality: 'not >'
    • count: 0

Evaluation

if (played condition_days == -1)

  PlayedPlayCountEvaluation='disabled'

else (played condition_days >= 0)

  if ((played count_equality + played count) <= 0)
    PlayedPlayCountEvaluation = 'Query_Unplayed_Media'

  else if ((played count_equality + played count) > 0)
    PlayedPlayCountEvaluation = 'Query_Played_Media'

  else ((played count_equality + played count) <= 0) and ((played count_equality + played count) > 0)
    PlayedPlayCountEvaluation = 'Query_Both_Played_And_Unplayed_Media'
if (created condition_days == -1)

  CreatedPlayCountEvaluation='disabled'

else (created condition_days >= 0)

  if ((created count_equality + created count) <= 0)
    CreatedPlayCountEvaluation = 'Query_Unplayed_Media'

  else if ((created count_equality + created count) > 0)
    CreatedPlayCountEvaluation = 'Query_Played_Media'

  else ((created count_equality + created count) <= 0) and ((created count_equality + created count) > 0)
    CreatedPlayCountEvaluation = 'Query_Both_Played_And_Unplayed_Media'
if (PlayedPlayCountEvaluation == 'disabled') and (CreatedPlayCountEvaluation == 'disabled')
  QueryForPlayedUnplayedBothOrNone = Do_Not_Query_For_This_Media_Type

else if (PlayedPlayCountEvaluation == Query_Unplayed_Media) and (CreatedPlayCountEvaluation == Query_Unplayed_Media)
  QueryForPlayedUnplayedBothOrNone = Query_Unplayed_Media

else if (PlayedPlayCountEvaluation == Query_Played_Media) and (CreatedPlayCountEvaluation == Query_Played_Media)
  QueryForPlayedUnplayedBothOrNone = Query_Played_Media

else if (PlayedPlayCountEvaluation == Query_Unplayed_Media) and (CreatedPlayCountEvaluation == 'disabled')
  QueryForPlayedUnplayedBothOrNone = Query_Unplayed_Media

else if (PlayedPlayCountEvaluation == Query_Played_Media) and (CreatedPlayCountEvaluation == 'disabled')
  QueryForPlayedUnplayedBothOrNone = Query_Played_Media

else if (PlayedPlayCountEvaluation == 'disabled') and (CreatedPlayCountEvaluation == Query_Unplayed_Media)
  QueryForPlayedUnplayedBothOrNone = Query_Unplayed_Media

else if (PlayedPlayCountEvaluation == 'disabled') and (CreatedPlayCountEvaluation == Query_Played_Media)
  QueryForPlayedUnplayedBothOrNone = Query_Played_Media

else
  QueryForPlayedUnplayedBothOrNone = Query_Both_Played_And_Unplayed_Media

Usage

  • media_items returned from the query are evaluated to find the following:

    • true or false: Was the media_item played at least played condition_days ago?
    • true or false: Does the media_item meet the played count_equality and played count?
      • If both are true the media_item is added to the played_items_delete_list
    • true or false: Was the media_item created at least created condition_days ago?
    • true or false: Does the media_item meet the created count_equality and created count?
      • If both are true the media_item is added to the created_items_delete_list
  • During post-processing:

    • When behavioral_control: true
      • The created_items_delete_list is merged into the played_items_delete_list before behavioral_statements are evaluated.
    • When behavioral_control: false
      • The created_items_delete_list is merged into the played_items_delete_list after behavioral_statements are evaluated.

Additional Information - MUMC extras.

Clone this wiki locally