diff --git a/lib/routes/ajmide/index.ts b/lib/routes/ajmide/index.ts index 6c24803c72..6f13ece4b2 100644 --- a/lib/routes/ajmide/index.ts +++ b/lib/routes/ajmide/index.ts @@ -1,10 +1,11 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; export const route: Route = { path: '/:id', - categories: ['multimedia'], + categories: ['multimedia', 'popular'], + view: ViewType.Audios, example: '/ajmide/10603594', parameters: { id: '播客 id,可以从播客页面 URL 中找到' }, features: { diff --git a/lib/routes/bjp/apod.ts b/lib/routes/bjp/apod.ts index 9f909c12a0..8258b102c4 100644 --- a/lib/routes/bjp/apod.ts +++ b/lib/routes/bjp/apod.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import cache from '@/utils/cache'; import { load } from 'cheerio'; import got from '@/utils/got'; @@ -7,7 +7,8 @@ import timezone from '@/utils/timezone'; export const route: Route = { path: '/apod', - categories: ['picture'], + categories: ['picture', 'popular'], + view: ViewType.Pictures, example: '/bjp/apod', parameters: {}, features: { diff --git a/lib/routes/fantia/search.ts b/lib/routes/fantia/search.ts index ee65b51b9d..79db7f755d 100644 --- a/lib/routes/fantia/search.ts +++ b/lib/routes/fantia/search.ts @@ -1,18 +1,82 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; export const route: Route = { path: '/search/:type?/:caty?/:period?/:order?/:rating?/:keyword?', - categories: ['picture'], + categories: ['picture', 'popular'], + view: ViewType.Pictures, example: '/fantia/search/posts/all/daily', parameters: { - type: 'Type, see the table below, `posts` by default', - caty: 'Category, see the table below, can also be found in search page URL, `すべてのクリエイター` by default', - period: 'Ranking period, see the table below, empty by default', - order: 'Sorting, see the table below, `更新の新しい順` by default', - rating: 'Rating, see the table below, `すべて` by default', + type: { + description: 'Type, see the table below, `posts` by default', + options: [ + { value: 'fanclubs', label: 'クリエイター' }, + { value: 'posts', label: '投稿' }, + { value: 'products', label: '商品' }, + { value: 'commissions', label: 'コミッション' }, + ], + default: 'posts', + }, + caty: { + description: 'Category, see the table below, can also be found in search page URL, `すべてのクリエイター` by default', + options: [ + { value: 'all', label: 'すべてのクリエイター' }, + { value: 'illust', label: 'イラスト' }, + { value: 'comic', label: '漫画' }, + { value: 'cosplay', label: 'コスプレ' }, + { value: 'youtuber', label: 'YouTuber・配信者' }, + { value: 'vtuber', label: 'Vtuber' }, + { value: 'voice', label: '音声作品・ASMR' }, + { value: 'voiceactor', label: '声優・歌い手' }, + { value: 'idol', label: 'アイドル' }, + { value: 'anime', label: 'アニメ・映像・写真' }, + { value: '3d', label: '3D' }, + { value: 'game', label: 'ゲーム制作' }, + { value: 'music', label: '音楽' }, + { value: 'novel', label: '小説' }, + { value: 'doll', label: 'ドール' }, + { value: 'art', label: 'アート・デザイン' }, + { value: 'program', label: 'プログラム' }, + { value: 'handmade', label: '創作・ハンドメイド' }, + { value: 'history', label: '歴史・評論・情報' }, + { value: 'railroad', label: '鉄道・旅行・ミリタリー' }, + { value: 'shop', label: 'ショップ' }, + { value: 'other', label: 'その他' }, + ], + default: 'all', + }, + period: { + description: 'Ranking period, see the table below, empty by default', + options: [ + { value: 'daily', label: 'デイリー' }, + { value: 'weekly', label: 'ウィークリー' }, + { value: 'monthly', label: 'マンスリー' }, + { value: 'all', label: '全期間' }, + ], + default: '', + }, + order: { + description: 'Sorting, see the table below, `更新の新しい順` by default', + options: [ + { value: 'updater', label: '更新の新しい順' }, + { value: 'update_old', label: '更新の古い順' }, + { value: 'newer', label: '投稿の新しい順' }, + { value: 'create_old', label: '投稿の古い順' }, + { value: 'popular', label: 'お気に入り数順' }, + ], + default: 'updater', + }, + rating: { + description: 'Rating, see the table below, `すべて` by default', + options: [ + { value: 'all', label: 'すべて' }, + { value: 'general', label: '一般のみ' }, + { value: 'adult', label: 'R18 のみ' }, + ], + default: 'all', + }, keyword: 'Keyword, empty by default', }, features: { @@ -24,7 +88,7 @@ export const route: Route = { supportScihub: false, }, name: 'Search', - maintainers: [], + maintainers: ['nczitzk'], handler, description: `Type diff --git a/lib/routes/fantia/user.ts b/lib/routes/fantia/user.ts index 826feabe83..0db26a4f15 100644 --- a/lib/routes/fantia/user.ts +++ b/lib/routes/fantia/user.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; @@ -6,7 +6,8 @@ import { config } from '@/config'; export const route: Route = { path: '/user/:id', - categories: ['picture'], + categories: ['picture', 'popular'], + view: ViewType.Pictures, example: '/fantia/user/3498', parameters: { id: 'User id, can be found in user profile URL' }, features: { diff --git a/lib/routes/google/doodles.ts b/lib/routes/google/doodles.ts index 27d9ecbc65..79e7822c8e 100644 --- a/lib/routes/google/doodles.ts +++ b/lib/routes/google/doodles.ts @@ -1,9 +1,10 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import got from '@/utils/got'; export const route: Route = { path: '/doodles/:language?', - categories: ['picture'], + categories: ['picture', 'popular'], + view: ViewType.Pictures, example: '/google/doodles/zh-CN', parameters: { language: 'Language, default to `zh-CN`, for other language values, you can get it from [Google Doodles official website](https://www.google.com/doodles)' }, features: { diff --git a/lib/routes/imdb/chart.ts b/lib/routes/imdb/chart.ts index 0c935de309..4d1611280c 100644 --- a/lib/routes/imdb/chart.ts +++ b/lib/routes/imdb/chart.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import ofetch from '@/utils/ofetch'; import * as cheerio from 'cheerio'; import type { Context } from 'hono'; @@ -12,8 +12,20 @@ const render = (data) => art(path.join(__dirname, 'templates', 'chart.art'), dat export const route: Route = { path: '/chart/:chart?', - categories: ['multimedia'], - parameters: { chart: 'The chart to display, `top` by default' }, + categories: ['multimedia', 'popular'], + view: ViewType.Notifications, + parameters: { + chart: { + description: 'The chart to display, `top` by default', + options: [ + { value: 'top', label: 'Top 250 Movies' }, + { value: 'moviemeter', label: 'Most Popular Movies' }, + { value: 'toptv', label: 'Top 250 TV Shows' }, + { value: 'tvmeter', label: 'Most Popular TV Shows' }, + ], + default: 'top', + }, + }, example: '/imdb/chart', radar: [ { diff --git a/lib/routes/konachan/post.ts b/lib/routes/konachan/post.ts index 6540c02e24..b05197e61a 100644 --- a/lib/routes/konachan/post.ts +++ b/lib/routes/konachan/post.ts @@ -1,13 +1,23 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import got from '@/utils/got'; import queryString from 'query-string'; export const route: Route = { path: '/post/popular_recent/:period?', - categories: ['picture'], + categories: ['picture', 'popular'], + view: ViewType.Pictures, example: '/konachan/post/popular_recent/1d', parameters: { - period: '展示时间', + period: { + description: '展示时间', + options: [ + { value: '1d', label: '最近 24 小时' }, + { value: '1w', label: '最近一周' }, + { value: '1m', label: '最近一月' }, + { value: '1y', label: '最近一年' }, + ], + default: '1d', + }, }, radar: [ { diff --git a/lib/routes/magnumphotos/magazine.ts b/lib/routes/magnumphotos/magazine.ts index 6ca90ef7c8..3afaee8302 100644 --- a/lib/routes/magnumphotos/magazine.ts +++ b/lib/routes/magnumphotos/magazine.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import cache from '@/utils/cache'; import parser from '@/utils/rss-parser'; import ofetch from '@/utils/ofetch'; @@ -6,7 +6,8 @@ import { load } from 'cheerio'; const host = 'https://www.magnumphotos.com'; export const route: Route = { path: '/magazine', - categories: ['picture'], + categories: ['picture', 'popular'], + view: ViewType.Pictures, example: '/magnumphotos/magazine', parameters: {}, features: { diff --git a/lib/routes/pixabay/search.ts b/lib/routes/pixabay/search.ts index 6e0a378f3b..199287609d 100644 --- a/lib/routes/pixabay/search.ts +++ b/lib/routes/pixabay/search.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); @@ -10,9 +10,20 @@ import path from 'node:path'; export const route: Route = { path: '/search/:q/:order?', - categories: ['picture'], + categories: ['picture', 'popular'], + view: ViewType.Pictures, example: '/pixabay/search/cat', - parameters: { q: 'Search term', order: 'Order, `popular` or `latest`, `latest` by default' }, + parameters: { + q: 'Search term', + order: { + description: 'Order', + options: [ + { value: 'popular', label: 'popular' }, + { value: 'latest', label: 'latest' }, + ], + default: 'latest', + }, + }, features: { requireConfig: [ { diff --git a/lib/routes/podwise/collections.ts b/lib/routes/podwise/collections.ts index 438ab1adba..77de1718e5 100644 --- a/lib/routes/podwise/collections.ts +++ b/lib/routes/podwise/collections.ts @@ -1,10 +1,11 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import { load } from 'cheerio'; import ofetch from '@/utils/ofetch'; // 统一使用的请求库 export const route: Route = { path: '/explore', - categories: ['multimedia'], + categories: ['multimedia', 'popular'], + view: ViewType.Audios, example: '/podwise/explore', radar: [ { diff --git a/lib/routes/themoviedb/seasons.ts b/lib/routes/themoviedb/seasons.ts index 0de7c81956..b5e82f5009 100644 --- a/lib/routes/themoviedb/seasons.ts +++ b/lib/routes/themoviedb/seasons.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import apiKey from './api-key'; @@ -6,7 +6,8 @@ import { handleDescription } from './utils'; export const route: Route = { path: '/tv/:id/seasons/:lang?', - categories: ['multimedia'], + categories: ['multimedia', 'popular'], + view: ViewType.Notifications, example: '/themoviedb/tv/70593/seasons/en-US', parameters: { id: 'TV show ID', lang: 'Language' }, features: { diff --git a/lib/routes/tingtingfm/program.ts b/lib/routes/tingtingfm/program.ts index d39fcdeb66..d6cb883a7c 100644 --- a/lib/routes/tingtingfm/program.ts +++ b/lib/routes/tingtingfm/program.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); @@ -12,7 +12,8 @@ import { getClientVal, sign } from './utils'; export const route: Route = { path: '/program/:programId', - categories: ['multimedia'], + categories: ['multimedia', 'popular'], + view: ViewType.Audios, example: '/tingtingfm/program/M7VJv6Jj4R', parameters: { programId: '节目 ID,可以在 URL 中找到' }, features: { diff --git a/lib/routes/voronoiapp/common.ts b/lib/routes/voronoiapp/common.ts index 9b14bc9b03..7bffb78a12 100644 --- a/lib/routes/voronoiapp/common.ts +++ b/lib/routes/voronoiapp/common.ts @@ -234,7 +234,7 @@ export const TabParam = { export const CommonRouteProperties: Pick = { url: 'voronoiapp.com', - categories: ['picture'], + categories: ['picture', 'popular'], view: ViewType.Pictures, maintainers: ['Cesaryuan'], }; diff --git a/lib/routes/yyets/article.ts b/lib/routes/yyets/article.ts index aa23e9e015..716fb86378 100644 --- a/lib/routes/yyets/article.ts +++ b/lib/routes/yyets/article.ts @@ -1,4 +1,4 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; @@ -9,9 +9,24 @@ const baseURL = 'https://yysub.net'; export const route: Route = { path: '/article/:type?', - categories: ['multimedia'], + categories: ['multimedia', 'popular'], + view: ViewType.Articles, example: '/yyets/article', - parameters: { type: '[' }, + parameters: { + type: { + description: '类型', + options: [ + { value: 'all', label: '全部' }, + { value: 'news', label: '影视资讯' }, + { value: 'report', label: '收视快报' }, + { value: 'm_review', label: '人人影评' }, + { value: 't_review', label: '人人剧评' }, + { value: 'new_review', label: '新剧评测' }, + { value: 'recom', label: '片单推荐' }, + ], + default: 'all', + }, + }, features: { requireConfig: false, requirePuppeteer: false, diff --git a/lib/routes/yyets/today.ts b/lib/routes/yyets/today.ts index 0bd05556ba..1602febfcc 100644 --- a/lib/routes/yyets/today.ts +++ b/lib/routes/yyets/today.ts @@ -1,10 +1,11 @@ -import { Route } from '@/types'; +import { Route, ViewType } from '@/types'; import got from '@/utils/got'; import { load } from 'cheerio'; export const route: Route = { path: '/today', - categories: ['multimedia'], + categories: ['multimedia', 'popular'], + view: ViewType.Notifications, example: '/yyets/today', parameters: {}, features: {