File tree Expand file tree Collapse file tree 3 files changed +17
-15
lines changed Expand file tree Collapse file tree 3 files changed +17
-15
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ export function registerCli(
4040 const lib = await anime . library ( ) ;
4141
4242 for ( const { video, resource } of videos ) {
43- const detailURL = `https://animes.garden/api/ detail/${ resource . provider } /${ resource . providerId } ` ;
43+ const detailURL = `https://animes.garden/detail/${ resource . provider } /${ resource . providerId } ` ;
4444
4545 let extra = '' ;
4646 if ( ! lib . videos . find ( ( v ) => v . source . magnet === video . source . magnet ! ) ) {
Original file line number Diff line number Diff line change @@ -5,14 +5,11 @@ import width from 'string-width';
55import { Anime } from '@animespace/core' ;
66import { dim , link , underline } from '@breadc/color' ;
77
8- import { DOT } from './constant' ;
9-
108export function formatAnimeGardenSearchURL ( anime : Anime ) {
11- return `https://animes.garden/resources/1?include=${ encodeURIComponent (
12- JSON . stringify ( anime . plan . keywords . include )
13- ) } &exclude=${ encodeURIComponent (
14- JSON . stringify ( anime . plan . keywords . exclude )
15- ) } &after=${ encodeURIComponent ( anime . plan . date . toISOString ( ) ) } `;
9+ const include = anime . plan . keywords . include . map ( ( v ) => 'include=' + v ) ;
10+ const exclude = anime . plan . keywords . exclude . map ( ( v ) => 'exclude=' + v ) ;
11+
12+ return `https://animes.garden/resources/1?${ include . join ( '&' ) } &${ exclude . join ( '&' ) } &after=${ encodeURIComponent ( anime . plan . date . toISOString ( ) ) } ` ;
1613}
1714
1815export function printKeywords ( anime : Anime , logger : ConsolaInstance ) {
Original file line number Diff line number Diff line change @@ -109,14 +109,19 @@ export async function generatePlan(
109109 }
110110 }
111111
112- const includeURL = JSON . stringify ( [ [ title , ...translations ] ] )
113- . replace ( / \[ / g, '%5B' )
114- . replace ( / \] / g, '%5D' )
115- . replace ( / , / g, '%2C' )
116- . replace ( / " / g, '%22' )
117- . replace ( / / g, '%20' ) ;
112+ const includeURL = [ title , ...translations ]
113+ . map ( ( t ) =>
114+ t
115+ . replace ( / \[ / g, '%5B' )
116+ . replace ( / \] / g, '%5D' )
117+ . replace ( / , / g, '%2C' )
118+ . replace ( / " / g, '%22' )
119+ . replace ( / / g, '%20' )
120+ )
121+ . map ( ( v ) => 'include=' + v ) ;
122+
118123 writeln (
119- ` # https://animes.garden/resources/1?include= ${ includeURL } &after=${ encodeURIComponent (
124+ ` # https://animes.garden/resources/1?${ includeURL . join ( '&' ) } &after=${ encodeURIComponent (
120125 date . toISOString ( )
121126 ) } `
122127 ) ;
You can’t perform that action at this time.
0 commit comments