Work around failure to fetch videos with multiple authors#911
Conversation
Since our model doesn't support those kind of videos right now, we simply extract the first author in the list.
There was a problem hiding this comment.
Pull Request Overview
This PR implements a workaround for handling YouTube videos that have multiple authors by extracting the first author when the primary author extraction method fails. The change ensures that video data can still be retrieved even when YouTube's API structure differs for multi-author videos.
Key changes:
- Added fallback logic for author ID extraction when videos have multiple authors
- Included explanatory comments about the limitation of the current data model
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| ?? AuthorDetails | ||
| ?.GetPropertyOrNull("navigationEndpoint") | ||
| ?.GetPropertyOrNull("showDialogCommand") | ||
| ?.GetPropertyOrNull("panelLoadingStrategy") | ||
| ?.GetPropertyOrNull("inlineContent") | ||
| ?.GetPropertyOrNull("dialogViewModel") | ||
| ?.GetPropertyOrNull("customContent") | ||
| ?.GetPropertyOrNull("listViewModel") | ||
| ?.GetPropertyOrNull("listItems") | ||
| ?.EnumerateArrayOrNull() | ||
| ?.FirstOrNull() | ||
| ?.GetPropertyOrNull("listItemViewModel") | ||
| ?.GetPropertyOrNull("rendererContext") | ||
| ?.GetPropertyOrNull("commandContext") | ||
| ?.GetPropertyOrNull("onTap") | ||
| ?.GetPropertyOrNull("innertubeCommand") | ||
| ?.GetPropertyOrNull("browseEndpoint") | ||
| ?.GetPropertyOrNull("browseId") |
There was a problem hiding this comment.
This deeply nested property chain is difficult to maintain and understand. Consider extracting this logic into a separate helper method with meaningful intermediate variable names to improve readability and debuggability.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #911 +/- ##
=============================
=============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.