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

unclear how to use black and whitelist #32

Closed
keppo070 opened this issue Jan 26, 2022 · 3 comments
Closed

unclear how to use black and whitelist #32

keppo070 opened this issue Jan 26, 2022 · 3 comments

Comments

@keppo070
Copy link

#----------------------------------------------------------#

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

@keppo070 keppo070 changed the title unclear what to use here unclear how to use black and whitelist Jan 26, 2022
@terrelsa13
Copy link
Contributor

terrelsa13 commented Jan 27, 2022

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:

  • You want to select libraries the script should delete watched media from.

Choose whitelist during the setup when:

  • You want to select libraries the script should NOT delete watched media from.

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.

  • User00: LibraryA
  • User01: LibraryA and LibraryB
  • User02: LibraryA, LibraryB, and LibraryC
  • User03: -No Libraries 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.

  • User00: LibraryA
  • User01: LibraryA and LibraryB
  • User02: LibraryA, LibraryB, and LibraryC
  • User03: -No Libraries 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
Copy link
Author

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
Copy link
Contributor

terrelsa13 commented Jan 28, 2022

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.

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

No branches or pull requests

2 participants