Skip to content

Show source library items and their subtitle actions - #916

Open
LavX wants to merge 265 commits into
developmentfrom
feat/source-library-actions
Open

LavX wants to merge 265 commits into
developmentfrom
feat/source-library-actions

Conversation

@LavX

@LavX LavX commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Include source-owned series and movies in the library pages and global search. Users can select the recording, correct its identity, manage subtitles and see source history alongside their connected libraries.

File mutations recheck ownership and settings before replacing or deleting a subtitle. The checks also cover an Arr instance gaining the recording while an action is running.

LavX added 30 commits November 23, 2026 01:53
LavX added 29 commits November 23, 2026 10:19

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2a9943a6b4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +83 to +84
query = (select(audio).where(repository.Items.c.kind == kind) if kind == 'sports_event'
else wanted_list_items(kind, database, audio))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include completed source items in audio-language options

When an audio language exists only in source movies or episodes that already have all subtitles, it is omitted from the library's audio-language filter. wanted_list_items() requires nonempty missing_subtitles, an effective profile, and automatic-search eligibility, whereas the new Movies and Series library pages also display completed and untracked source items and populate their filter options from this endpoint. Query source audio languages independently of Wanted eligibility so those library items remain filterable.

Useful? React with 👍 / 👎.

Comment on lines +407 to +409
any: () => {
invalidateSourceWanted();
invalidateSourceLibrary();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Refresh Sports activity after source subtitle tools finish

When a sports source subtitle is translated through SourceSubtitleMenu, completion emits source-item/source-group, but these handlers invalidate only Series/Movies activity and source details—not the queries under QueryKeys.Sports. The completion refresh in refreshSourceSubtitleOwner() also omits Sports, and this translation path does not emit the separate source-sports event used by provider downloads. Consequently, returning to a recently cached Sports Wanted or History page can still show the translated language as missing or omit its history entry even though the badge has updated. Invalidate the source-inclusive Sports activity queries on these mutations as well.

Useful? React with 👍 / 👎.

Comment on lines +711 to +713
candidates = [_mapped_sql_path(path, [rule], reverse=True) for rule in mapper.rules]
alternatives = (model.path == candidate for candidate in candidates)
claim = sa.and_(sa.or_(claim, *alternatives), _mapped_sql_path(model.path, mapper.rules) == path)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Match Arr claims without requiring reversible path mappings

When the local mapping prefix also occurs in the original path's suffix, this reverse-mapping prefilter rejects a valid Arr owner. For example, mapping /downloads to /media maps /downloads/media/Film.mkv to /media/media/Film.mkv, but reversing the latter produces /downloads/downloads/Film.mkv because _mapped_sql_path() uses replace-all semantics. Neither alternative then matches the stored Arr path, despite its forward mapping matching exactly. Until the source's stored shadow is refreshed after an Arr import or mapping change, wanted_list_items() and wanted_language_count() therefore include the Arr-owned recording and double-count its missing subtitles. Use the forward-mapped equality without a reverse prefilter that assumes the mapping is invertible.

Useful? React with 👍 / 👎.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant