diff options
| author | syeopite <70992037+syeopite@users.noreply.github.com> | 2021-08-12 12:26:50 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-12 19:26:50 +0000 |
| commit | cea38de4ad734425ae5c23f43a01f7f9248d48be (patch) | |
| tree | 4964c90ab84561e96ddead76967c231d64cf635e /src | |
| parent | 3e4fab70700b6fad9767f008e2c80c1f0c5bf757 (diff) | |
| download | invidious-cea38de4ad734425ae5c23f43a01f7f9248d48be.tar.gz invidious-cea38de4ad734425ae5c23f43a01f7f9248d48be.tar.bz2 invidious-cea38de4ad734425ae5c23f43a01f7f9248d48be.zip | |
Check for existance of "adaptiveFormats" in videos
Combined from commits:
- Check for existance of "adaptiveFormats" in videos
- Remove usage of ternary conditional
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious/videos.cr | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index 27c54b14..851db0de 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -765,8 +765,8 @@ struct Video info["microformat"]?.try &.["playerMicroformatRenderer"]["isFamilySafe"]?.try &.as_bool || false end - def is_vr : Bool - info["streamingData"]?.try &.["adaptiveFormats"].as_a[0]?.try &.["projectionType"].as_s == "MESH" ? true : false || false + def is_vr : Bool? + info.dig?("streamingData", "adaptiveFormats", 0, "projectionType").try &.as_s == "MESH" end def wilson_score : Float64 |
