Sha256: 1e0aba51bd28ac6c6cdb6a24e13efd88b16c9229d655761183cfd953c42adaf9

Contents?: true

Size: 615 Bytes

Versions: 1

Compression:

Stored size: 615 Bytes

Contents

require 'yt/video_audit/base'

module Yt
  module VideoAudit
    # Count how many subject videos have an end screens
    # with a playlist link.
    class PlaylistEndScreen < Base
      def title
        'Playlist End Screens'
      end

      def description
        'The number of videos with any link to a playlist in its end screens'
      end

    private

      def valid?(video)
        Yt::Annotations.for(video.id).any? do |annotation|
          annotation.instance_of?(Yt::Annotations::EndScreen) &&
          annotation.link && annotation.link[:type] == :playlist
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yt-audit-0.5.2 lib/yt/video_audit/playlist_end_screen.rb