Conversation
|
what would speak against doing this directly in NewPipe instead? |
|
@Redirion I tried it, and I ran into the |
https://stackoverflow.com/questions/6343166/how-can-i-fix-android-os-networkonmainthreadexception TL;DR Btw: I'm pretty sure that this PR will cause problems regarding the comment loading performance and resources required for holding the replies in memory. |
|
@litetex We have JavaRX do to that. |
|
@TobiGr Oh my god, that is what I was missing. I'll see if I can incorporate RXJava to not have to cache the replies to comments. I am doing some reading to learn about it here: https://github.com/ReactiveX/RxJava/tree/3.x/docs |
There was a problem hiding this comment.
I don't understand why you want to do it this way.
How I imagined it to be used was:
CommentsInfo info = CommentsInfo.getInfo(...);
// Only called when the user clicks on show more
CommentsInfo replies = info.getReplies() != null ? CommentsInfo.getMoreItems(info, info.getReplies()) : null;
| try { | ||
| if (resultItem.getReplies() != null && serviceId == YouTube.getServiceId()) { | ||
| final YoutubeCommentsExtractor youtubeCommentsExtractor = | ||
| (YoutubeCommentsExtractor) YouTube.getCommentsExtractor( | ||
| resultItem.getReplies().getUrl()); | ||
|
|
||
| resultItem.setRepliesInfoList( | ||
| youtubeCommentsExtractor.getPage(extractor.getReplies()).getItems()); | ||
| } | ||
| } catch (Exception e) { | ||
| addError(e); | ||
| } | ||
|
|
There was a problem hiding this comment.
Won't this eagerly get replies for every single comment?
There was a problem hiding this comment.
This is a blocker. Replies to a comment should only be fetched on demand.
There was a problem hiding this comment.
Do you mean including during scrolling? I have changed the current behavior to download it once the user asks for replies then keep it in case of scrolling on the NewPipe Side
2f3e19c to
2fb1aa1
Compare
This was quite helpful in getting off the ground, thanks! |
|
|
||
| public void setRepliesOpen(boolean repliesOpen) { | ||
| this.repliesOpen = repliesOpen; | ||
| } | ||
|
|
||
| public boolean getRepliesOpen() {return this.repliesOpen; } |
There was a problem hiding this comment.
This should not be done in the Extractor code, since this is just a UI thing
|
Closing this for the same reason as TeamNewPipe/NewPipe#7244. |
A small change needed for the associated pull request in NewPipe (TeamNewPipe/NewPipe#7244), which stores whether or not the replies have been cached to prevent re-downloading