pstream is dead; long live pstream taciturnaxolotl.github.io/pstream-ng/
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

simplify advanced search since it was broken

Pas a16c8402 5c9f8eea

+3 -61
+2 -45
src/backend/metadata/search.ts
··· 7 7 getMediaDetails, 8 8 getMediaPoster, 9 9 multiSearch, 10 - searchMovies, 11 - searchTVShows, 12 10 } from "./tmdb"; 13 11 import { TMDBContentTypes } from "./types/tmdb"; 14 12 ··· 24 22 25 23 // detect "tmdb:123456" or "tmdb:123456:movie" or "tmdb:123456:tv" 26 24 const tmdbIdPattern = /^tmdb:(\d+)(?::(movie|tv))?$/i; 27 - 28 - // detect "year:YYYY" 29 - const yearPattern = /(.+?)\s+year:(\d{4})$/i; 30 - 31 - // detect "type:movie" or "type:tv" 32 - const typePattern = /(.+?)\s+type:(movie|tv)$/i; 33 25 34 26 export async function searchForMedia(query: MWQuery): Promise<MediaItem[]> { 35 27 if (cache.has(query)) return cache.get(query) as MediaItem[]; ··· 77 69 } 78 70 } 79 71 80 - // year extract logic 81 - let yearValue: string | undefined; 82 - let queryWithoutYear = searchQuery; 83 - 84 - const yearMatch = searchQuery.match(yearPattern); 85 - if (yearMatch && yearMatch[2]) { 86 - queryWithoutYear = yearMatch[1].trim(); 87 - yearValue = yearMatch[2]; 88 - } 89 - 90 - // type extract logic 91 - let typeValue: string | undefined; 92 - let queryWithoutType = queryWithoutYear; 72 + const data = await multiSearch(searchQuery); 93 73 94 - const typeMatch = queryWithoutYear.match(typePattern); 95 - if (typeMatch && typeMatch[2]) { 96 - queryWithoutType = typeMatch[1].trim(); 97 - typeValue = typeMatch[2].toLowerCase(); 98 - } 99 - 100 - let data: any[]; 101 - if (typeValue === "movie") { 102 - data = await searchMovies(queryWithoutType); 103 - } else if (typeValue === "tv") { 104 - data = await searchTVShows(queryWithoutType); 105 - } else { 106 - data = await multiSearch(queryWithoutType); 107 - } 108 - 109 - let results = data.map((v) => { 74 + const results = data.map((v) => { 110 75 const formattedResult = formatTMDBSearchResult(v, v.media_type); 111 76 return formatTMDBMetaToMediaItem(formattedResult); 112 77 }); 113 - 114 - // filter year 115 - if (yearValue) { 116 - results = results.filter((item) => { 117 - const releaseYear = item.release_date?.getFullYear().toString(); 118 - return releaseYear === yearValue; 119 - }); 120 - } 121 78 122 79 const movieWithPosters = results.filter((movie) => movie.poster); 123 80 const movieWithoutPosters = results.filter((movie) => !movie.poster);
+1 -16
src/components/form/SearchBar.tsx
··· 104 104 {showTooltip && !props.hideTooltip && ( 105 105 <div className="py-4"> 106 106 <p className="font-bold text-sm mb-1 text-search-text"> 107 - Advanced Search: 107 + Search: 108 108 </p> 109 109 <div className="space-y-1.5 text-xs text-search-text"> 110 - <div> 111 - <p className="mb-0.5">Year search:</p> 112 - <p className="text-type-secondary italic pl-2"> 113 - Inception year:2010 114 - </p> 115 - </div> 116 - <div> 117 - <p className="mb-0.5">Type search:</p> 118 - <p className="text-type-secondary italic pl-2"> 119 - Marvel type:movie 120 - </p> 121 - <p className="text-type-secondary italic pl-2"> 122 - Friends type:tv 123 - </p> 124 - </div> 125 110 <div> 126 111 <p className="mb-0.5">TMDB ID search:</p> 127 112 <p className="text-type-secondary italic pl-2">