fix: correct Live 24/7 handling and label regressions

- stream.updateWithIssue: 'Live 24/7: Yes' meant the stream IS 24/7, but it
  was assigned straight to isNot247, inverting the label. A 'No' answer was
  also ignored because the guard skipped falsy values.
- dataSet.getBoolean: an unanswered dropdown is stored as '' by
  parseIssueBody, which getBoolean read as false. Treat it as undefined so
  'no answer' means 'leave unchanged' instead of 'Not 24/7'.
- update.addStream: has() is true for an unanswered field, so it produced
  isNot247 = true for issues that left the dropdown blank.
- generate: sortBy got five orders for four iteratees.
- 2_streams_edit.yml: restore the '~' reset option dropped from the quality
  dropdown when the Label field was removed.
- stream.getLabels: use const to satisfy prefer-const.
This commit is contained in:
Sanaei
2026-09-04 18:02:35 +02:00
parent 3448e44b7e
commit 994b12fb25
6 changed files with 15 additions and 9 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ async function main() {
(stream: Stream) => (stream.isNot247 ? -1 : 0),
(stream: Stream) => stream.getVerticalResolution()
],
['asc', 'desc', 'desc', 'desc', 'asc']
['asc', 'desc', 'desc', 'desc']
)
logger.info('filtering streams...')
+5 -2
View File
@@ -264,8 +264,11 @@ async function addStream(issue: Issue) {
label: null
})
stream.isNot247 = data.has('live_247') ? !data.getBoolean('live_247') : false
stream.isGeoBlocked = data.has('geo_blocked') ? data.getBoolean('geo_blocked') : false
const live247 = data.getBoolean('live_247')
const geoBlocked = data.getBoolean('geo_blocked')
stream.isNot247 = live247 === undefined ? false : !live247
stream.isGeoBlocked = geoBlocked === true
stream.updateTitle().updateFilepath()
+4 -2
View File
@@ -23,9 +23,11 @@ export class DataSet {
}
getBoolean(key: string): boolean | undefined {
if (this.missing(key)) return undefined
const value = this._data.get(key)
return this._data.get(key) === 'TRUE' ? true : false
if (value === undefined || value === '') return undefined
return value === 'TRUE'
}
getString(key: string): string | undefined {
+3 -3
View File
@@ -53,8 +53,8 @@ export class Stream extends sdk.Models.Stream {
const live247 = dataSet.getBoolean('live_247')
const geoBlocked = dataSet.getBoolean('geo_blocked')
if (live247) this.isNot247 = live247
if (geoBlocked) this.isGeoBlocked = geoBlocked
if (live247 !== undefined) this.isNot247 = !live247
if (geoBlocked !== undefined) this.isGeoBlocked = geoBlocked
const quality = dataSet.isDeleted('quality') ? '' : dataSet.getString('quality')
const httpUserAgent = dataSet.isDeleted('http_user_agent')
@@ -435,7 +435,7 @@ export class Stream extends sdk.Models.Stream {
}
getLabels(): string[] {
let labels: string[] = []
const labels: string[] = []
if (this.isNot247 === true) {
labels.push('Not 24/7')
}