Skip to content

Commit

Permalink
improve cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
TA2k committed Nov 21, 2024
1 parent 673d52a commit 9ff8bed
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -778,9 +778,12 @@ class Bmw extends utils.Adapter {
//subtitle = Zuhause • 2h 16min • ~ 5,97 EUR
//remove all tildes
let cleanedSubtitle = session.subtitle.replace(/~/g, '');
//remove all small than
cleanedSubtitle = cleanedSubtitle.replace(/</g, '');
//split array on dots
cleanedSubtitle = cleanedSubtitle.split('•');
// const cleanedSubtitle = session.subtitle.replace('~', '').replace('•', '').replace(' ', ' ').replace(' ', ' ').trim();
session.location = cleanedSubtitle[0].trim();
session.duration = cleanedSubtitle[1].trim();
session.cost = cleanedSubtitle[2].trim().split(' ')[0];
session.currency = cleanedSubtitle[2].trim().split(' ')[1];
Expand Down

0 comments on commit 9ff8bed

Please sign in to comment.