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
92 stars 6 forks source link

MUMC_alpha : Fully Process Single media_item For All Users; Then Move On To Next media_item #126

Closed terrelsa13 closed 1 month ago

terrelsa13 commented 1 month ago

Side Note: If I see the same behavior on my test server the only way I can think to further decrease the amount of data needing to be stored would be to fundamentally change how MUMC works.

Currently MUMC Works Like This:

  1. Fetch all media_items for the first user, using the filter_statements
  2. Fetch all media_items for the second user, using the filter_statements
    1. Repeat fetching media_items for the remaining users
    2. This is where lots of data gets stored for use in the next step
  3. Post process all media_items (aka use the behavioral_statements)
  4. Delete media_items that make it thru post processing

Fundamentally Changing How MUMC Works:

  1. Fetch a single media_item for all users, using the filter_statements
    1. Only a single media_item worth of data would ever be stored at any given time
  2. Post process this single media_item (aka use the behavioral_statements)
  3. Delete media_item if it makes it thru post processing
  4. Repeat for the next media_item

I do not want to get your hopes up.

Originally posted by @terrelsa13 in https://github.com/terrelsa13/MUMC/issues/121#issuecomment-2203428047

terrelsa13 commented 1 month ago

There is still a lot that needs to be done. But I think the main goal is working:

  1. This should process a single media_item for monitored users; then move on to the next item.
  2. The ability to delete any media_items is disabled
  3. The console output is basically untouched; it is the current console output on repeat for single media_items
    1. For now, a single media_item will appear once for each monitored user who has access to said media_item
  4. DEBUG=1 is hard-coded
  5. episode_control is temporarily not working
  6. delete_empty_folders is temporarily not working
  7. Can be found in the MUMC_alpha branch
terrelsa13 commented 1 month ago

May have found the issue with v5. There was a list being appended to itself as items were being added. This caused the list to double in size every time it appended to itself. Running tests with >20 users and >8000 media items. Last run showed ~200MB. Will run a handfull more tests to make sure. Will let you know once I have an update to v5.

For now, v6 is going to go on the back-burner until there is a reason to completely refactor how the script works.