MCPcopy Create free account
hub / github.com/Maintainerr/Maintainerr / createCollection

Function createCollection

apps/server/test/utils/data.ts:48–97  ·  view source on GitHub ↗
(
  properties: Partial<Collection> = {},
)

Source from the content-addressed store, hash-verified

46import { RulesDto } from '../../src/modules/rules/dtos/rules.dto';
47
48export const createCollection = (
49 properties: Partial<Collection> = {},
50): Collection => {
51 return {
52 id: faker.number.int(),
53 title: faker.string.sample(10),
54 description: '',
55 isActive: true,
56 arrAction: ServarrAction.DELETE,
57 type: faker.helpers.arrayElement([
58 'movie',
59 'episode',
60 'season',
61 'show',
62 ] as MediaItemType[]),
63 libraryId: faker.number.int().toString(),
64 mediaServerId: faker.number.int().toString(),
65 mediaServerType: MediaServerType.PLEX,
66 addDate: faker.date.past(),
67 collectionLog: [],
68 collectionMedia: [],
69 deleteAfterDays: 30,
70 forceSeerr: false,
71 handledMediaAmount: 0,
72 keepLogsForMonths: 6,
73 lastDurationInSeconds: 0,
74 manualCollection: false,
75 manualCollectionName: undefined,
76 radarrSettings: undefined,
77 radarrSettingsId: undefined,
78 radarrQualityProfileId: undefined,
79 sonarrSettings: undefined,
80 sonarrSettingsId: undefined,
81 sonarrQualityProfileId: undefined,
82 tagInArr: false,
83 listExclusions: false,
84 ruleGroup: undefined,
85 visibleOnHome: false,
86 visibleOnRecommended: false,
87 overlayEnabled: false,
88 tautulliWatchedPercentOverride: undefined,
89 sortTitle: undefined,
90 totalSizeBytes: null,
91 handledMediaSizeBytes: 0,
92 overlayTemplateId: null,
93 overlayTemplate: null,
94 mediaServerSort: null,
95 ...properties,
96 };
97};
98
99export const createCollectionMedia = (
100 collectionOrType?: Collection | MediaItemType,

Calls 1

toStringMethod · 0.80

Tested by 2

runSeasonDeleteFunction · 0.72
runEpisodeDeleteFunction · 0.72