| 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(); |