Skip to content

Commit 6136829

Browse files
committed
Fixes
1 parent 9a14986 commit 6136829

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

lib/htmlParser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ exports.parseArtistInfo = function (html, artistUrl) {
386386
attr: 'href'
387387
},
388388
bannerImage: {
389-
selector: ".desktop-header a img",
389+
selector: '.desktop-header a img',
390390
attr: 'src'
391391
},
392392
description: 'p#bio-text',

lib/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const htmlParser = require('./htmlParser.js')
44
const utils = require('./utils.js')
55

66
const checkNotFound = function (html) {
7-
return (html.includes("Sorry, that something isn’t here.") || html.includes('<meta property="og:url" content="https://bandcamp.com/">'));
7+
return (html.includes('Sorry, that something isn’t here.') || html.includes('<meta property="og:url" content="https://bandcamp.com/">'))
88
}
99

1010
exports.search = function (params, cb) {
@@ -13,7 +13,7 @@ exports.search = function (params, cb) {
1313
if (error) {
1414
cb(error, null)
1515
} else {
16-
if (checkNotFound(html)) return cb("404", null);
16+
if (checkNotFound(html)) return cb('404', null)
1717
const searchResults = htmlParser.parseSearchResults(html)
1818
cb(null, searchResults)
1919
}
@@ -26,7 +26,7 @@ exports.getAlbumsWithTag = function (params, cb) {
2626
if (error) {
2727
cb(error, null)
2828
} else {
29-
if (checkNotFound(html)) return cb("404", null);
29+
if (checkNotFound(html)) return cb('404', null)
3030
const tagResults = htmlParser.parseTagResults(html)
3131
cb(null, tagResults)
3232
}
@@ -39,7 +39,7 @@ exports.getAlbumUrls = function (artistUrl, cb) {
3939
if (error) {
4040
cb(error, null)
4141
} else {
42-
if (checkNotFound(html)) return cb("404", null);
42+
if (checkNotFound(html)) return cb('404', null)
4343
const albumUrls = htmlParser.parseAlbumUrls(html, artistUrl)
4444
cb(null, albumUrls)
4545
}
@@ -51,7 +51,7 @@ exports.getAlbumInfo = function (albumUrl, cb) {
5151
if (error) {
5252
cb(error, null)
5353
} else {
54-
if (checkNotFound(html)) return cb("404", null);
54+
if (checkNotFound(html)) return cb('404', null)
5555
const albumInfo = htmlParser.parseAlbumInfo(html, albumUrl)
5656
cb(null, albumInfo)
5757
}
@@ -63,7 +63,7 @@ exports.getAlbumProducts = function (albumUrl, cb) {
6363
if (error) {
6464
cb(error, null)
6565
} else {
66-
if (checkNotFound(html)) return cb("404", null);
66+
if (checkNotFound(html)) return cb('404', null)
6767
const products = htmlParser.parseAlbumProducts(html, albumUrl)
6868
cb(null, products)
6969
}
@@ -76,7 +76,7 @@ exports.getArtistUrls = function (labelUrl, cb) {
7676
if (error) {
7777
cb(error, null)
7878
} else {
79-
if (checkNotFound(html)) return cb("404", null);
79+
if (checkNotFound(html)) return cb('404', null)
8080
const artistUrls = htmlParser.parseArtistUrls(html, labelUrl)
8181
cb(null, artistUrls)
8282
}
@@ -88,7 +88,7 @@ exports.getArtistInfo = function (artistUrl, cb) {
8888
if (error) {
8989
cb(error, null)
9090
} else {
91-
if (checkNotFound(html)) return cb("404", null);
91+
if (checkNotFound(html)) return cb('404', null)
9292
const artistInfo = htmlParser.parseArtistInfo(html, artistUrl)
9393
cb(null, artistInfo)
9494
}
@@ -100,7 +100,7 @@ exports.getTrackInfo = function (trackUrl, cb) {
100100
if (error) {
101101
cb(error, null)
102102
} else {
103-
if (checkNotFound(html)) return cb("404", null);
103+
if (checkNotFound(html)) return cb('404', null)
104104
const trackInfo = htmlParser.parseTrackInfo(html, trackUrl)
105105
cb(null, trackInfo)
106106
}

schemas/album-info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "http://json-schema.org/draft-04/schema#",
2+
"$schema": "http://json-schema.org/draft-07/schema#",
33
"definitions": {
44
"track": {
55
"type": "object",

schemas/album-product.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "http://json-schema.org/draft-04/schema#",
2+
"$schema": "http://json-schema.org/draft-07/schema#",
33
"title" : "album-product",
44
"description" : "The JSON schema that matches an album product.",
55
"id": "https://mastert.github.io/bandcamp-scraper/schemas/album-product.json",

schemas/artist-info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "http://json-schema.org/draft-04/schema#",
2+
"$schema": "http://json-schema.org/draft-07/schema#",
33
"title": "artist-info",
44
"description": "The JSON schema that matches artist info.",
55
"id": "https://mastert.github.io/bandcamp-scraper/schemas/artist-info.json",

schemas/search-result.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "http://json-schema.org/draft-04/schema#",
2+
"$schema": "http://json-schema.org/draft-07/schema#",
33
"definitions": {
44
"artist": {
55
"type": "object",

schemas/tag-result.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "http://json-schema.org/draft-04/schema#",
2+
"$schema": "http://json-schema.org/draft-07/schema#",
33
"title": "tag-result",
44
"type": "object",
55
"additionalProperties": false,

schemas/track-info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "http://json-schema.org/draft-04/schema#",
2+
"$schema": "http://json-schema.org/draft-07/schema#",
33
"definitions": {},
44
"title" : "track-info",
55
"description" : "The JSON schema that matches album info.",

0 commit comments

Comments
 (0)