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

Jellyfin source not respecting usersAllowed setting #196

Closed
TheFeelTrain opened this issue Sep 30, 2024 · 4 comments
Closed

Jellyfin source not respecting usersAllowed setting #196

TheFeelTrain opened this issue Sep 30, 2024 · 4 comments

Comments

@TheFeelTrain
Copy link

Logs

[2024-09-29 23:04:22.706 -0700] DEBUG  : [App] [Sources] [Jellyfin - TheJellyTrain] Player State for  -> Astrophysics - Soft Goth <-- is being dropped because 'usersAllow does not include user Eriq
[2024-09-29 23:04:22.681 -0700] DEBUG  : [App] [Sources] [Jellyfin - TheJellyTrain] Refreshing recently played
[2024-09-29 23:04:12.671 -0700] DEBUG  : [App] [Sources] [Jellyfin - TheJellyTrain] Last activity was at 2024-09-29T23:03:42-07:00 | Next check interval: 10.00s
[2024-09-29 23:04:12.670 -0700] DEBUG  : [App] [Sources] [Jellyfin - TheJellyTrain] No new tracks discovered
[2024-09-29 23:04:12.670 -0700] DEBUG  : [App] [Sources] [Jellyfin - TheJellyTrain] Player State for  -> Astrophysics - Soft Goth <-- is being dropped because 'usersAllow does not include user Eriq
[2024-09-29 23:04:12.643 -0700] DEBUG  : [App] [Sources] [Jellyfin - TheJellyTrain] Refreshing recently played
[2024-09-29 23:04:02.630 -0700] DEBUG  : [App] [Sources] [Jellyfin - TheJellyTrain] Last activity was at 2024-09-29T23:03:42-07:00 | Next check interval: 10.00s
[2024-09-29 23:04:02.629 -0700] DEBUG  : [App] [Sources] [Jellyfin - TheJellyTrain] No new tracks discovered
[2024-09-29 23:04:02.628 -0700] DEBUG  : [App] [Sources] [Jellyfin - TheJellyTrain] Player State for  -> Astrophysics - Soft Goth <-- is being dropped because 'usersAllow does not include user Eriq
[2024-09-29 23:04:02.598 -0700] DEBUG  : [App] [Sources] [Jellyfin - TheJellyTrain] Refreshing recently played
[2024-09-29 23:03:52.583 -0700] DEBUG  : [App] [Sources] [Jellyfin - TheJellyTrain] Last activity was at 2024-09-29T23:03:42-07:00 | Next check interval: 10.00s
[2024-09-29 23:03:52.582 -0700] DEBUG  : [App] [Sources] [Jellyfin - TheJellyTrain] No new tracks discovered
[2024-09-29 23:03:52.582 -0700] DEBUG  : [App] [Sources] [Jellyfin - TheJellyTrain] Player State for  -> Astrophysics - Soft Goth <-- is being dropped because 'usersAllow does not include user Eriq
[2024-09-29 23:03:52.546 -0700] DEBUG  : [App] [Sources] [Jellyfin - TheJellyTrain] Refreshing recently played
[2024-09-29 23:03:42.534 -0700] DEBUG  : [App] [Sources] [Jellyfin - TheJellyTrain] Last activity was at 2024-09-29T23:03:42-07:00 | Next check interval: 10.00s
[2024-09-29 23:03:42.525 -0700] DEBUG  : [App] [Sources] [Jellyfin - TheJellyTrain] No new tracks discovered
[2024-09-29 23:03:42.524 -0700] DEBUG  : [App] [Sources] [Jellyfin - TheJellyTrain] Player State for  -> Astrophysics - Soft Goth <-- is being dropped because 'usersAllow does not include user Eriq
[2024-09-29 23:03:42.508 -0700] DEBUG  : [App] [Sources] [Jellyfin - TheJellyTrain] Refreshing recently played

Versions:

  • multi-scrobbler: 0.8.4 docker
  • Jellyfin 10.9.11

Additional context

[{
    "name": "TheJellyTrain",
    "enable": true,
    "clients": [],
    "data": {
        "url": "http://192.168.0.20:8096",
        "user": "Eriq",
        "apiKey": "redacted",
        "usersAllowed": ["Eriq"]
    },
    "options": {
        "logFilterFailure": "debug"
    }
}]

Same result with env variables and/or if the option is omitted even though it's supposed to be optional.

@TheFeelTrain
Copy link
Author

Took me a minute but I figured out.

The code uses usersAllow instead of usersAllowed like in the example and it also has to be lowercase because of this line:

if(this.usersAllow.length > 0 && !this.usersAllow.includes(user.toLocaleLowerCase())) {

So this config works while the one in the original post doesn't:

[{
    "name": "TheJellyTrain",
    "enable": true,
    "clients": [],
    "data": {
        "url": "http://192.168.0.20:8096",
        "user": "Eriq",
        "apiKey": "redacted",
        "usersAllow": ["eriq"]
    },
    "options": {
        "logFilterFailure": "debug"
    }
}]

The this.usersAllow.length > 0 is also broken because it's returning true even when the variable isn't set in the config file. I'm not gonna dig for it but I assume it's getting set to something somewhere along the way where it shouldn't be.

@FoxxMD FoxxMD closed this as completed in 1eada12 Sep 30, 2024
@FoxxMD
Copy link
Owner

FoxxMD commented Sep 30, 2024

Thanks for catching this. It has been fixed in 0.8.5 so that the documentation matches the code by using usersAllow and other options everywhere.

The this.usersAllow.length > 0 is also broken because it's returning true even when the variable isn't set in the config file.

This is expected. If no config is set for usersAllow then it adds the authenticated user to the list as a convenience.

image

This behavior is now covered by a test as well.

@TheFeelTrain
Copy link
Author

Thank you for the fast fix!

This is expected. If no config is set for usersAllow then it adds the authenticated user to the list as a convenience.

Oh I see now. That's my bad, I only skimmed the code so I was missing the context for what that check was actually for 😅

I assumed it was checking if the config was set not a check to make sure the variable itself is set properly.

@FoxxMD
Copy link
Owner

FoxxMD commented Oct 16, 2024

These fixes are in 0.8.6 (latest docker image)

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