From bb2c6ba42d37ab99c3139f2a16ecfe012d7d1890 Mon Sep 17 00:00:00 2001 From: 1hitsong <3330318+1hitsong@users.noreply.github.com> Date: Mon, 6 Jun 2022 20:31:57 -0400 Subject: [PATCH 01/13] Create Artist & Album view for music --- components/ItemGrid/ItemGrid.brs | 44 +++++++++++++++++++++++--- components/music/MusicAlbumDetails.brs | 14 -------- 2 files changed, 40 insertions(+), 18 deletions(-) diff --git a/components/ItemGrid/ItemGrid.brs b/components/ItemGrid/ItemGrid.brs index a2592154..45dd578a 100644 --- a/components/ItemGrid/ItemGrid.brs +++ b/components/ItemGrid/ItemGrid.brs @@ -69,6 +69,11 @@ sub loadInitialItems() m.sortField = get_user_setting("display.livetv.sortField") sortAscendingStr = get_user_setting("display.livetv.sortAscending") m.filter = get_user_setting("display.livetv.filter") + else if m.top.parentItem.collectionType = "music" + m.view = get_user_setting("display.music.view") + m.sortField = get_user_setting("display." + m.top.parentItem.Id + ".sortField") + sortAscendingStr = get_user_setting("display." + m.top.parentItem.Id + ".sortAscending") + m.filter = get_user_setting("display." + m.top.parentItem.Id + ".filter") else m.view = invalid m.sortField = get_user_setting("display." + m.top.parentItem.Id + ".sortField") @@ -101,9 +106,20 @@ sub loadInitialItems() else if m.top.parentItem.collectionType = "tvshows" m.loadItemsTask.itemType = "Series" else if m.top.parentItem.collectionType = "music" - m.loadItemsTask.itemType = "MusicArtist,MusicAlbum" - m.loadItemsTask.fallbackType = "MusicAlbum" + ' Default Settings m.loadItemsTask.recursive = false + m.loadItemsTask.itemType = "MusicArtist,MusicAlbum" + + 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" + m.loadItemsTask.itemType = "MusicAlbum" + m.loadItemsTask.recursive = true + end if + else if m.top.parentItem.collectionType = "livetv" m.loadItemsTask.itemType = "LiveTV" @@ -214,7 +230,11 @@ sub SetUpOptions() options.filter = [] 'Music else if m.top.parentItem.collectionType = "music" - options.views = [{ "Title": tr("Music"), "Name": "music" }] + options.views = [ + { "Title": tr("Default"), "Name": "music-default" }, + { "Title": tr("Artists"), "Name": "music-artist" }, + { "Title": tr("Albums"), "Name": "music-album" }, + ] options.sort = [ { "Title": tr("TITLE"), "Name": "SortName" }, { "Title": tr("DATE_ADDED"), "Name": "DateCreated" }, @@ -414,7 +434,6 @@ sub optionsClosed() m.top.removeChild(m.tvGuide) end if end if - end if if m.top.parentItem.Type = "CollectionFolder" or m.top.parentItem.CollectionType = "CollectionFolder" @@ -429,6 +448,23 @@ sub optionsClosed() end if reload = false + + if m.top.parentItem.collectionType = "music" + if m.options.view <> m.view + if m.options.view = "music-artist" + m.view = "music-artist" + set_user_setting("display.music.view", m.view) + else if m.options.view = "music-album" + m.view = "music-album" + set_user_setting("display.music.view", m.view) + else + m.view = "music-default" + end if + set_user_setting("display.music.view", m.view) + reload = true + end if + end if + if m.options.sortField <> m.sortField or m.options.sortAscending <> m.sortAscending m.sortField = m.options.sortField m.sortAscending = m.options.sortAscending diff --git a/components/music/MusicAlbumDetails.brs b/components/music/MusicAlbumDetails.brs index 33c53d63..dca18ba8 100644 --- a/components/music/MusicAlbumDetails.brs +++ b/components/music/MusicAlbumDetails.brs @@ -12,7 +12,6 @@ sub init() m.spinner.visible = true m.dscr = m.top.findNode("overview") - m.dscr.observeField("isTextEllipsized", "onEllipsisChanged") createDialogPallete() end sub @@ -123,19 +122,6 @@ function onKeyEvent(key as string, press as boolean) as boolean return false end function -sub onEllipsisChanged() - if m.dscr.isTextEllipsized - dscrShowFocus() - end if -end sub - -sub dscrShowFocus() - if m.dscr.isTextEllipsized - m.dscr.setFocus(true) - m.dscr.opacity = 1.0 - end if -end sub - sub createFullDscrDlg() dlg = CreateObject("roSGNode", "OverviewDialog") dlg.Title = tr("Press 'Back' to Close") From 45cc71020026ce29730f9ad5073f0e6e1a8288a9 Mon Sep 17 00:00:00 2001 From: 1hitsong <3330318+1hitsong@users.noreply.github.com> Date: Mon, 6 Jun 2022 20:41:35 -0400 Subject: [PATCH 02/13] Remove dupe code --- components/ItemGrid/ItemGrid.brs | 2 -- 1 file changed, 2 deletions(-) diff --git a/components/ItemGrid/ItemGrid.brs b/components/ItemGrid/ItemGrid.brs index 45dd578a..3cf1dc3b 100644 --- a/components/ItemGrid/ItemGrid.brs +++ b/components/ItemGrid/ItemGrid.brs @@ -453,10 +453,8 @@ sub optionsClosed() if m.options.view <> m.view if m.options.view = "music-artist" m.view = "music-artist" - set_user_setting("display.music.view", m.view) else if m.options.view = "music-album" m.view = "music-album" - set_user_setting("display.music.view", m.view) else m.view = "music-default" end if From 03b6ce984aa2c5cd6451d17508ec2e07271bebcf Mon Sep 17 00:00:00 2001 From: 1hitsong <3330318+1hitsong@users.noreply.github.com> Date: Wed, 8 Jun 2022 09:08:05 -0400 Subject: [PATCH 03/13] Add instant mix to album screen --- components/music/MusicAlbumDetails.brs | 15 +++++++++++--- components/music/MusicAlbumDetails.xml | 2 ++ source/Main.brs | 7 +++++++ source/ShowScenes.brs | 28 ++++++++++++++++++++++++++ source/api/Items.brs | 11 ++++++++++ 5 files changed, 60 insertions(+), 3 deletions(-) diff --git a/components/music/MusicAlbumDetails.brs b/components/music/MusicAlbumDetails.brs index 33c53d63..e4784842 100644 --- a/components/music/MusicAlbumDetails.brs +++ b/components/music/MusicAlbumDetails.brs @@ -3,6 +3,7 @@ sub init() setupMainNode() m.playAlbum = m.top.findNode("playAlbum") + m.instantMix = m.top.findNode("instantMix") m.albumCover = m.top.findNode("albumCover") m.songList = m.top.findNode("songList") m.infoGroup = m.top.FindNode("infoGroup") @@ -112,12 +113,20 @@ function onKeyEvent(key as string, press as boolean) as boolean return false end if - if key = "right" and m.playAlbum.hasFocus() - m.songList.setFocus(true) - return true + if key = "right" + if m.playAlbum.hasFocus() or m.instantMix.hasFocus() + m.songList.setFocus(true) + return true + end if else if key = "left" and m.songList.hasFocus() m.playAlbum.setFocus(true) return true + else if key = "down" and m.playAlbum.hasFocus() + m.instantMix.setFocus(true) + return true + else if key = "up" and m.instantMix.hasFocus() + m.playAlbum.setFocus(true) + return true end if return false diff --git a/components/music/MusicAlbumDetails.xml b/components/music/MusicAlbumDetails.xml index 5703dee9..d2ad590a 100644 --- a/components/music/MusicAlbumDetails.xml +++ b/components/music/MusicAlbumDetails.xml @@ -10,6 +10,7 @@