terrelsa13 / MUMC

Multi-User Media Cleaner aka MUMC (pronounced Mew-Mick) will go through movies, tv episodes, audio tracks, and audiobooks in your Emby/Jellyfin libraries deleting media items you no longer want.
GNU General Public License v3.0
96 stars 6 forks source link

Not working the same after upgrade to v5 #98

Closed selfdigest closed 10 months ago

selfdigest commented 10 months ago

Hi, I've been using this for a while now, as it's the only thing that comes even close to what I need without having to do a lot extra. So wanted to thank you again first. ❤️

I've had it set up where if it deletes episodes after everyone that has the series favorited finishes it. Worked great in v4, but after upgrading to v5 today, it doesn't delete. I looked at the configs, and am not sure what is causing it. It seems to have converted everything correctly.

Config:

---
version: 5.3.12
basic_settings:
  filter_statements:
    movie:
      played:
        condition_days: 0
        count_equality: '>='
        count: 1
      created:
        condition_days: -1
        count_equality: '>='
        count: 1
        behavioral_control: true
    episode:
      played:
        condition_days: 0
        count_equality: '>='
        count: 1
      created:
        condition_days: -1
        count_equality: '>='
        count: 1
        behavioral_control: true
    audio:
      played:
        condition_days: -1
        count_equality: '>='
        count: 1
      created:
        condition_days: -1
        count_equality: '>='
        count: 1
        behavioral_control: true
    audiobook:
      played:
        condition_days: -1
        count_equality: '>='
        count: 1
      created:
        condition_days: -1
        count_equality: '>='
        count: 1
        behavioral_control: true
