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.

bookmark entire collection as a group

Pas abd661e8 c3d653ce

+49 -8
+49 -8
src/components/overlays/detailsModal/components/overlays/CollectionOverlay.tsx
··· 9 9 import { Flare } from "@/components/utils/Flare"; 10 10 import { useIsMobile } from "@/hooks/useIsMobile"; 11 11 import { CarouselNavButtons } from "@/pages/discover/components/CarouselNavButtons"; 12 + import { useBookmarkStore } from "@/stores/bookmarks"; 12 13 import { useOverlayStack } from "@/stores/interface/overlayStack"; 13 14 import { MediaItem } from "@/utils/mediaTypes"; 14 15 ··· 109 110 }: CollectionOverlayProps) { 110 111 const { t } = useTranslation(); 111 112 const { showModal } = useOverlayStack(); 113 + const addBookmarkWithGroups = useBookmarkStore( 114 + (s) => s.addBookmarkWithGroups, 115 + ); 112 116 const [collection, setCollection] = useState<CollectionData | null>(null); 113 117 const [loading, setLoading] = useState(true); 114 118 const [error, setError] = useState<string | null>(null); ··· 161 165 }; 162 166 }; 163 167 168 + const handleBookmarkCollection = () => { 169 + if (!collection?.parts) return; 170 + 171 + collection.parts.forEach((movie) => { 172 + const year = movie.release_date 173 + ? new Date(movie.release_date).getFullYear() 174 + : undefined; 175 + 176 + // Skip movies without a release year 177 + if (year === undefined) return; 178 + 179 + const meta = { 180 + tmdbId: movie.id.toString(), 181 + type: "movie" as const, 182 + title: movie.title, 183 + releaseYear: year, 184 + poster: getMediaPoster(movie.poster_path) || "/placeholder.png", 185 + }; 186 + 187 + addBookmarkWithGroups(meta, [collectionName]); 188 + }); 189 + }; 190 + 164 191 const handleShowDetails = (media: MediaItem) => { 165 192 // Show details modal and close collection overlay 166 193 showModal("details", { ··· 203 230 </h2> 204 231 <div className="flex items-center gap-4 flex-wrap"> 205 232 {collection && ( 206 - <p className="text-sm text-white/80"> 207 - <span className="text-white font-semibold"> 208 - {collection.parts.length} 209 - </span>{" "} 210 - {collection.parts.length > 1 211 - ? t("details.collection.movies") 212 - : t("details.collection.movie")} 213 - </p> 233 + <> 234 + <p className="text-sm text-white/80"> 235 + <span className="text-white font-semibold"> 236 + {collection.parts.length} 237 + </span>{" "} 238 + {collection.parts.length > 1 239 + ? t("details.collection.movies") 240 + : t("details.collection.movie")} 241 + </p> 242 + <button 243 + type="button" 244 + onClick={handleBookmarkCollection} 245 + className="flex items-center gap-2 px-3 py-1 rounded-md text-xs font-medium bg-white/10 hover:bg-white/20 text-white/70 transition-colors" 246 + title={`Bookmark entire ${collectionName} collection`} 247 + > 248 + <Icon 249 + icon={Icons.BOOKMARK_OUTLINE} 250 + className="text-xs" 251 + /> 252 + <span>Bookmark All</span> 253 + </button> 254 + </> 214 255 )} 215 256 {!loading && !error && sortedMovies.length > 1 && ( 216 257 <div className="flex items-center gap-2">