diff --git a/.gitignore b/.gitignore index 7681afc0..024d41c0 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,5 @@ doc/ .yardoc/ _site/ TODO.md + +spec/cassettes/ diff --git a/lib/yt/collections/reports.rb b/lib/yt/collections/reports.rb index bb0bd720..7be86ba5 100644 --- a/lib/yt/collections/reports.rb +++ b/lib/yt/collections/reports.rb @@ -47,7 +47,13 @@ class Reports < Base playlist_page: 'YT_PLAYLIST_PAGE', campaign_card: 'CAMPAIGN_CARD', end_screen: 'END_SCREEN', - info_card: 'INFO_CARD' + info_card: 'INFO_CARD', + hashtags: 'HASHTAGS', + live_redirect: 'LIVE_REDIRECT', + product_page: 'PRODUCT_PAGE', + shorts: 'SHORTS', + sound_page: 'SOUND_PAGE', + video_remixes: 'VIDEO_REMIXES' } # @see https://developers.google.com/youtube/analytics/dimensions#Playback_Location_Dimensions diff --git a/lib/yt/models/channel.rb b/lib/yt/models/channel.rb index af7591a2..a32acad2 100644 --- a/lib/yt/models/channel.rb +++ b/lib/yt/models/channel.rb @@ -133,6 +133,9 @@ def unsubscribe! # @macro report_by_channel_dimensions has_report :views, Integer + # @macro report_by_channel_dimensions + has_report :engaged_views, Integer + # @macro report_by_channel_dimensions has_report :estimated_minutes_watched, Integer diff --git a/lib/yt/models/video.rb b/lib/yt/models/video.rb index eff3d7be..630ef9d2 100644 --- a/lib/yt/models/video.rb +++ b/lib/yt/models/video.rb @@ -421,6 +421,9 @@ def claim # @macro report_by_video_dimensions has_report :views, Integer + # @macro report_by_video_dimensions + has_report :engaged_views, Integer + # @macro report_by_video_dimensions has_report :estimated_minutes_watched, Integer diff --git a/spec/requests/as_account/channel_spec.rb b/spec/requests/as_account/channel_spec.rb index e93fcbfd..ca580fa2 100644 --- a/spec/requests/as_account/channel_spec.rb +++ b/spec/requests/as_account/channel_spec.rb @@ -196,6 +196,7 @@ # Some reports are only available to Content Owners. # See content owner test for more details about what the methods return. expect{channel.views}.not_to raise_error + expect{channel.engaged_views}.not_to raise_error expect{channel.comments}.not_to raise_error expect{channel.likes}.not_to raise_error expect{channel.dislikes}.not_to raise_error diff --git a/spec/requests/as_account/video_spec.rb b/spec/requests/as_account/video_spec.rb index 4bc80ce9..6bbe3450 100644 --- a/spec/requests/as_account/video_spec.rb +++ b/spec/requests/as_account/video_spec.rb @@ -292,5 +292,10 @@ expect(video.file_type).to be_nil expect(video.container).to be_nil end + + it 'returns valid reports for video-related metrics' do + expect{video.views}.not_to raise_error + expect{video.engaged_views}.not_to raise_error + end end end