advanced_settings:
  filter_statements:
    movie:
      query_filter:
        favorited: true
        whitetagged: true
        blacktagged: true
        whitelisted: true
        blacklisted: true
    episode:
      query_filter:
        favorited: true
        whitetagged: true
        blacktagged: true
        whitelisted: true
        blacklisted: true
    audio:
      query_filter:
        favorited: true
        whitetagged: true
        blacktagged: true
        whitelisted: true
        blacklisted: true
    audiobook:
      query_filter:
        favorited: true
        whitetagged: true
        blacktagged: true
        whitelisted: true
        blacklisted: true
  behavioral_statements:
    movie:
      favorited:
        action: keep
        user_conditional: any
        played_conditional: ignore
        action_control: 3
        dynamic_behavior: false
        extra:
          genre: 0
          library_genre: 0
      whitetagged:
        action: keep
        user_conditional: all
        played_conditional: ignore
        action_control: 0
        dynamic_behavior: false
        tags: []
      blacktagged:
        action: delete
        user_conditional: all
        played_conditional: any
        action_control: 0
        dynamic_behavior: false
        tags: []
      whitelisted:
        action: keep
        user_conditional: any
        played_conditional: ignore
        action_control: 3
        dynamic_behavior: false
      blacklisted:
        action: delete
        user_conditional: any
        played_conditional: any
        action_control: 3
        dynamic_behavior: false
    episode:
      favorited:
        action: delete
        user_conditional: any
        played_conditional: all
        action_control: 5
        dynamic_behavior: false
        extra:
          genre: 0
          season_genre: 0
          series_genre: 0
          library_genre: 0
          studio_network: 0
          studio_network_genre: 0
      whitetagged:
        action: keep
        user_conditional: all
        played_conditional: ignore
        action_control: 0
        dynamic_behavior: false
        tags: []
      blacktagged:
        action: delete
        user_conditional: all
        played_conditional: any
        action_control: 0
        dynamic_behavior: false
        tags: []
      whitelisted:
        action: keep
        user_conditional: any
        played_conditional: ignore
        action_control: 3
        dynamic_behavior: false
      blacklisted:
        action: delete
        user_conditional: any
        played_conditional: any
        action_control: 3
        dynamic_behavior: false
    audio:
      favorited:
        action: keep
        user_conditional: any
        played_conditional: ignore
        action_control: 3
        dynamic_behavior: false
        extra:
          genre: 0
          album_genre: 0
          library_genre: 0
          track_artist: 0
          album_artist: 0
      whitetagged:
        action: keep
        user_conditional: all
        played_conditional: ignore
        action_control: 0
        dynamic_behavior: false
        tags: []
      blacktagged:
        action: delete
        user_conditional: all
        played_conditional: any
        action_control: 0
        dynamic_behavior: false
        tags: []
      whitelisted:
        action: keep
        user_conditional: any
        played_conditional: ignore
        action_control: 3
        dynamic_behavior: false
      blacklisted:
        action: delete
        user_conditional: any
        played_conditional: any
        action_control: 3
        dynamic_behavior: false
    audiobook:
      favorited:
        action: keep
        user_conditional: any
        played_conditional: ignore
        action_control: 3
        dynamic_behavior: false
        extra:
          genre: 0
          audiobook_genre: 0
          library_genre: 0
          track_author: 0
          author: 0
          library_author: 0
      whitetagged:
        action: keep
        user_conditional: all
        played_conditional: ignore
        action_control: 0
        dynamic_behavior: false
        tags: []
      blacktagged:
        action: delete
        user_conditional: all
        played_conditional: any
        action_control: 0
        dynamic_behavior: false
        tags: []
      whitelisted:
        action: keep
        user_conditional: any
        played_conditional: ignore
        action_control: 3
        dynamic_behavior: false
      blacklisted:
        action: delete
        user_conditional: any
        played_conditional: any
        action_control: 3
        dynamic_behavior: false
  whitetags: []
  blacktags: []
  episode_control:
    minimum_episodes: 0
    minimum_played_episodes: 0
    minimum_episodes_behavior: maxplayedminunplayed
  trakt_fix:
    set_missing_last_played_date:
      movie: true
      episode: true
      audio: true
      audiobook: true
  console_controls:
    headers:
      script:
        show: true
        formatting:
          font:
            color: ''
            style: ''
          background:
            color: ''
      user:
        show: true
        formatting:
          font:
            color: ''
            style: ''
          background:
            color: ''
      summary:
        show: true
        formatting:
          font:
            color: ''
            style: ''
          background:
            color: ''
    footers:
      script:
        show: true
        formatting:
          font:
            color: ''
            style: ''
          background:
            color: ''
    warnings:
      script:
        show: true
        formatting:
          font:
            color: ''
            style: ''
          background:
            color: ''
    movie:
      delete:
        show: true
        formatting:
          font:
            color: ''
            style: ''
          background:
            color: ''
      keep:
        show: true
        formatting:
          font:
            color: ''
            style: ''
          background:
            color: ''
      post_processing:
        show: true
        formatting:
          font:
            color: ''
            style: ''
          background:
            color: ''
      summary:
        show: true
        formatting:
          font:
            color: ''
            style: ''
          background:
            color: ''
    episode:
      delete:
        show: true
        formatting:
          font:
            color: ''
            style: ''
          background:
            color: ''
      keep:
        show: true
        formatting:
          font:
            color: ''
            style: ''
          background:
            color: ''
      post_processing:
        show: true
        formatting:
          font:
            color: ''
            style: ''
          background:
            color: ''
      summary:
        show: true
        formatting:
          font:
            color: ''
            style: ''
          background:
            color: ''
    audio:
      delete:
        show: true
        formatting:
          font:
            color: ''
            style: ''
          background:
            color: ''
      keep:
        show: true
        formatting:
          font:
            color: ''
            style: ''
          background:
            color: ''
      post_processing:
        show: true
        formatting:
          font:
            color: ''
            style: ''
          background:
            color: ''
      summary:
        show: true
        formatting:
          font:
            color: ''
            style: ''
          background:
            color: ''
    audiobook:
      delete:
        show: true
        formatting:
          font:
            color: ''
            style: ''
          background:
            color: ''
      keep:
        show: true
        formatting:
          font:
            color: ''
            style: ''
          background:
            color: ''
      post_processing:
        show: true
        formatting:
          font:
            color: ''
            style: ''
          background:
            color: ''
      summary:
        show: true
        formatting:
          font:
            color: ''
            style: ''
          background:
            color: ''
  UPDATE_CONFIG: false
  REMOVE_FILES: true
admin_settings:
  server:
    brand: jellyfin
    url: http://localhost:8096/emby
    auth_key: [redacted]
  behavior:
    list: blacklist
    matching: byId
  users:
  - user_id: [redacted]
    user_name: user1
    whitelist: []
    blacklist:
    - lib_id: a656b907eb3a73532e40e44b968d0225
      collection_type: tvshows
      path: /media/shows
      network_path: //192.168.x.x/media/shows
      lib_enabled: true
    - lib_id: f137a2dd21bbc1b99aa5c0f6bf02a805
      collection_type: movies
      path: /media/movies
      network_path: //192.168.x.x/media/movies
      lib_enabled: true
  - user_id: [redacted]
    user_name: user2
    whitelist: []
    blacklist:
    - lib_id: a003af669eb818e4172cbf5a34a882bb
      collection_type: movies
      path: /media/movies-rq
      network_path: //192.168.x.x/media/movies-rq
      lib_enabled: true
    - lib_id: a656b907eb3a73532e40e44b968d0225
      collection_type: tvshows
      path: /media/shows
      network_path: //192.168.x.x/media/shows
      lib_enabled: true
  api_controls:
    attempts: 4
    item_limit: 25
  cache:
    size: 32
    fallback_behavior: LRU
    minimum_age: 200
DEBUG: 0
...

Without pasting the entire output, here's one of the watched episodes for user1. Favorited by user1, not favorited by user2: :[KEEPING] - Episode - Bob's Burgers - s14.e08 - Wharf, Me Worry? - FOX - Played 4 days ago - Play Count: 1 - Created 5 days ago - Favorite: True - Whitetag: False - Blacktag: False - Whitelisted: False - Blacklisted: True - EpisodeID: dc7cb58bc9a77321098e7c5fca3afe1e

