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

Fixed upload subtitle language selection duplicated languages #2673

Closed
wants to merge 4 commits into from

Conversation

anderson-oki
Copy link
Collaborator

@anderson-oki anderson-oki commented Sep 18, 2024

Description

Since we use the language profile created by the user to retrieve the languages, there could be duplicated languages being added such as Forced, and HI, since Forced and HI are checkboxes on the Upload. form, we should remove any languages where the code2 are duplicated.

The issue is being fixed for both Series and Movies. Ideally in the future we should discuss again to do not allow duplicated records in the Contact profile.

Closes #2670

I'm including a fix to similar issue with unique keys in the movie table which is affecting rendering performance.


The Checkboxes that were confusing before are now single selection dropdown for Hi and Forced in both Movies or Series:

Screenshot 2024-09-19 at 10 33 45

@anderson-oki anderson-oki self-assigned this Sep 18, 2024
@anderson-oki anderson-oki changed the title fix: upload subtitle language selection duplicated languages Fixed upload subtitle language selection duplicated languages Sep 18, 2024
@anderson-oki anderson-oki marked this pull request as draft September 19, 2024 16:22
Comment on lines +82 to +95
uniqWith(
languages,
(a, b) => a.code2 === b.code2 && a.hi === b.hi && a.forced === b.forced,
),
(v) => {
const suffix = cond([
[(v: Language.Info) => v.hi || false, () => "(Hearing Impaired Only)"],
[(v) => v.forced || false, () => "(Forced Only)"],
[() => true, () => "(Normal or Hearing Impaired)"],
]);

return `${v.name} ${suffix(v)}`;
},
(v) => BuildKey(v.code2, v.hi, v.forced),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Instead we should replace it with 2 dropdowns.

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