clara-j / media_cleaner

Python script to delete watched content on Emby
31 stars 17 forks source link

unclear how to use black and whitelist #32

Closed keppo070 closed 2 years ago

keppo070 commented 2 years ago

----------------------------------------------------------

User blacklisted libraries of corresponding user account(s) to monitor media items; chosen during setup

----------------------------------------------------------

user_bl_libs='["", ""]'

----------------------------------------------------------

User whitelisted libraries of corresponding user account(s) to exclude monitoring media items; chosen during setup

----------------------------------------------------------

user_wl_libs='["", ""]'

Maybe its my comprehension of the english language. But this is in my config I have 2 libraries. I blacklist the library for a user so that the script can monitor(delete) from this library for this user I whitlist the library for a user so that the script can NOT monitor(delete) from this library for this user

So is it my understanding that if every user should be monitored for all(2) libraries I should enter them in the Blacklist? If I look at my output 1 admin sees all regardless of the above and a users sees only movies which I did not white or blacklist but is still monitored. The user sees also favorite series.

perhaps I can experiment some more with the black/whitelist

terrelsa13 commented 2 years ago

I had a hard time explaining this and English is my first language. I will try explaining it again and also give examples below.

Choose blacklist during the setup when:

Choose whitelist during the setup when:

Blacklist Example (x4 users and x3 libraries): The script knows if blacklist is chosen to delete watched media in the libraries that were selected The script knows to ignore watched media in the libraries that were not selected.

For User00 - Watched media in LibraryB and LibraryC will be ignored. Script will look for watched media in LibraryA. For User01 - Watched media in LibraryC will be ignored. Script will look for watched media in LibraryA and LibraryB. For User02 - Script will look for watched media in all Libraries. For User03 - All Libraries will be ignored. (Script will not allow this during setup.)

Whitelist Example (x4 users and x3 libraries): The script knows if whitelist is chosen to ignore watched media in the libraries that were selected. The script knows to deleted watched media in the libraries that were not selected.

For User00 - Watched media in LibraryA will be ignored. Script will look for watched media in LibraryB and LibraryC. For User01 - Watched media in LibraryA and LibraryB will be ignored. Script will look for watched media in LibraryC. For User02 - All Libraries will be ignored. (Better off not choosing this user during setup.) For User03 - Script will look for watched media in all Libraries.

Edit: For clarity; there can be any combination of users with Libraries. The above serves only as an example to help clarify how Blacklisting and Whitelisting differ during the setup process.

keppo070 commented 2 years ago

It seems that when all users have -No Libraries Selected- the script assumes whitelist alle Libraries

user_bl_libs='["", ""]' user_wl_libs='["", ""]'

Above is a valid option in the config, but it could be somewhat dangerous for you library, maybe the blacklist could be the default or maybe make it an invalid option? Maybe i'm still misinterpreting it.

A lot of maybe's :-) I think I figured it out, by changing the values and use dry-run

terrelsa13 commented 2 years ago

When the script is first run if Whitelisting is selected, then you can choose to monitor all libraries for a user by NOT selecting anything. So the User03 Whitelisting Example would apply.

When the script is first run if Blacklisting is selected, the script forces you to select at least one library for each user. Because if no libraries are selected then it would be the same as saying whitelist all libraries. So the User03 Blacklisting Example would apply.

This...

user_bl_libs='["", ""]'
user_wl_libs='["", ""]'

is just another way of saying all libraries are blacklisted for these two users. In other words - If you choose the whitelist option and then decide not to whitelist any libraries for a user, The script has to assume you are wanting to monitor all libraries for that user.

Example - If you have 100 libraries and want to monitor all of them; you will choose whitelist and not select libraries for your users. Example - If you have 100 libraries and want to monitor 98 of them; you will choose whitelist and select the two libraries you do not want to monitor.

This whole script can be considered "dangerous" if it is not setup carefully. This is why...

#----------------------------------------------------------#
#  0 - Disable the ability to delete media (dry run mode)
#  1 - Enable the ability to delete media
# (0 - default)
#----------------------------------------------------------#
remove_files=0

exists. To give everyone a chance to test the script on their setup before it deletes any media.