From 652d2557a4eea803494ba0caa5a3fce73e7da678 Mon Sep 17 00:00:00 2001 From: Kashiwa Date: Sun, 28 Jan 2024 15:07:58 +0800 Subject: [PATCH] Make page index start at 1 --- src/queue.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/queue.ts b/src/queue.ts index 8d5752c..c93012e 100644 --- a/src/queue.ts +++ b/src/queue.ts @@ -178,7 +178,8 @@ export class Queue { private showListByPage(lang: string, page: number, isShowSearchList: boolean = false): string { let content = '```yaml\n'; const pages = isShowSearchList ? Math.ceil(this._searchResult.length / entriesOfOnePage) : this.pages; - content += `page:\t${page}/${Math.max(pages, 1) - 1}\n`; + // when showing the current page, increasing one for the number of current page. + content += `page:\t${page + 1}/${Math.max(pages, 1)}\n`; if (this.isEmpty() || (isShowSearchList && this._searchResult.length === 0)) { content += (messages.playlist_is_empty as langMap)[lang]; }