Slugify deals with repeating dashes.
This commit is contained in:
parent
7ad2051dd7
commit
8c84839bdd
|
|
@ -49,8 +49,6 @@ function scrapeScene({ query }, { url, entity }) {
|
||||||
release.entryId = getEntryId(url);
|
release.entryId = getEntryId(url);
|
||||||
release.title = query.content(['#media-holder .title', '.content-holder h1', '#scene h1', 'h2.titular', 'title'])?.replace(/\s+-$/, '');
|
release.title = query.content(['#media-holder .title', '.content-holder h1', '#scene h1', 'h2.titular', 'title'])?.replace(/\s+-$/, '');
|
||||||
|
|
||||||
console.log(release);
|
|
||||||
|
|
||||||
release.date = query.date('#sceneInfo .date, #trailer-data .date', 'YYYY-MM-DD');
|
release.date = query.date('#sceneInfo .date, #trailer-data .date', 'YYYY-MM-DD');
|
||||||
release.duration = query.duration('#sceneInfo .data-others, #trailer-data', /\d+:\d+/);
|
release.duration = query.duration('#sceneInfo .data-others, #trailer-data', /\d+:\d+/);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ function slugify(strings, delimiter = '-', {
|
||||||
: string;
|
: string;
|
||||||
|
|
||||||
const normalized = casedString
|
const normalized = casedString
|
||||||
.replace(/[_-]/g, ' ')
|
.replace(/[_-]+/g, ' ')
|
||||||
.split('')
|
.split('')
|
||||||
.map((char) => {
|
.map((char) => {
|
||||||
if (char === ' ') {
|
if (char === ' ') {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue