A personal media tracker built on the AT Protocol opnshelf.xyz
0
fork

Configure Feed

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

chore: lint

+27 -28
+3 -1
apps/mobile/app/list/[slug].tsx
··· 108 108 if (item.mediaType === "show") { 109 109 const scoped = parseScopedShowMediaId(item.mediaId); 110 110 const showId = 111 - (item.media as { showId?: string }).showId ?? scoped.showId ?? item.mediaId; 111 + (item.media as { showId?: string }).showId ?? 112 + scoped.showId ?? 113 + item.mediaId; 112 114 if ( 113 115 typeof scoped.seasonNumber === "number" && 114 116 typeof scoped.episodeNumber === "number"
+1 -4
apps/mobile/app/show/[id]/season/[seasonNumber]/index.tsx
··· 103 103 }), 104 104 }); 105 105 const season = seasonData as TmdbSeasonDetailDto | undefined; 106 - const scopedSeasonMediaId = buildScopedShowMediaId( 107 - id, 108 - Number(seasonNumber), 109 - ); 106 + const scopedSeasonMediaId = buildScopedShowMediaId(id, Number(seasonNumber)); 110 107 111 108 const { 112 109 data: history,
+3 -6
apps/web/src/routes/lists.$slug.tsx
··· 295 295 }; 296 296 const mediaType: "movie" | "show" = 297 297 item.mediaType === "show" ? "show" : "movie"; 298 - const scopedShow = mediaType === "show" ? parseScopedShowMediaId(item.mediaId) : null; 298 + const scopedShow = 299 + mediaType === "show" ? parseScopedShowMediaId(item.mediaId) : null; 299 300 const showIdForNav = media.showId ?? scopedShow?.showId ?? item.mediaId; 300 301 const seasonNumber = scopedShow?.seasonNumber; 301 302 const episodeNumber = scopedShow?.episodeNumber; ··· 382 383 )} 383 384 </M3Button> 384 385 </Link> 385 - <Link 386 - to={linkTo as never} 387 - params={linkParams as never} 388 - className="block" 389 - > 386 + <Link to={linkTo as never} params={linkParams as never} className="block"> 390 387 <h3 391 388 className="font-semibold text-sm line-clamp-2 mb-1 transition-colors" 392 389 style={{ color: "var(--md-sys-color-on-surface)" }}
+3 -1
backend/src/lists/dto/list.dto.ts
··· 83 83 @ApiProperty() 84 84 mediaId: string; 85 85 86 - @ApiPropertyOptional({ description: "Season number for season/episode show items" }) 86 + @ApiPropertyOptional({ 87 + description: "Season number for season/episode show items", 88 + }) 87 89 seasonNumber?: number; 88 90 89 91 @ApiPropertyOptional({ description: "Episode number for episode show items" })
+17 -16
backend/src/lists/lists.service.ts
··· 110 110 where: { userDid }, 111 111 orderBy: [{ isDefault: "desc" }, { createdAt: "asc" }], 112 112 include: { 113 - items: { where: { mediaType, mediaId: scopedMediaId }, select: { id: true } }, 113 + items: { 114 + where: { mediaType, mediaId: scopedMediaId }, 115 + select: { id: true }, 116 + }, 114 117 }, 115 118 }); 116 119 ··· 413 416 const movieData = await this.moviesService.getMovieDetails(dto.mediaId); 414 417 await this.moviesService.upsertMovie(movieData); 415 418 } else { 416 - const showData = await this.showsService.getShowDetails(showScope?.showId ?? dto.mediaId); 419 + const showData = await this.showsService.getShowDetails( 420 + showScope?.showId ?? dto.mediaId, 421 + ); 417 422 await this.showsService.upsertShow(showData); 418 423 } 419 424 ··· 454 459 mediaType: dto.mediaType, 455 460 mediaId: scopedMediaId, 456 461 movieId: dto.mediaType === "movie" ? dto.mediaId : null, 457 - showId: dto.mediaType === "show" ? (showScope?.showId ?? dto.mediaId) : null, 462 + showId: 463 + dto.mediaType === "show" ? (showScope?.showId ?? dto.mediaId) : null, 458 464 notes: dto.notes, 459 465 position: itemCount, 460 466 }, ··· 617 623 movieId: record.mediaType === "movie" ? record.mediaId : null, 618 624 showId: 619 625 record.mediaType === "show" 620 - ? (this.parseScopedShowMediaId(record.mediaId)?.showId ?? record.mediaId) 626 + ? (this.parseScopedShowMediaId(record.mediaId)?.showId ?? 627 + record.mediaId) 621 628 : null, 622 629 notes: record.notes, 623 630 }, ··· 628 635 movieId: record.mediaType === "movie" ? record.mediaId : null, 629 636 showId: 630 637 record.mediaType === "show" 631 - ? (this.parseScopedShowMediaId(record.mediaId)?.showId ?? record.mediaId) 638 + ? (this.parseScopedShowMediaId(record.mediaId)?.showId ?? 639 + record.mediaId) 632 640 : null, 633 641 notes: record.notes, 634 642 }, ··· 747 755 : undefined; 748 756 const baseMediaId = 749 757 item.mediaType === "show" 750 - ? parsedShowScope?.showId ?? item.mediaId 758 + ? (parsedShowScope?.showId ?? item.mediaId) 751 759 : item.mediaId; 752 760 const mediaTitle = 753 761 item.mediaType === "movie" ? item.movie?.title : item.show?.title; ··· 826 834 } 827 835 828 836 if (typeof seasonNumber === "number" && Number.isFinite(seasonNumber)) { 829 - if ( 830 - typeof episodeNumber === "number" && 831 - Number.isFinite(episodeNumber) 832 - ) { 837 + if (typeof episodeNumber === "number" && Number.isFinite(episodeNumber)) { 833 838 return `${mediaId}:season:${seasonNumber}:episode:${episodeNumber}`; 834 839 } 835 840 return `${mediaId}:season:${seasonNumber}`; ··· 838 843 return mediaId; 839 844 } 840 845 841 - private parseScopedShowMediaId( 842 - mediaId: string, 843 - ): 846 + private parseScopedShowMediaId(mediaId: string): 844 847 | { 845 848 showId: string; 846 849 seasonNumber?: number; 847 850 episodeNumber?: number; 848 851 } 849 852 | undefined { 850 - const episodeMatch = mediaId.match( 851 - /^([^:]+):season:(\d+):episode:(\d+)$/, 852 - ); 853 + const episodeMatch = mediaId.match(/^([^:]+):season:(\d+):episode:(\d+)$/); 853 854 if (episodeMatch) { 854 855 return { 855 856 showId: episodeMatch[1],