From 5f4fb2239f5ea4add88b035a1b244f576422e3c3 Mon Sep 17 00:00:00 2001 From: 1hitsong <3330318+1hitsong@users.noreply.github.com> Date: Mon, 26 Sep 2022 21:26:17 -0400 Subject: [PATCH 1/2] Add appears on artist section --- components/IconButton.brs | 10 +-- components/ItemGrid/ItemGrid.brs | 17 ++--- components/ItemGrid/LoadItemsTask2.brs | 10 ++- components/data/MusicAlbumData.xml | 5 +- components/data/MusicSongData.xml | 6 +- components/music/AlbumGrid.brs | 16 ++++- components/music/AlbumGrid.xml | 1 + components/music/ArtistView.brs | 91 +++++++++++++++++++------ components/music/ArtistView.xml | 18 +++-- components/section/section.brs | 34 +++++++++ components/section/section.xml | 22 ++++-- components/section/sectionScroller.brs | 25 ++++++- images/icons/album.png | Bin 0 -> 5253 bytes images/icons/cassette.png | Bin 0 -> 2024 bytes source/Main.brs | 6 ++ source/ShowScenes.brs | 10 +-- source/api/Items.brs | 63 +++++++++++++---- 17 files changed, 255 insertions(+), 79 deletions(-) create mode 100644 images/icons/album.png create mode 100644 images/icons/cassette.png diff --git a/components/IconButton.brs b/components/IconButton.brs index 20176757..22113af5 100644 --- a/components/IconButton.brs +++ b/components/IconButton.brs @@ -69,17 +69,11 @@ end sub function onKeyEvent(key as string, press as boolean) as boolean if not press then return false - if key = "OK" and m.top.hasFocus() - ' Simply toggle the selected field to trigger the next event - m.top.selected = not m.top.selected - return true - end if - - if key = "right" and m.top.hasFocus() + if key = "right" and m.top.focus m.top.escape = "right" end if - if key = "left" and m.top.hasFocus() + if key = "left" and m.top.focus m.top.escape = "left" end if diff --git a/components/ItemGrid/ItemGrid.brs b/components/ItemGrid/ItemGrid.brs index a637138c..caa62b99 100644 --- a/components/ItemGrid/ItemGrid.brs +++ b/components/ItemGrid/ItemGrid.brs @@ -163,25 +163,16 @@ sub loadInitialItems() m.loadItemsTask.itemId = m.top.parentItem.Id else if getCollectionType() = "music" ' Default Settings + m.loadItemsTask.recursive = true + m.itemGrid.itemSize = "[290, 290]" - if m.voiceBox.text <> "" - m.loadItemsTask.recursive = true - else - m.loadItemsTask.recursive = false - m.itemGrid.itemSize = "[290, 290]" - end if - - m.loadItemsTask.itemType = "MusicArtist,MusicAlbum" + m.loadItemsTask.itemType = "MusicArtist" m.loadItemsTask.itemId = m.top.parentItem.Id m.view = get_user_setting("display.music.view") - if m.view = "music-artist" - m.loadItemsTask.recursive = true - m.loadItemsTask.itemType = "MusicArtist" - else if m.view = "music-album" + if m.view = "music-album" m.loadItemsTask.itemType = "MusicAlbum" - m.loadItemsTask.recursive = true end if else if m.top.parentItem.collectionType = "livetv" m.loadItemsTask.itemType = "TvChannel" diff --git a/components/ItemGrid/LoadItemsTask2.brs b/components/ItemGrid/LoadItemsTask2.brs index 75483317..7b632d29 100644 --- a/components/ItemGrid/LoadItemsTask2.brs +++ b/components/ItemGrid/LoadItemsTask2.brs @@ -77,6 +77,12 @@ sub loadItems() else if m.top.view = "Genres" url = "Genres" params.append({ UserId: get_setting("active_user") }) + else if m.top.ItemType = "MusicArtist" + url = "Artists" + params.append({ + UserId: get_setting("active_user") + }) + params.IncludeItemTypes = "" else url = Substitute("Users/{0}/Items/", get_setting("active_user")) end if @@ -110,7 +116,9 @@ sub loadItems() tmp = CreateObject("roSGNode", "FolderData") else if item.Type = "Studio" tmp = CreateObject("roSGNode", "FolderData") - else if item.Type = "MusicArtist" or item.Type = "MusicAlbum" + else if item.Type = "MusicAlbum" + tmp = CreateObject("roSGNode", "MusicAlbumData") + else if item.Type = "MusicArtist" tmp = CreateObject("roSGNode", "MusicArtistData") else if item.Type = "Audio" tmp = CreateObject("roSGNode", "MusicSongData") diff --git a/components/data/MusicAlbumData.xml b/components/data/MusicAlbumData.xml index 9d86bd36..c418dfdd 100644 --- a/components/data/MusicAlbumData.xml +++ b/components/data/MusicAlbumData.xml @@ -1,13 +1,10 @@ - + - - -