NewPipeExtractor icon indicating copy to clipboard operation
NewPipeExtractor copied to clipboard

Allow clients to determine whether data is intentionally unavailable

Open fynngodau opened this issue 4 years ago • 1 comments

For instance, bandcamp users will always see upvote icon, downvote icon, "Disabled" when viewing streams and image when viewing comments. The same applies to the "subscriber count", which is by design not provided by Bandcamp.

The reason is that the client (the NewPipe app) cannot differentiate between data that has failed to extract and data that is generally not available for the service.

There's an infinite amount of possible solutions to this:

  • return -1 if extraction fails, -2 if not available by design
  • return null if extraction fails, -1 if intentional
  • return -1 if extraction fails, null if intentional
  • return Optional.of(-1) if extraction fails, return an empty Optional if intentional
  • add extra method call that determines which fields are filled by the provider (similar to MediaCapabiliy)

If data is not available intentionally, NewPipe should hide the affected views. This makes the services that don't provide the corresponding data fields look less broken in the app.

Please comment what you think would be the best solution to this.

fynngodau avatar May 06 '21 07:05 fynngodau

Let's create two constants and return them:

  • COUNT_UNAVAILABLE = -1
  • COUNT_EXTRACTION_FAILED = -2

Stypox avatar Jun 06 '21 07:06 Stypox