A self hosted solution for privately rating and reviewing different sorts of media
0
fork

Configure Feed

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

at master 22 lines 583 B view raw
1import { Entry, EntryTranslation, User } from '@prisma/client'; 2 3export const getUserTitleFromEntry = ( 4 entry: Entry & { translations: EntryTranslation[] } 5) => { 6 return entry.translations.length !== 0 7 ? entry.translations[0]!.name 8 : entry.originalTitle; 9}; 10 11export const getDefaultWhereForTranslations = ( 12 authUser: { showMediaMetaInId: number | null } | null 13) => { 14 return { 15 where: { 16 language: { 17 id: authUser?.showMediaMetaInId ?? undefined, 18 iso_639_1: !authUser || !authUser?.showMediaMetaInId ? 'en' : undefined, 19 }, 20 }, 21 }; 22};