File tree Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Original file line number Diff line number Diff line change 11import { Author , Series , SeriesWorkSummary } from "types/entities" ;
22import { SeriesPage , WorkPage } from "../page-loaders" ;
33import { CheerioAPI , load } from "cheerio" ;
4- import { getWorkDetailsFromUrl } from "src/urls" ;
4+ import { getWorkDetailsFromUrl , getWorkUrl } from "src/urls" ;
55import {
66 getWorkBookmarkCount ,
77 getWorkHits ,
@@ -136,9 +136,11 @@ const getSeriesWork = (workHtml: string): SeriesWorkSummary => {
136136 const publishedChapters = getWorkPublishedChapters ( $$work ) ;
137137
138138 const url = $work ( "a[href*='/works/']" ) . attr ( "href" ) as string ;
139+ const id = getWorkDetailsFromUrl ( { url } ) . workId
139140
140141 return {
141- id : getWorkDetailsFromUrl ( { url } ) . workId ,
142+ id,
143+ url : getWorkUrl ( { workId : id } ) ,
142144 title : getSeriesWorkTitle ( $work ) ,
143145 updatedAt : getSeriesWorkUpdateDate ( $work ) ,
144146
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import {
1313 getSeriesWorkCount ,
1414 getSeriesWorks ,
1515} from "./getters" ;
16- import { getWorkUrl } from "src/urls" ;
1716
1817export const getSeries = async ( {
1918 seriesId,
@@ -37,7 +36,5 @@ export const getSeries = async ({
3736 complete : getSeriesCompletionStatus ( seriesPage ) ,
3837 workCount : getSeriesWorkCount ( seriesPage ) ,
3938 works : seriesWorks ,
40- workTitles : seriesWorks . map ( ( work ) => work . title ) ,
41- workUrls : seriesWorks . map ( ( work ) => getWorkUrl ( { workId : work . id } ) ) ,
4239 } ;
4340} ;
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ export interface SeriesWorkSummary
4343 WorkSummary ,
4444 "category" | "publishedAt" | "rating" | "tags" | "stats" | "locked"
4545 > {
46+ url : string ;
4647 tags : Omit < WorkSummary [ "tags" ] , "warnings" > ;
4748 stats : Omit < WorkSummary [ "stats" ] , "comments" > ;
4849}
@@ -58,11 +59,8 @@ export interface Series {
5859 words : number ;
5960 bookmarks : number ;
6061 complete : boolean ;
61-
6262 workCount : number ;
6363 works : SeriesWorkSummary [ ] ;
64- workTitles : string [ ]
65- workUrls : string [ ]
6664}
6765
6866export enum WorkRatings {
You can’t perform that action at this time.
0 commit comments