Skip to content

Use EnumSet instead of List for MediaCapabilities inside Service#1449

Merged
TobiGr merged 2 commits intodevfrom
unknown repository
Feb 21, 2026
Merged

Use EnumSet instead of List for MediaCapabilities inside Service#1449
TobiGr merged 2 commits intodevfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Jan 30, 2026

  • I carefully read the contribution guidelines and agree to them.
  • I have tested the API against NewPipe.
  • I agree to create a pull request for NewPipe as soon as possible to make it compatible with the changed API.

🔴 Breaking API change

Service.getMediaCapabilities() now returns EnumSet<MediaCapability> instead of List<MediaCapability>

@ghost
Copy link
Copy Markdown
Author

ghost commented Jan 30, 2026

Performance win is probably very low but it is good for semantic...

But List implementation is unmodifiable while EnumSet can't be and List conveys the semantic very well so this PR, well, the most useless/arguable my PR... Sorry...

Copy link
Copy Markdown
Contributor

@TobiGr TobiGr left a comment

Choose a reason for hiding this comment

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

LGTM

@TobiGr
Copy link
Copy Markdown
Contributor

TobiGr commented Jan 30, 2026

please fix the linting errors

@ghost ghost force-pushed the enumset_mediacaps branch from 3b3a27a to f825e5d Compare January 30, 2026 16:17
@ghost
Copy link
Copy Markdown
Author

ghost commented Jan 30, 2026

I thought if I directly import it in newpipe, it will run checkstyle of extractor automatically 😅

@TobiGr TobiGr added the code quality Improvements to the codebase to improve the code quality label Jan 30, 2026
@ghost
Copy link
Copy Markdown
Author

ghost commented Feb 5, 2026

@TobiGr Should I replace it with Set?

@TobiGr
Copy link
Copy Markdown
Contributor

TobiGr commented Feb 13, 2026

Yes, please use Set in the declarations and EnumSet as implementation

@TobiGr TobiGr self-assigned this Feb 13, 2026
@ghost ghost force-pushed the enumset_mediacaps branch from f825e5d to 857c181 Compare February 13, 2026 08:53
@TobiGr
Copy link
Copy Markdown
Contributor

TobiGr commented Feb 13, 2026

Sorry, i meant instantiation and not implementation.

Comment thread extractor/src/main/java/org/schabi/newpipe/extractor/StreamingService.java Outdated
Copy link
Copy Markdown
Contributor

@TobiGr TobiGr left a comment

Choose a reason for hiding this comment

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

LGTM, I misunderstood the changes.

@sonarqubecloud
Copy link
Copy Markdown

@TobiGr TobiGr merged commit 824486d into TeamNewPipe:dev Feb 21, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code quality Improvements to the codebase to improve the code quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant