MCPcopy Create free account
hub / github.com/MALSync/MALSync / getOrder

Method getOrder

src/_provider/Kitsu/list.ts:78–97  ·  view source on GitHub ↗
(sort)

Source from the content-addressed store, hash-verified

76 }
77
78 getOrder(sort) {
79 let pre = '';
80
81 if (!sort.endsWith('_asc')) pre = '-';
82
83 const sortString = sort.replace('_asc', '');
84 switch (sortString) {
85 case 'alpha':
86 pre = pre ? '' : '-';
87 return `${pre}${this.listType}.titles.en`;
88 case 'updated':
89 return `${pre}progressed_at`;
90 case 'score':
91 return `${pre}rating`;
92 default:
93 if (this.status === definitions.status.Watching) return this.getOrder('updated');
94 if (this.status === definitions.status.PlanToWatch) return this.getOrder('updated');
95 return this.getOrder('alpha');
96 }
97 }
98
99 async getPart() {
100 const userid = await this.getUserId();

Callers 1

getPartMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected