MCPcopy Index your code
hub / github.com/MALSync/MALSync / search

Method search

src/_provider/Search/searchClass.ts:151–177  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

149 }
150
151 public async search() {
152 this.state = await this.getCache();
153
154 if (!this.state) {
155 this.state = await this.searchLocal();
156 }
157
158 if (!this.state) {
159 this.state = await this.searchForIt();
160 }
161
162 if (
163 !this.state ||
164 (this.state && !['user', 'firebase', 'sync', 'local'].includes(this.state.provider))
165 ) {
166 const tempRes = await this.onsiteSearch();
167 if (tempRes) this.state = tempRes;
168 }
169
170 if (this.state) {
171 await this.setCache(this.state);
172 }
173
174 this.logger.log('Result', this.state);
175
176 return this.state;
177 }
178
179 protected async getCache() {
180 return api.storage.get(`${this.page.name}/${this.identifier}/Search`).then(state => {

Callers 4

searchFunction · 0.80
searchFunction · 0.80
handlePageMethod · 0.80

Calls 5

getCacheMethod · 0.95
searchLocalMethod · 0.95
searchForItMethod · 0.95
onsiteSearchMethod · 0.95
setCacheMethod · 0.95

Tested by

no test coverage detected