Show stream uploader icon on comments they have replied to#11991
Show stream uploader icon on comments they have replied to#11991Isira-Seneviratne wants to merge 9 commits intoTeamNewPipe:refactorfrom
Conversation
| val streamState = url | ||
| .map { | ||
| try { | ||
| Resource.Success(ExtractorHelper.getStreamInfo(serviceId, it, true).await()) | ||
| } catch (e: Exception) { | ||
| Resource.Error(e) | ||
| } | ||
| } | ||
| .flowOn(Dispatchers.IO) | ||
| .stateIn(viewModelScope, SharingStarted.WhileSubscribed(), Resource.Loading) |
There was a problem hiding this comment.
Wouldn't this result in loading twice StreamInfo when VideoDetailFragment is loaded, as loading calls for player and comments would be concurrent?
If so, then this approach must be not be used due to the time and resources used to fetch info (especially for YouTube streams).
There was a problem hiding this comment.
Couldn't the cache value be used instead, by setting the boolean to false?
There was a problem hiding this comment.
No, the solution to this is to have the VideoDetailFragment pass the channel avatar URL to the comment section (null at the beginning, then set once video info load). This is probably hard to do now, but will be easy once the VDF is also written in Compose.
There was a problem hiding this comment.
@Isira-Seneviratne for now could you make VideoDetailFragment pass a state flow to the comments fragment in some way, that allows the comments fragment to know about the currently selected uploader?
There was a problem hiding this comment.
Sure. I was planning to do some refactoring of the video detail fragment anyway.
There was a problem hiding this comment.
@Stypox I have refactored the video detail related fragments to use a common view model.
|
d5f4fc9 to
6a66bcd
Compare



What is it?
Description of the changes in your PR
TODO:
Before/After Screenshots/Screen Record
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.
Due diligence