From d70ef47a41b4a84d673ba00a43a26d51c44fad6b Mon Sep 17 00:00:00 2001 From: Moe Date: Mon, 7 Sep 2020 23:39:18 +0700 Subject: [PATCH] Fix blank space in description --- lib/scrapper/new-release.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/scrapper/new-release.dart b/lib/scrapper/new-release.dart index dfc23d9..03ceb23 100644 --- a/lib/scrapper/new-release.dart +++ b/lib/scrapper/new-release.dart @@ -45,6 +45,7 @@ Future getEpisodeDetail(String url) async { try { List streamUrls = []; List downloadUrls = []; + List description = []; final response = await http.get(url); var document = parse(response.body); document.getElementsByTagName('iframe').forEach((x) { @@ -59,15 +60,14 @@ Future getEpisodeDetail(String url) async { var detailUrl = imageBox.getElementsByTagName('a')[0].attributes['href']; var contentBox = document.getElementsByClassName('contenidotv')[0]; var title = contentBox.getElementsByTagName('h2')[0].text; - var description = ''; contentBox.getElementsByTagName('p').forEach((x) { - description += x.text + '\n\n'; + description.add(x.text); }); var rmv = title.split(' Episode '); title = rmv[0].replaceAll('Sinopsis dari anime ', ''); final data = { 'title': title, - 'description': description, + 'description': description.join('\n\n'), 'image': image.replaceAll(new RegExp(r'\/w(\d\d\d)\/'), '/original/'), 'detail_url': detailUrl, 'stream_url': streamUrls,