Create itemHelper
This commit is contained in:
parent
6ad2721831
commit
ea78b4a6b5
48
be/src/itemHelper.ts
Normal file
48
be/src/itemHelper.ts
Normal file
|
@ -0,0 +1,48 @@
|
|||
interface Item {
|
||||
Name: string,
|
||||
ServerId: string,
|
||||
Id: string,
|
||||
HasSubtitles?: boolean,
|
||||
Container: string,
|
||||
PremiereDate: string,
|
||||
CriticRating: number,
|
||||
OfficialRating: string,
|
||||
ChannelId: null,
|
||||
CommunityRating: number,
|
||||
RunTimeTicks: number,
|
||||
ProductionYear: number,
|
||||
ProviderIds: {
|
||||
Tmdb: string,
|
||||
Imdb: string,
|
||||
TmdbCollection?: string,
|
||||
},
|
||||
IsFolder: boolean,
|
||||
Type: "Movie" | "Series",
|
||||
VideoType: string,
|
||||
ImageBlurHashes: {},
|
||||
LocationType: string,
|
||||
MediaType: string,
|
||||
};
|
||||
|
||||
export const transformItems = (items: []) => (
|
||||
items.map((item: Item) => {
|
||||
// omit unnecessary props
|
||||
const {
|
||||
ServerId,
|
||||
Id,
|
||||
Container,
|
||||
PremiereDate,
|
||||
CriticRating,
|
||||
ChannelId,
|
||||
CommunityRating,
|
||||
RunTimeTicks,
|
||||
IsFolder,
|
||||
VideoType,
|
||||
ImageBlurHashes,
|
||||
LocationType,
|
||||
MediaType,
|
||||
...remainingProps
|
||||
} = item;
|
||||
return remainingProps;
|
||||
})
|
||||
);
|
Loading…
Reference in a new issue