-
-
Notifications
You must be signed in to change notification settings - Fork 509
Open
Labels
codequalityImprovements to the codebase to improve the code qualityImprovements to the codebase to improve the code qualityhelp wantedHelp is wanted in fixing this issueHelp is wanted in fixing this issuemultiserviceIssues related to multiple servicesIssues related to multiple services
Description
The interface of link handlers and link handler factories is strange, hard to debug, and it's doing something extremely simple (checking if a URL matches and extracting stuff from it) in a highly overcomplicated way. It could be refactored like this in my opinion:
- have a base interface
Link(the shorter the name the better, current names are huge) - The interface has only a few extractor related methods, e.g.
getExtractor()returns the extractor corresponding to the link. - The interface also has a few app-facing public methods that are meant to be used only by the app (and not by other parts of the extractor). For example, a
getUniqueId()method that returns a stable and unique ID for each resource, so it can be used as a primary key in NewPipe's database. - Each extractor has a corresponding
Linkimplementation. EveryLink's constructor takes a URL and builds an instance ofLink, but throws an exception if the URL does not match the expected link format. - Each
Linkimplementor may also have other constructors, e.g.YoutubeSearchLinkwould have a constructor that takes the query and any search filters.
absurdlylongusernamegoyalyashpal
Metadata
Metadata
Assignees
Labels
codequalityImprovements to the codebase to improve the code qualityImprovements to the codebase to improve the code qualityhelp wantedHelp is wanted in fixing this issueHelp is wanted in fixing this issuemultiserviceIssues related to multiple servicesIssues related to multiple services