Episode favorited by both, but only watched by user2 seems to show the delete tag(but isn't deleted, because user1 hasnt watched), where user1 doesnt show any for their watched shows like above. :*[DELETE] - Episode - The X-Files - s11.e10 - My Struggle IV - FOX - Played 20 days ago - Play Count: 1 - Created 45 days ago - Favorite: False - Whitetag: False - Blacktag: False - Whitelisted: False - Blacklisted: True - EpisodeID: d6d606213dbb4bd164e1a37db52d8761

No errors, just the [NO ITEMS TO DELETE] message.

I may have just missed something stupid. So sorry if so. I've been pretty out of it for a bit. lol

terrelsa13 commented 10 months ago

Try these settings in the mumc_config.yaml.

This will query the server only for favorited media items.

advanced_settings:
  filter_statements:
    ...
    episode:
      query_filter:
        favorited: true
        whitetagged: false
        blacktagged: false
        whitelisted: false
        blacklisted: false
    ...

This will delete media items when users that specifically have the media item favorited, have all met the episode played conditions.

advanced_settings:
  behavioral_statements:
    ...
    episode:
      favorited:
        action: delete
        user_conditional: all
        played_conditional: all_played
        action_control: 5
        dynamic_behavior: true
        extra:
          genre: 0
          season_genre: 0
          series_genre: 0
          library_genre: 0
          studio_network: 0
          studio_network_genre: 0
      whitetagged:
        ...
        action_control: 0
        ...
      blacktagged:
        ...
        action_control: 0
        ...
      whitelisted:
        ...
        action_control: 0
        ...
      blacklisted:
        ...
        action_control: 0
        ...
    ...

Additional details for each configuration option can be found in the wiki under the behavioral_statements section of the configuration tree.

selfdigest commented 10 months ago

Ok, I changed it to what you suggested, but it's not getting any results.

    episode:
      query_filter:
        favorited: true
        whitetagged: false
        blacktagged: false
        whitelisted: false
        blacklisted: false
    episode:
      favorited:
        action: delete
        user_conditional: all
        played_conditional: all_played
        action_control: 5
        dynamic_behavior: true
        extra:
          genre: 0
          season_genre: 0
          series_genre: 0
          library_genre: 0
          studio_network: 0
          studio_network_genre: 0

(action_contols under that all at 0 as well)

Time Stamp Start: 20231203033221
MUMC Version: 5.3.12
MUMC Config Version: 5.3.12
Jellyfin Version: 10.8.13
Python Version: 3.11.6
OS Info: Linux-6.5.0-4-amd64-x86_64-with-glibc2.37
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
Start...
Cleaning media for server at: http://localhost:8096/emby
----------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------
Get List Of Media For:
user1 - xxxx
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
[NO PLAYED, WHITELISTED, OR TAGGED MEDIA ITEMS]

----------------------------------------------------------------------------------------
Get List Of Media For:
user2 - xxxx
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
[NO PLAYED, WHITELISTED, OR TAGGED MEDIA ITEMS]

EPISODE POST PROCESSING STARTED...

PROCESSING BLACKLISTED EPISODES...

PROCESSING WHITELISTED EPISODES...

PROCESSING BLACKTAGGED EPISODES...

PROCESSING WHITETAGGED EPISODES...

PROCESSING FAVORITED EPISODES...

EPISODE POST PROCESSING COMPLETE.

MOVIE POST PROCESSING STARTED...

PROCESSING BLACKLISTED MOVIES...

PROCESSING WHITELISTED MOVIES...

PROCESSING BLACKTAGGED MOVIES...

PROCESSING WHITETAGGED MOVIES...

PROCESSING FAVORITED MOVIES...

MOVIE POST PROCESSING COMPLETE.

----------------------------------------------------------------------------------------
Summary Of Deleted Media:
* Dry Run Mode
* advanced_settings > REMOVE_FILES: false
* No Media Deleted
* Items = 0
----------------------------------------------------------------------------------------
To delete media, open mumc_config.yaml in a text editor:
* Set advanced_settings > REMOVE_FILES: true
----------------------------------------------------------------------------------------
[NO ITEMS TO DELETE]

----------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------
Done.
terrelsa13 commented 10 months ago

My mistake. Copy/pasted but did not change the values.

Try this:

advanced_settings:
  filter_statements:
   ...
    episode:
      query_filter:
        favorited: true
        whitetagged: false
        blacktagged: false
        whitelisted: true
        blacklisted: true
   ...
selfdigest commented 10 months ago

Yep, that did the trick. Thanks again 😄

terrelsa13 commented 10 months ago

Awesome! Need help with anything else MUMC related?

selfdigest commented 10 months ago

Nope, that was all. Thanks again ❤️