K-vanc/Tempest-EPG-Generator

Remove (or at least shrink space consumption) fields <credits></credits>, <video></video> (or similar) if empty

Closed this issue · 1 comments

Issue Type

Please choose your issue type

  • Request
  • Bug
  • Question

OS Details (Not required for Request)

Please choose your OS

  • Windows
  • Unix
  • Docker

Please write your version details (Below not required for Docker)

  • PHP Version: ...

  • Tempest Version: ...

Please write your web server name(Apache/Nginx etc.) or tick shared host if you are running on a shared host service / server (VPS, Web Hosting etc.)

  • Web Server Name: ...

  • Shared Host

Expected Behavior (Not required for Request)

If fields <credits></credits>, <video></video> (or similar) have been cleared out (for example through the Inverter-Module) then theese fields should not be present in XML-File.
(At least they they should consume the least space possible; e.g. <credits></credits>, <video></video> or <credits/>,<video/> without linebreaks.)

Current Behavior (Not required for Request)

Fields are still present even if empty and they consume a lot of space through linebreaks.

Example:
2024-08-28_234526

Steps to Reproduce (Not required for Request/Question)

Add Inverter line:
["desc":"##title##","# | #subtitle##","# (#episode#)#","#\nBeschreibung: #desc#\n#","#\nRegie: #director(, )##","#\nProduzent: #producer(, )##","#\nModeration: #presenter(, )##","#\nKommentar: #commentator(, )##","#\nSchauspieler: #actor(, )##","#\nGäste: #guest(, )##","#\nDrehbuch: #writer(, )##","#\nMusik/Komponist: #composer(, )##","#\nProduktionsdatum: #date##","#\nLand: #country(,)##","#\nKategorien: #category(, )##","#\nBewertung\[{system}\]: #rating##"]["director":||#delete#]["producer":||#delete#]["presenter":||#delete#]["commentator":||#delete#]["actor":||#delete#]["guest":||#delete#]["writer":||#delete#]["composer":||#delete#]["date":||#delete#]["country":||#delete#]["rating":||#delete#]["aspect":||#delete#]["quality":||#delete#]["audio":||#delete#]["colour":||#delete#]["video":||#delete#]["credits":||#delete#]

Attachments (Not required for Request/Question)

schedulesdirect.config.txt
schedulesdirect_inv.txt

Best regards,
Angus MacGyver

Hi,

I dont see any problem on your attached "schedulesdirect_inv.txt" file. "||#delete#" command will delete all requested element tags and inverter module will make final clean-up for all remaining white spaces(remaining gaps between lines). All this changes will be reflected into resulting "_inv.xml" file when grabbing and inverter operations completed. On your file, it shows that everything completed properly. Probably you take your screenshot while still grabbing is on-going.

image

Above is your resulting file. Do you see any problem? If you didnt do it intentionally, 1 extra line in description is coming from your setup as;

"#\nBeschreibung: #desc#\n#","#\nRegie: #director(, )##"

I don't use \n for #desc# keyword usually instead I use it on beginning of following keywords but you can add an extra clean-up to the end of your inverter path as

["desc":||#replace#(\n{2,})||\n]

this will replace 2 or more following line space with 1.