Skip to content

Commit

Permalink
add musicvideo support to home screen - use wide poster, show name an…
Browse files Browse the repository at this point in the history
…d year made, open using movie detail group
  • Loading branch information
cewert committed Sep 23, 2023
1 parent 853419e commit 080c8e8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 30 deletions.
31 changes: 2 additions & 29 deletions components/data/HomeData.brs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ sub setData()
m.top.iconUrl = "pkg:/images/media_type_icons/folder_white.png"
end if

else if datum.type = "Episode"
else if datum.type = "Episode" or datum.type = "MusicVideo"
m.top.isWatched = datum.UserData.Played

imgParams = {}
Expand Down Expand Up @@ -72,32 +72,7 @@ sub setData()
m.top.widePosterUrl = ImageURL(datum.Id, "Backdrop", imgParams)
end if

else if datum.type = "Movie"
m.top.isWatched = datum.UserData.Played

imgParams = {}
imgParams.Append({ "maxHeight": 261 })
imgParams.Append({ "maxWidth": 175 })

if datum.ImageTags.Primary <> invalid
param = { "Tag": datum.ImageTags.Primary }
imgParams.Append(param)
end if

m.top.posterURL = ImageURL(datum.id, "Primary", imgParams)

' For wide image, use backdrop
imgParams["maxWidth"] = 464

if datum.ImageTags <> invalid and datum.imageTags.Thumb <> invalid
imgParams["Tag"] = datum.imageTags.Thumb
m.top.thumbnailUrl = ImageURL(datum.Id, "Thumb", imgParams)
else if datum.BackdropImageTags[0] <> invalid
imgParams["Tag"] = datum.BackdropImageTags[0]
m.top.thumbnailUrl = ImageURL(datum.id, "Backdrop", imgParams)
end if

else if datum.type = "Video"
else if datum.type = "Movie" or datum.type = "Video"
m.top.isWatched = datum.UserData.Played

imgParams = {}
Expand Down Expand Up @@ -126,12 +101,10 @@ sub setData()
m.top.thumbnailURL = ImageURL(datum.id, "Primary", params)
m.top.widePosterUrl = m.top.thumbnailURL
m.top.posterUrl = m.top.thumbnailURL

else if datum.type = "TvChannel" or datum.type = "Channel"
params = { "Tag": datum.ImageTags.Primary, "maxHeight": 261, "maxWidth": 464 }
m.top.thumbnailURL = ImageURL(datum.id, "Primary", params)
m.top.widePosterUrl = m.top.thumbnailURL
m.top.iconUrl = "pkg:/images/media_type_icons/live_tv_white.png"
end if

end sub
5 changes: 4 additions & 1 deletion components/home/HomeItem.brs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ end sub
sub itemContentChanged()
itemData = m.top.itemContent
if itemData = invalid then return

print "itemData=", itemData
print "itemData.json=", itemData.json
itemData.Title = itemData.name ' Temporarily required while we move from "HomeItem" to "JFContentItem"

m.itemPoster.width = itemData.imageWidth
Expand Down Expand Up @@ -135,7 +138,7 @@ sub itemContentChanged()
return
end if

if itemData.type = "Movie"
if itemData.type = "Movie" or itemData.type = "MusicVideo"
m.itemText.text = itemData.name

if itemData.PlayedPercentage > 0
Expand Down
4 changes: 4 additions & 0 deletions source/Main.brs
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ sub Main (args as dynamic) as void
end if
else if selectedItemType = "MusicAlbum"
group = CreateAlbumView(selectedItem.json)
else if selectedItemType = "MusicVideo"
group = CreateMovieDetailsGroup(selectedItem)
else if selectedItemType = "Playlist"
group = CreatePlaylistView(selectedItem.json)
else if selectedItemType = "Audio"
Expand Down Expand Up @@ -428,6 +430,8 @@ sub Main (args as dynamic) as void
group = CreateArtistView(node.json)
else if node.type = "MusicAlbum"
group = CreateAlbumView(node.json)
else if node.type = "MusicVideo"
group = CreateMovieDetailsGroup(node)
else if node.type = "Audio"
m.global.queueManager.callFunc("clear")
m.global.queueManager.callFunc("resetShuffle")
Expand Down

0 comments on commit 080c8e8

Please sign in to comment.