Skip to content

feat: Add a enviroment variable to exclude libraries #14

@dotneB

Description

@dotneB

Feature Request

Describe the Feature Request

Add an environment variable to prevent scrobbling from these libraries. This can be achieved as a condition to tautilli notification agent, but can't be done if using a plex webhook.

Describe Preferred Solution

Something like PLEX_EXCLUDED_LIBRARIES=Library1,Library23

Describe Alternatives

Related Code

const library = payload?.Metadata?.librarySectionTitle;

// Check excluded libraries
if (process.env.PLEX_EXCLUDED_LIBRARIES && library) {
  const excludedLibraries = process.env.PLEX_EXCLUDED_LIBRARIES
    .split(',')
    .map(l => l.trim().toLowerCase())
    .filter(Boolean); // remove empty entries just in case

  if (excludedLibraries.includes(library.trim().toLowerCase())) {
    logger.error(`❌ ${chalk.red(`Library "${library}" is in the excluded list: ${process.env.PLEX_EXCLUDED_LIBRARIES}`)}`);
    return res.status(403).json({ error: 'Library not allowed' });
  }
}

Additional Context

If the feature request is approved, would you be willing to submit a PR?
(Help can be provided if you need assistance submitting a PR)

  • Yes
  • No

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions