From 007e53bb06b4e20cb0ee8af89fdafcae6fc1fae8 Mon Sep 17 00:00:00 2001 From: jellyfin-bot Date: Mon, 29 Jul 2024 12:44:46 +0000 Subject: [PATCH] Update API docs --- docs/api/components_ItemGrid_GridItem.bs.html | 15 +++++++++ docs/api/components_ItemGrid_ItemGrid.bs.html | 13 ++++++-- ...components_ItemGrid_LoadItemsTask2.bs.html | 11 ++++++- docs/api/components_data_HomeData.bs.html | 14 ++++---- .../api/components_home_LoadItemsTask.bs.html | 33 +++++++++++++++++++ docs/api/source_Main.bs.html | 3 ++ 6 files changed, 79 insertions(+), 10 deletions(-) diff --git a/docs/api/components_ItemGrid_GridItem.bs.html b/docs/api/components_ItemGrid_GridItem.bs.html index fbe36be96..237d51cb5 100644 --- a/docs/api/components_ItemGrid_GridItem.bs.html +++ b/docs/api/components_ItemGrid_GridItem.bs.html @@ -114,6 +114,21 @@ else m.itemText.text = itemData.Title end if + ' Adjust to wide posters for "View All Next Up" + if m.topParent.overhangTitle = tr("View All Next Up") + m.posterMask.maskUri = "" + + m.itemPoster.height = 300 + m.itemPoster.width = 400 + m.itemPoster.loadDisplayMode = "scaleToFit" + + m.backdrop.height = 300 + m.backdrop.width = 400 + m.backdrop.loadDisplayMode = "scaleToFit" + + m.itemText.translation = [0, m.itemPoster.height + 7] + m.itemText.maxWidth = 400 + end if else if itemData.type = "MusicArtist" m.itemPoster.uri = itemData.PosterUrl m.itemText.text = itemData.Title diff --git a/docs/api/components_ItemGrid_ItemGrid.bs.html b/docs/api/components_ItemGrid_ItemGrid.bs.html index 417c23f56..f90793408 100644 --- a/docs/api/components_ItemGrid_ItemGrid.bs.html +++ b/docs/api/components_ItemGrid_ItemGrid.bs.html @@ -200,6 +200,14 @@ ' non recursive for collections (folders, boxsets, photo albums, etc) m.loadItemsTask.recursive = false end if + + if getCollectionType() = "nextup" + m.loadItemsTask.itemType = "NextUp" + m.itemGrid.itemSize = "[400, 300]" + m.top.imageDisplayMode = "scaleToFit" + m.itemGrid.numColumns = 4 + m.alpha.visible = false + end if else if m.top.parentItem.json.type = "Studio" m.loadItemsTask.itemId = m.top.parentItem.parentFolder m.loadItemsTask.itemType = "Series,Movie" @@ -404,7 +412,6 @@ setPhotoAlbumOptions(options) else if getCollectionType() = "music" setMusicOptions(options) - else setDefaultOptions(options) end if @@ -788,7 +795,7 @@ searchGrp.setFocus(false) end if - if key = "options" + if key = "options" and getCollectionType() <> "nextup" if m.options.visible = true m.options.visible = false m.top.removeChild(m.options) @@ -838,7 +845,7 @@ m.top.quickPlayNode = itemToPlay return true end if - else if key = "left" and topGrp.isinFocusChain() + else if key = "left" and topGrp.isinFocusChain() and m.alpha.visible m.top.alphaActive = true topGrp.setFocus(false) m.alphaMenu.setFocus(true) diff --git a/docs/api/components_ItemGrid_LoadItemsTask2.bs.html b/docs/api/components_ItemGrid_LoadItemsTask2.bs.html index e7d8cfff7..a0953bc3b 100644 --- a/docs/api/components_ItemGrid_LoadItemsTask2.bs.html +++ b/docs/api/components_ItemGrid_LoadItemsTask2.bs.html @@ -132,6 +132,11 @@ url = Substitute("Users/{0}/Items/", m.global.session.user.id) params.append({ ImageTypeLimit: 1 }) params.append({ EnableImageTypes: "Primary,Backdrop,Banner,Thumb" }) + else if LCase(m.top.ItemType) = "nextup" + url = "Shows/NextUp" + params.limit = 100 ' If you have more than 100 in your Next Up queue, maybe go outside a bit more. + params.append({ ImageTypeLimit: 1 }) + params.append({ EnableImageTypes: "Primary,Backdrop,Banner,Thumb" }) else url = Substitute("Users/{0}/Items/", m.global.session.user.id) end if @@ -196,6 +201,10 @@ tmp.image = PosterImage(item.id, { "maxHeight": 425, "maxWidth": 290, "quality": "90" }) else if item.type = "Episode" tmp = CreateObject("roSGNode", "TVEpisode") + if LCase(m.top.ItemType) = "nextup" + tmp.title = item.name + tmp.type = "Episode" + end if else if LCase(item.Type) = "recording" tmp = CreateObject("roSGNode", "RecordingData") else if item.Type = "Genre" @@ -283,7 +292,7 @@ end if if tmp <> invalid - if item.Type <> "Genre" and item.Type <> "MusicGenre" + if LCase(item.Type) <> "genre" and LCase(item.Type) <> "musicgenre" tmp.parentFolder = m.top.itemId tmp.json = item if item.UserData <> invalid and item.UserData.isFavorite <> invalid diff --git a/docs/api/components_data_HomeData.bs.html b/docs/api/components_data_HomeData.bs.html index c41f3739d..699f7e464 100644 --- a/docs/api/components_data_HomeData.bs.html +++ b/docs/api/components_data_HomeData.bs.html @@ -21,15 +21,17 @@ ' Set appropriate Images for Wide and Tall based on type - if datum.type = "CollectionFolder" or datum.type = "UserView" - params = { "Tag": datum.ImageTags.Primary, "maxHeight": 261, "maxWidth": 464 } - m.top.thumbnailURL = ImageURL(datum.id, "Primary", params) - m.top.widePosterUrl = m.top.thumbnailURL + if LCase(datum.type) = "collectionfolder" or LCase(datum.type) = "userview" + if IsValid(datum.ImageTags) + params = { "Tag": datum.ImageTags.Primary, "maxHeight": 261, "maxWidth": 464 } + m.top.thumbnailURL = ImageURL(datum.id, "Primary", params) + m.top.widePosterUrl = m.top.thumbnailURL + end if ' Add Icon URLs for display if there is no Poster - if datum.CollectionType = "livetv" + if LCase(m.top.CollectionType) = "livetv" m.top.iconUrl = "pkg:/images/media_type_icons/live_tv_white.png" - else if datum.CollectionType = "folders" + else if LCase(m.top.CollectionType) = "folders" or LCase(m.top.CollectionType) = "nextup" m.top.iconUrl = "pkg:/images/media_type_icons/folder_white.png" end if diff --git a/docs/api/components_home_LoadItemsTask.bs.html b/docs/api/components_home_LoadItemsTask.bs.html index c58f7275e..d64999acc 100644 --- a/docs/api/components_home_LoadItemsTask.bs.html +++ b/docs/api/components_home_LoadItemsTask.bs.html @@ -87,6 +87,9 @@ end if end if + addViewAll = true ' Assume there will be a "View All" to start + checkViewAll = false ' Only need to check if we don't have anything in the Next Up home row + resp = APIRequest(url, params) data = getJson(resp) if isValid(data) and isValid(data.Items) @@ -95,6 +98,36 @@ tmp.json = item results.push(tmp) end for + if data.Items.Count() = 0 + checkViewAll = true + end if + else + checkViewAll = true + end if + + ' Add "View All" + if checkViewAll + ' Nothing to show in Next Up, but are there hidden items (e.g. > 365 days old)? + params.Delete("NextUpDateCutoff") + params["limit"] = 1 ' if there is even one, then we know we need to show "View All" + resp = APIRequest(url, params) + data = getJson(resp) + if not isValid(data) or isValid(data) and isValid(data.Items) and data.Items.Count() = 0 + addViewAll = false + end if + end if + + if addViewAll + tmp = CreateObject("roSGNode", "HomeData") + tmp.type = "CollectionFolder" + tmp.usePoster = false + tmp.json = { + IsFolder: true, + Name: tr("View All Next Up"), + Type: "CollectionFolder", + CollectionType: "nextup" + } + results.push(tmp) end if ' Load Continue Watching else if m.top.itemsToLoad = "continue" diff --git a/docs/api/source_Main.bs.html b/docs/api/source_Main.bs.html index 3e36d1639..5be9514c8 100644 --- a/docs/api/source_Main.bs.html +++ b/docs/api/source_Main.bs.html @@ -270,6 +270,9 @@ group = CreateMovieLibraryView(selectedItem) else if selectedItem.collectionType = "music" group = CreateMusicLibraryView(selectedItem) + else if selectedItem.collectionType = "nextup" + group = CreateItemGrid(selectedItem) + group.optionsAvailable = false else group = CreateItemGrid(selectedItem) end if