You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
os.getenv(A, B) looks for env variable A and returns B as a default if it doesn't exist. However variable B is always returned as a string, regardless of what the function was called with.
For DELETE_DEVICE_IF_NO_MEDIA_CONTROLS, B is set to the bool False, which gets converted to the string "False". This will always True for bool("False") since the string is not empty. This is a very annoying oversight from the python developers. A better check is:
I've created a PR that includes this change. This PR also includes a new env variable that allows time to be accrued by DeviceId rather than UserId. So the same user with multiple devices is treated differently.
os.getenv(A, B) looks for env variable A and returns B as a default if it doesn't exist. However variable B is always returned as a string, regardless of what the function was called with.
For DELETE_DEVICE_IF_NO_MEDIA_CONTROLS, B is set to the bool False, which gets converted to the string "False". This will always True for bool("False") since the string is not empty. This is a very annoying oversight from the python developers. A better check is:
DELETE_DEVICE_IF_NO_MEDIA_CONTROLS = os.getenv("DELETE_DEVICE_IF_NO_MEDIA_CONTROLS", "True").lower() == "true"
I've created a PR that includes this change. This PR also includes a new env variable that allows time to be accrued by DeviceId rather than UserId. So the same user with multiple devices is treated differently.
PR: #27
The text was updated successfully, but these errors were encountered: