Update scripts

This commit is contained in:
freearhey 2025-03-18 08:32:46 +03:00
parent 77680e2dc9
commit 075c53143e
14 changed files with 520 additions and 132 deletions

View file

@ -3,40 +3,30 @@ import { IssueData, Issue } from '../core'
const FIELDS = new Dictionary({
'Channel ID': 'channel_id',
'Channel ID (required)': 'channel_id',
'Channel ID (optional)': 'channel_id',
'Channel Name': 'name',
'Channel Name': 'channel_name',
'Feed Name': 'feed_name',
'Feed ID': 'feed_id',
'Main Feed': 'is_main',
'Alternative Names': 'alt_names',
'Alternative Names (optional)': 'alt_names',
Network: 'network',
'Network (optional)': 'network',
Owners: 'owners',
'Owners (optional)': 'owners',
Country: 'country',
Subdivision: 'subdivision',
'Subdivision (optional)': 'subdivision',
City: 'city',
'City (optional)': 'city',
'Broadcast Area': 'broadcast_area',
Timezones: 'timezones',
Format: 'video_format',
Languages: 'languages',
Categories: 'categories',
'Categories (optional)': 'categories',
NSFW: 'is_nsfw',
Launched: 'launched',
'Launched (optional)': 'launched',
Closed: 'closed',
'Closed (optional)': 'closed',
'Replaced By': 'replaced_by',
'Replaced By (optional)': 'replaced_by',
Website: 'website',
'Website (optional)': 'website',
Logo: 'logo',
Reason: 'reason',
Notes: 'notes',
'Notes (optional)': 'notes',
Reference: 'ref',
'Reference (optional)': 'ref',
'Reference (required)': 'ref'
Reference: 'ref'
})
export class IssueParser {
@ -46,7 +36,7 @@ export class IssueParser {
const data = new Dictionary()
fields.forEach((field: string) => {
let [_label, , _value] = field.split(/\r?\n/)
_label = _label ? _label.trim() : ''
_label = _label ? _label.replace(/ \(optional\)| \(required\)/, '').trim() : ''
_value = _value ? _value.trim() : ''
if (!_label || !_value) return data