Skip to content

[Bug] Mix playlists render as -1 videos #5454

@Fijxu

Description

@Fijxu

Playlists cataloged as a Mix (which are playlists generated by Youtube) have a video count of -1 video. It should display Mix instead of the quantity of videos the playlist has.

Image

Lines that need to be fixed:

video_count = thumbnail_view_model.dig("overlays").as_a
.compact_map(&.dig?("thumbnailOverlayBadgeViewModel", "thumbnailBadges").try &.as_a)
.flatten
.find(nil, &.dig?("thumbnailBadgeViewModel", "text").try { |node|
{"episodes", "videos"}.any? { |str| node.as_s.ends_with?(str) }
})
.try &.dig("thumbnailBadgeViewModel", "text").as_s.to_i(strict: false)

JSON looks like this:

"thumbnailOverlayBadgeViewModel": {
	"thumbnailBadges": [
		{
			"thumbnailBadgeViewModel": {
				"icon": {
					"sources": [
						{
							"clientResource": {
								"imageName": "MIX"
							}
						}
					]
				},
				"text": "Mix", # THIS LINE NEEDS TO BE CONSIDERED
				"badgeStyle": "THUMBNAIL_OVERLAY_BADGE_STYLE_DEFAULT"
			}
		}
	],
	"position": "THUMBNAIL_OVERLAY_BADGE_POSITION_BOTTOM_END"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions