Skip to content

Commit

Permalink
MaidMangaID: Changed template (#1652)
Browse files Browse the repository at this point in the history
  • Loading branch information
Slasar41 authored Sep 11, 2024
1 parent baf22b8 commit 1cc6546
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions lua/modules/MaidMangaID.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ end
-- Local Constants
----------------------------------------------------------------------------------------------------

local Template = require 'templates.MangaThemesia'
DirectoryPagination = '/manga-list/'
-- XPathTokenAuthors = 'Author'
-- XPathTokenArtists = 'Artist'
local Template = require 'templates.ZManga'
-- DirectoryPagination = '/manga-list/'

----------------------------------------------------------------------------------------------------
-- Event Functions
Expand All @@ -30,37 +28,19 @@ DirectoryPagination = '/manga-list/'
function GetNameAndLink()
Template.GetNameAndLink()

CreateTXQuery(HTTP.Document).XPathHREFAll('//div[@class="mangalist-blc"]//a', LINKS, NAMES)

return no_error
end

-- Get info and chapter list for current manga.
function GetInfo()
Template.GetInfo()

x = CreateTXQuery(HTTP.Document)
MANGAINFO.Title = x.XPathString('//div[@class="series-title"]')
MANGAINFO.CoverLink = x.XPathString('//div[@class="series-thumb"]/img/@src')
MANGAINFO.Authors = x.XPathString('//li[contains(b, "Author")]/span')
MANGAINFO.Genres = x.XPathStringAll('//div[@class="series-genres"]/a')
MANGAINFO.Status = MangaInfoStatusIfPos(x.XPathString('//span[contains(@class, "status")]'))
MANGAINFO.Summary = x.XPathString('//div[@class="series-synops"]/string-join(.//text(), " ")')

for v in x.XPath('//ul[@class="series-chapterlist"]//a').Get() do
MANGAINFO.ChapterLinks.Add(v.GetAttribute('href'))
MANGAINFO.ChapterNames.Add(x.XPathString('span[1]/text()', v))
end
MANGAINFO.ChapterLinks.Reverse(); MANGAINFO.ChapterNames.Reverse()

return no_error
end

-- Get the page count for the current chapter.
function GetPageNumber()
Template.GetPageNumber()

CreateTXQuery(HTTP.Document).XPathStringAll('//div[@class="reader-area"]//img/@src', TASK.PageLinks)

return no_error
end

0 comments on commit 1cc6546

Please sign in to comment.