Skip to content

Search templates can store UI title with (year), leaking into provider search queries #12235

Description

@Mika3578

Summary

When Append (year) to each show title (add_title_with_year) is enabled, Medusa documents that the year-suffixed title is only for show folder creation / UI representation.

In practice, a custom search template can end up with its title field set to the UI title including (year). That value is then used as %SN when building provider search strings, so the year does appear in Torznab/provider queries.

Expected

  • add_title_with_year affects UI / folder naming only (as documented).
  • Search template titles / %SN use the canonical show name (without year), unless the user explicitly wants %Y in a custom template pattern.

Actual

Example show with show_name = Example Show and startyear = 2021:

Field Value
DB tv_shows.show_name Example Show (no year)
Custom search_templates.title Example Show (2021)
Custom search_templates.template %SN %EN (enabled)

Provider request becomes:

q=Example Show (2021) <episode name>

instead of:

q=Example Show <episode name>

Impact

  • Extra punctuation/(year) in queries can break indexers that treat the query as an expression (observed with an aMule/Torznab bridge: aMule logs syntax error / Undefined search expression error).
  • Confusing because the setting help text says year is UI-only.

Likely cause

Template create/edit path taking show.title (year-appended) instead of show.name (canonical). Related attempt (closed, not merged): #12161

Suggested fix

  1. Always persist search template title as canonical series.name (normalize UI title → strip (YYYY) when it matches start_year).
  2. Optionally migrate existing search_templates rows that only differ by a trailing (year).
  3. Keep year available only via explicit template tokens such as %Y / %EY when users want it in the pattern, not baked into the template title.

Related

Environment

  • Medusa develop image (pymedusa/medusa:develop)
  • add_title_with_year = 1
  • Provider search mode eponly (uses %SN %EN-style templates)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions