MCPcopy
hub / github.com/MALSync/MALSync / compilePage

Function compilePage

src/pages-chibi/builder/chibiHelper.ts:83–164  ·  view source on GitHub ↗
(page: PageInterfaceCompiled)

Source from the content-addressed store, hash-verified

81}
82
83function compilePage(page: PageInterfaceCompiled): PageInterfaceCompiled {
84 page.sync.isSyncPage = page.sync.isSyncPage($c) as any;
85 page.sync.getTitle = page.sync.getTitle($c) as any;
86 page.sync.getIdentifier = page.sync.getIdentifier($c) as any;
87 page.sync.getOverviewUrl = page.sync.getOverviewUrl($c) as any;
88 page.sync.getEpisode = page.sync.getEpisode($c) as any;
89 if (page.sync.getVolume) {
90 page.sync.getVolume = page.sync.getVolume($c) as any;
91 }
92 if (page.sync.getImage) {
93 page.sync.getImage = page.sync.getImage($c) as any;
94 }
95 if (page.sync.nextEpUrl) {
96 page.sync.nextEpUrl = page.sync.nextEpUrl($c) as any;
97 }
98 if (page.sync.uiInjection) {
99 page.sync.uiInjection = page.sync.uiInjection($c) as any;
100 }
101 if (page.sync.getMalUrl) {
102 page.sync.getMalUrl = page.sync.getMalUrl($c) as any;
103 }
104
105 if (page.sync.readerConfig) {
106 const temp: mangaProgressConfig[] = [];
107
108 page.sync.readerConfig.forEach(config => {
109 if (typeof config.current === 'function') {
110 const tempConfig: mangaProgressConfig = {
111 current: (config.current as any)($c),
112 total: (config.total as any)($c),
113 };
114 if (config.condition) {
115 tempConfig.condition = (config.condition as any)($c);
116 }
117 temp.push(tempConfig);
118 } else {
119 temp.push(config as mangaProgressConfig);
120 }
121 });
122
123 page.sync.readerConfig = temp;
124 }
125
126 if (page.overview) {
127 page.overview.isOverviewPage = page.overview.isOverviewPage($c) as any;
128 page.overview.getTitle = page.overview.getTitle($c) as any;
129 page.overview.getIdentifier = page.overview.getIdentifier($c) as any;
130 page.overview.uiInjection = page.overview.uiInjection($c) as any;
131 if (page.overview.getImage) {
132 page.overview.getImage = page.overview.getImage($c) as any;
133 }
134 if (page.overview.getMalUrl) {
135 page.overview.getMalUrl = page.overview.getMalUrl($c) as any;
136 }
137 }
138
139 if (page.list) {
140 page.list.elementsSelector = page.list.elementsSelector($c) as any;

Callers 1

chibiPagesFunction · 0.85

Calls 3

getTitleMethod · 0.45
getImageMethod · 0.45
getMalUrlMethod · 0.45

Tested by

no test coverage detected