Skip to content

Commit

Permalink
fix(lib/Bixbox): do not fails if genres is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
noaione committed May 2, 2024
1 parent 8bc13e6 commit 4c855a1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions index.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
{
"name": "Bixbox",
"ver": "1.1.0"
"ver": "1.1.1"
},
{
"name": "Multipartd",
Expand Down Expand Up @@ -417,7 +417,7 @@
"imageURL": "https://github.com/noaione/shosetsu-extensions/raw/dev/icons/KnoxT.png",
"id": 954053,
"lang": "en",
"ver": "0.3.0",
"ver": "0.3.1",
"libVer": "1.0.0",
"md5": "",
"disableTest": true
Expand All @@ -428,7 +428,7 @@
"imageURL": "https://github.com/noaione/shosetsu-extensions/raw/dev/icons/Awebstories.png",
"id": 954054,
"lang": "en",
"ver": "0.2.0",
"ver": "0.2.1",
"libVer": "1.0.0",
"md5": "",
"disableTest": true
Expand Down
10 changes: 6 additions & 4 deletions lib/Bixbox.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- {"ver":"1.1.0","author":"N4O","dep":["WPCommon"]}
-- {"ver":"1.1.1","author":"N4O","dep":["WPCommon"]}

local encode = Require("url").encode
local WPCommon = Require("WPCommon");
Expand Down Expand Up @@ -278,9 +278,11 @@ function defaults:parseNovel(novelUrl, loadChapters)
end

local genreMap = infoX:selectFirst(".genxed")
novel:setGenres(map(genreMap:children(), function (genre)
return genre:text()
end))
if genreMap then
novel:setGenres(map(genreMap:children(), function (genre)
return genre:text()
end))
end

local infoPills = infoX:selectFirst(".spe")
local _authors = {}
Expand Down
2 changes: 1 addition & 1 deletion src/en/Awebstories.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- {"id":954054,"ver":"0.2.0","libVer":"1.0.0","author":"N4O","dep":["Bixbox>=1.1.0","WPCommon>=1.0.2"]}
-- {"id":954054,"ver":"0.2.1","libVer":"1.0.0","author":"N4O","dep":["Bixbox>=1.1.1","WPCommon>=1.0.2"]}

local WPCommon = Require("WPCommon")

Expand Down
2 changes: 1 addition & 1 deletion src/en/KnoxT.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- {"id":954053,"ver":"0.3.0","libVer":"1.0.0","author":"N4O","dep":["Bixbox>=1.1.0","WPCommon>=1.0.2"]}
-- {"id":954053,"ver":"0.3.1","libVer":"1.0.0","author":"N4O","dep":["Bixbox>=1.1.1","WPCommon>=1.0.2"]}

local WPCommon = Require("WPCommon")

Expand Down

0 comments on commit 4c855a1

Please sign in to comment.