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

[Feature Request] Multi User Support #148

Open
EarthBoundX5 opened this issue Aug 26, 2021 · 3 comments
Open

[Feature Request] Multi User Support #148

EarthBoundX5 opened this issue Aug 26, 2021 · 3 comments
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@EarthBoundX5
Copy link

Could support be added for running either multiple services (less ideal) or multiple trakt api keys?

In practice, this would be to support filtering of user content AND allow for multiple users to assign their username filter to their own trakt accounts within a home.

Bonus points if multiple Plex api keys could be added per trakt (if username filtering doesn't work for users added to a Plex Pass home).

This would allow multiple in house users to track their watch data. Especially useful for one's partner or children or room mates.

@iamkroot
Copy link
Owner

Hmm while this sounds useful, implementing this will require a very major overhaul of the architecture.

The easiest method is, as you mentioned, to run multiple instances of the scrobbler, each with its own trakt key and config file (plex.scrobble_user). Even this will require quite a bit of reorganization - something like the introduction of "profiles". Running multiple processes is pretty costly (for 5 profiles, RAM usage will be 5x). I don't think I'll be implementing this for now.

Although, I have been mulling over a complete rewrite of this app, such that the media player monitors generate "events" and users can enable plugins that act on those events (with one of those plugins being scrobble-to-trakt). See #112 as another example for such a plugin. (Kinda like https://github.com/erengy/anisthesia but also cross-platform) I'll have to think about how multi user support will fit into this scheme.

@iamkroot iamkroot added enhancement New feature or request wontfix This will not be worked on labels Aug 28, 2021
@panaris
Copy link

panaris commented Aug 30, 2021

Maybe you can run it in a docker container.

@iamkroot
Copy link
Owner

iamkroot commented Sep 1, 2021

@panaris, thanks to your recommendation, I realized the "profiles" part is gonna be pretty easy on Linux.

This is because we are compliant with the XDG Specification regarding user directories. So @EarthBoundX5, all you need to do to create a new "profile" is to set the XDG_DATA_HOME and XDG_CONFIG_HOME env vars before calling trakts.

There are some caveats to this, the major one being that trakts start/stop/autostart will pretty much be broken since they won't know which service to act on (currently it is hardcoded to trakt-scrobbler.service).

  • To allow autostart, you would have to manually create a systemd service (like the one from
    [Unit]
    Description=Trakt Scrobbler Service
    [Service]
    ExecStart="{self.cmd_path}" run
    [Install]
    WantedBy=default.target
    ), and add the Environment field under the [Service] section. Repeat for every new profile. The service can be named trakt-scrobbler-profile1.service and so on for easy identification.
  • Luckily, the trakts start/stop commands just call the systemctl start/stop <servicename>, so even that should be bearable (since the commands aren't used very often).

Bonus points if multiple Plex api keys could be added per trakt

Unless I'm mistaken, I believe this could also be achieved using multiple instances of the scrobbler - simply run trakts init for a new profile and log in to the desired trakt/plex combination.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants