podverse-shared
Advanced tools
Comparing version 4.14.6 to 4.14.7
declare type SeasonSection = { | ||
seasonKey: string; | ||
orderByNumber: number; | ||
title: string; | ||
@@ -4,0 +5,0 @@ data: any[]; |
@@ -38,7 +38,8 @@ "use strict"; | ||
} | ||
var otherSection = { seasonKey: '', title: '', data: [] }; | ||
var otherBonusSection = { seasonKey: '', title: '', data: [] }; | ||
var otherSection = { seasonKey: '', title: '', data: [], orderByNumber: 0 }; | ||
var otherBonusSection = { seasonKey: '', title: '', data: [], orderByNumber: -1 }; | ||
for (var seasonKey in seasons) { | ||
if (seasons.hasOwnProperty(seasonKey)) { | ||
var seasonNumber = seasonKey.split('_')[0]; | ||
var orderByNumber = parseInt(seasonNumber, 10) || -1; | ||
var isBonus = seasonKey.split('_')[1] === _bonusKey; | ||
@@ -48,2 +49,3 @@ var isOther = seasonNumber === _otherKey; | ||
if (isBonus) { | ||
orderByNumber = orderByNumber + 0.5; | ||
var label = isOther ? translator('Other') : translator('Season') + " " + seasonNumber; | ||
@@ -53,5 +55,7 @@ title = label + " - " + translator('Bonus'); | ||
else if (isOther) { | ||
orderByNumber = 1000000; | ||
title = translator('Other'); | ||
} | ||
var section = { | ||
orderByNumber: orderByNumber, | ||
seasonKey: seasonKey, | ||
@@ -73,6 +77,6 @@ title: title, | ||
if (querySort === _mostRecentKey) { | ||
seasonSections = orderBy_1.default(seasonSections, ['seasonKey'], [descSort]); | ||
seasonSections = orderBy_1.default(seasonSections, ['orderByNumber'], [descSort]); | ||
} | ||
else if (querySort === _oldestKey) { | ||
seasonSections = orderBy_1.default(seasonSections, ['seasonKey'], [ascSort]); | ||
seasonSections = orderBy_1.default(seasonSections, ['orderByNumber'], [ascSort]); | ||
} | ||
@@ -79,0 +83,0 @@ if (((_b = otherSection === null || otherSection === void 0 ? void 0 : otherSection.data) === null || _b === void 0 ? void 0 : _b.length) > 0) { |
{ | ||
"name": "podverse-shared", | ||
"version": "4.14.6", | ||
"version": "4.14.7", | ||
"description": "Helpers that are used across multiple Podverse modules", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
140101
2320