-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show stream uploader icon on comments they have replied to #11991
base: refactor
Are you sure you want to change the base?
Show stream uploader icon on comments they have replied to #11991
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't the cache value be used instead, by setting the boolean to false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
|
What is it?
Description of the changes in your PR
Before/After Screenshots/Screen Record
Fixes the following issue(s)
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