From 97fa7e435f3ac86199aa62f26ed7dce9fa4126bb Mon Sep 17 00:00:00 2001 From: ValkyrJS Date: Tue, 18 Jun 2024 23:30:40 +0100 Subject: [PATCH] release: PDE v0.2.1 --- .../PerformerDetailsExtended.js | 26 ++++++++++--------- .../PerformerDetailsExtended.yml | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/plugins/PerformerDetailsExtended/PerformerDetailsExtended.js b/plugins/PerformerDetailsExtended/PerformerDetailsExtended.js index 7087ba3..be852df 100644 --- a/plugins/PerformerDetailsExtended/PerformerDetailsExtended.js +++ b/plugins/PerformerDetailsExtended/PerformerDetailsExtended.js @@ -319,17 +319,19 @@ var ItemMostFeaturedOn = function (_a) { networks_1.push({ count: 1, data: network }); } }); - // Sort count from highest to lowest number of scenes. - networks_1.sort(sortHighToLow); - var topNetwork = networks_1[0]; - var additionalNetworkDataValue = topNetwork.count + (topNetwork.count === 1 ? " scene" : " scenes"); - var linkToNetwork = "/studios/".concat(topNetwork.data.id, "/scenes?c=(\"type\":\"performers\",\"value\":(\"items\":%5B(\"id\":\"").concat(performer.id, "\",\"label\":\"").concat(encodeURIComponent(performer.name), "\")%5D,\"excluded\":%5B%5D),\"modifier\":\"INCLUDES\")"); - // Don't return the network unless it is different from the top studio. - if (topNetwork.data.id !== topStudio.data.id) { - itemMostFeaturedNetwork = (React.createElement(DetailItem_1.default, { collapsed: props.collapsed, id: "most-featured-network", title: "Most Featured On (Network)", value: React.createElement("a", { href: linkToNetwork }, topNetwork.data.name), wide: true, additionalData: { - id: "featured-network-scenes", - value: additionalNetworkDataValue, - } })); + if (networks_1.length > 0) { + // Sort count from highest to lowest number of scenes. + networks_1.sort(sortHighToLow); + var topNetwork = networks_1[0]; + var additionalNetworkDataValue = topNetwork.count + (topNetwork.count === 1 ? " scene" : " scenes"); + var linkToNetwork = "/studios/".concat(topNetwork.data.id, "/scenes?c=(\"type\":\"performers\",\"value\":(\"items\":%5B(\"id\":\"").concat(performer.id, "\",\"label\":\"").concat(encodeURIComponent(performer.name), "\")%5D,\"excluded\":%5B%5D),\"modifier\":\"INCLUDES\")"); + // Don't return the network unless it is different from the top studio. + if (topNetwork.data.id !== topStudio.data.id) { + itemMostFeaturedNetwork = (React.createElement(DetailItem_1.default, { collapsed: props.collapsed, id: "most-featured-network", title: "Most Featured On (Network)", value: React.createElement("a", { href: linkToNetwork }, topNetwork.data.name), wide: true, additionalData: { + id: "featured-network-scenes", + value: additionalNetworkDataValue, + } })); + } } } return (React.createElement(React.Fragment, null, @@ -712,7 +714,7 @@ PluginApi.patch.after("PerformerDetailsPanel.DetailGroup", function (_a) { }, }); var qAllStudios = GQL.useFindStudiosQuery({ - variables: { filter: { sort: "id" } }, + variables: { filter: { per_page: -1, sort: "id" } }, }); var qConfig = GQL.useConfigurationQuery(); var qStats = GQL.useStatsQuery(); diff --git a/plugins/PerformerDetailsExtended/PerformerDetailsExtended.yml b/plugins/PerformerDetailsExtended/PerformerDetailsExtended.yml index 1d07f1f..3912e40 100644 --- a/plugins/PerformerDetailsExtended/PerformerDetailsExtended.yml +++ b/plugins/PerformerDetailsExtended/PerformerDetailsExtended.yml @@ -1,7 +1,7 @@ name: Performer Details Extended description: Displays metadata about frequent scene partners, most prominent tags, etc. in your library, on performer pages. url: https://github.com/Valkyr-JS/performer-details-extended -version: 0.1.0 +version: 0.2.1 ui: javascript: - PerformerDetailsExtended.js