podverse-parser 5.0.0-beta.2 → 5.0.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/package.json +4 -1
  2. package/.nvmrc +0 -1
  3. package/eslint.config.mjs +0 -38
  4. package/src/index.ts +0 -3
  5. package/src/lib/chapters/chapters.ts +0 -54
  6. package/src/lib/compat/channel.ts +0 -287
  7. package/src/lib/compat/chapters/chapters.ts +0 -23
  8. package/src/lib/compat/partytime/channel.ts +0 -289
  9. package/src/lib/compat/partytime/compatFull.ts +0 -7
  10. package/src/lib/compat/partytime/funding.ts +0 -8
  11. package/src/lib/compat/partytime/item.ts +0 -273
  12. package/src/lib/compat/partytime/liveItem.ts +0 -18
  13. package/src/lib/compat/partytime/value.ts +0 -64
  14. package/src/lib/rss/base/handleParsedManyData.ts +0 -16
  15. package/src/lib/rss/base/handleParsedOneData.ts +0 -17
  16. package/src/lib/rss/channel/channel.ts +0 -55
  17. package/src/lib/rss/channel/channelAbout.ts +0 -13
  18. package/src/lib/rss/channel/channelChat.ts +0 -14
  19. package/src/lib/rss/channel/channelDescription.ts +0 -14
  20. package/src/lib/rss/channel/channelFunding.ts +0 -14
  21. package/src/lib/rss/channel/channelImage.ts +0 -14
  22. package/src/lib/rss/channel/channelLicense.ts +0 -14
  23. package/src/lib/rss/channel/channelLocation.ts +0 -14
  24. package/src/lib/rss/channel/channelPerson.ts +0 -14
  25. package/src/lib/rss/channel/channelPodroll.ts +0 -21
  26. package/src/lib/rss/channel/channelRemoteItem.ts +0 -14
  27. package/src/lib/rss/channel/channelSeason.ts +0 -14
  28. package/src/lib/rss/channel/channelSocialInteract.ts +0 -14
  29. package/src/lib/rss/channel/channelTrailer.ts +0 -31
  30. package/src/lib/rss/channel/channelTxt.ts +0 -14
  31. package/src/lib/rss/channel/channelValue.ts +0 -30
  32. package/src/lib/rss/feed/feed.ts +0 -79
  33. package/src/lib/rss/hash/parsedFeed.ts +0 -9
  34. package/src/lib/rss/item/item.ts +0 -85
  35. package/src/lib/rss/item/itemAbout.ts +0 -13
  36. package/src/lib/rss/item/itemChaptersFeed.ts +0 -14
  37. package/src/lib/rss/item/itemChat.ts +0 -14
  38. package/src/lib/rss/item/itemContentLink.ts +0 -0
  39. package/src/lib/rss/item/itemDescription.ts +0 -14
  40. package/src/lib/rss/item/itemEnclosure.ts +0 -35
  41. package/src/lib/rss/item/itemImage.ts +0 -14
  42. package/src/lib/rss/item/itemLicense.ts +0 -14
  43. package/src/lib/rss/item/itemLocation.ts +0 -14
  44. package/src/lib/rss/item/itemPerson.ts +0 -14
  45. package/src/lib/rss/item/itemSeason.ts +0 -26
  46. package/src/lib/rss/item/itemSeasonEpisode.ts +0 -14
  47. package/src/lib/rss/item/itemSocialInteract.ts +0 -14
  48. package/src/lib/rss/item/itemSoundbite.ts +0 -14
  49. package/src/lib/rss/item/itemTranscript.ts +0 -14
  50. package/src/lib/rss/item/itemTxt.ts +0 -14
  51. package/src/lib/rss/item/itemValue.ts +0 -60
  52. package/src/lib/rss/liveItem/liveItem.ts +0 -34
  53. package/src/lib/rss/parser.ts +0 -85
  54. package/src/module-alias-config.ts +0 -8
  55. package/tsconfig.json +0 -25
@@ -1,7 +0,0 @@
1
- export const convertParsedRSSFeedToCompat = () => {
2
- return {
3
- channel: {},
4
- items: [],
5
- liveItems: []
6
- };
7
- };
@@ -1,8 +0,0 @@
1
- import { Phase1Funding } from "podcast-partytime";
2
-
3
- export const fundingCompat = (funding: Phase1Funding) => {
4
- return {
5
- value: funding.message,
6
- url: funding.url
7
- };
8
- };
@@ -1,273 +0,0 @@
1
- import type { Episode } from 'podcast-partytime';
2
- import { Phase4PodcastImage } from 'podcast-partytime/dist/parser/phase/phase-4';
3
- import { getItemItunesEpisodeTypeEnumValue } from 'podverse-orm';
4
- import { compatItemValue } from './value';
5
-
6
- export const compatItemDto = (parsedItem: Episode) => ({
7
- guid: parsedItem.guid || null,
8
- guid_enclosure_url: parsedItem.enclosure.url,
9
- pubdate: parsedItem.pubDate || null,
10
- title: parsedItem.title || null
11
- });
12
-
13
- export const compatItemAboutDto = (parsedItem: Episode) => ({
14
- duration: parsedItem.duration?.toFixed(2) || null,
15
- explicit: parsedItem.explicit || false,
16
- website_link_url: parsedItem.link || null,
17
- item_itunes_episode_type: getItemItunesEpisodeTypeEnumValue(parsedItem.itunesEpisodeType || 'full')
18
- });
19
-
20
- export const compatItemChaptersFeedDto = (parsedItem: Episode) => {
21
- if (!parsedItem.podcastChapters?.url && !parsedItem.podcastChapters?.type) return null;
22
-
23
- return {
24
- url: parsedItem.podcastChapters?.url,
25
- type: parsedItem.podcastChapters?.type
26
- };
27
- };
28
-
29
- export const compatItemChatDto = (parsedItem: Episode) => {
30
- if (!parsedItem.chat) {
31
- return null;
32
- }
33
- return {
34
- server: parsedItem.chat.server,
35
- protocol: parsedItem.chat.protocol,
36
- account_id: parsedItem.chat.accountId || null,
37
- space: parsedItem.chat.space || null
38
- };
39
- };
40
-
41
- export const compatItemDescriptionDto = (parsedItem: Episode) => {
42
- if (!parsedItem.description) {
43
- return null;
44
- }
45
- return {
46
- value: parsedItem.description
47
- };
48
- };
49
-
50
- export const compatItemEnclosureDtos = (parsedItem: Episode) => {
51
- const dtos = [];
52
-
53
- if (parsedItem.alternativeEnclosures && parsedItem.alternativeEnclosures.length > 0) {
54
- for (const alternativeEnclosure of parsedItem.alternativeEnclosures) {
55
- const item_enclosure = {
56
- type: alternativeEnclosure.type,
57
- length: alternativeEnclosure.length || null,
58
- bitrate: alternativeEnclosure.bitrate || null,
59
- height: alternativeEnclosure.height || null,
60
- language: alternativeEnclosure.lang || null,
61
- title: alternativeEnclosure.title || null,
62
- rel: alternativeEnclosure.rel || null,
63
- codecs: alternativeEnclosure.codecs || null,
64
- item_enclosure_default: false
65
- };
66
-
67
- /*
68
- PTDO: why am I getting this error when I don't use any?
69
- src/lib/compat/partytime/item.ts:50:14 - error TS4023: Exported variable
70
- 'compatItemEnclosureDtos' has or is using name 'IntegrityType' from external module
71
- "/podverse-parser/node_modules/podcast-partytime/dist/parser/phase/phase-3" but cannot be named.
72
- */
73
- const item_enclosure_integrity = (alternativeEnclosure.integrity as any) || null;
74
-
75
- const item_enclosure_sources = alternativeEnclosure.source.map(source => ({
76
- uri: source.uri,
77
- content_type: source.contentType
78
- }));
79
-
80
- const formattedDto = {
81
- item_enclosure,
82
- item_enclosure_integrity,
83
- item_enclosure_sources
84
- };
85
-
86
- dtos.push(formattedDto);
87
- }
88
- }
89
-
90
- return dtos;
91
- };
92
-
93
- export const compatItemImageDtos = (parsedItem: Episode) => {
94
- const dtos = [];
95
- if (parsedItem.itunesImage) {
96
- dtos.push({
97
- url: parsedItem.itunesImage,
98
- image_width_size: null
99
- });
100
- } else if (parsedItem.image) {
101
- dtos.push({
102
- url: parsedItem.image,
103
- image_width_size: null
104
- });
105
- }
106
-
107
- function hasWidth(image: Phase4PodcastImage['parsed']): image is { url: string; width: number } {
108
- return (image as { width: number }).width !== undefined;
109
- }
110
-
111
- if (Array.isArray(parsedItem.podcastImages)) {
112
- for (const image of parsedItem.podcastImages) {
113
- if (image.parsed.url && hasWidth(image.parsed)) {
114
- dtos.push({
115
- url: image.parsed.url,
116
- image_width_size: image.parsed.width
117
- });
118
- }
119
- }
120
- }
121
-
122
- return dtos;
123
- };
124
-
125
- export const compatItemLicenseDto = (parsedItem: Episode) => {
126
- if (!parsedItem?.license?.identifier) {
127
- return null;
128
- }
129
- return {
130
- identifier: parsedItem.license.identifier,
131
- url: parsedItem.license.url || null
132
- };
133
- };
134
-
135
- export const compatItemLocationDto = (parsedItem: Episode) => {
136
- if (!parsedItem?.podcastLocation?.geo && !parsedItem?.podcastLocation?.osm) {
137
- return null;
138
- }
139
-
140
- return {
141
- geo: parsedItem.podcastLocation.geo || null,
142
- osm: parsedItem.podcastLocation.osm || null,
143
- name: parsedItem.podcastLocation.name || null
144
- };
145
- };
146
-
147
- export const compatItemPersonDtos = (parsedItem: Episode) => {
148
- const dtos = [];
149
-
150
- if (Array.isArray(parsedItem.podcastPeople)) {
151
- for (const p of parsedItem.podcastPeople) {
152
- if (p.name) {
153
- dtos.push({
154
- name: p.name,
155
- role: p.role?.toLowerCase() || null,
156
- person_group: p.group?.toLowerCase() || 'cast',
157
- img: p.img || null,
158
- href: p.href || null
159
- });
160
- }
161
- }
162
- }
163
-
164
- return dtos;
165
- };
166
-
167
- export const compatItemSeasonDto = (parsedItem: Episode) => {
168
- if (!parsedItem.podcastSeason?.number) {
169
- return null;
170
- }
171
-
172
- return {
173
- number: parsedItem.podcastSeason.number,
174
- title: parsedItem.podcastSeason.name || null
175
- };
176
- };
177
-
178
- export const compatItemSeasonEpisodeDto = (parsedItem: Episode) => {
179
- if (!parsedItem.podcastEpisode) {
180
- return null;
181
- }
182
-
183
- return {
184
- display: parsedItem.podcastEpisode.display || null,
185
- number: parsedItem.podcastEpisode.number
186
- };
187
- };
188
-
189
- export const compatItemSocialInteractDtos = (parsedItem: Episode) => {
190
- const dtos = [];
191
-
192
- if (parsedItem?.podcastSocialInteraction?.length) {
193
- for (const ps of parsedItem.podcastSocialInteraction) {
194
- dtos.push({
195
- // PTDO: fix keys mismatch between partytime and podverse
196
- protocol: ps.platform,
197
- uri: ps.url,
198
- account_id: ps.id || null,
199
- account_url: ps.profileUrl || null,
200
- priority: ps.priority || null
201
- });
202
- }
203
- }
204
-
205
- return dtos;
206
- };
207
-
208
- export const compatItemSoundbiteDtos = (parsedItem: Episode) => {
209
- const dtos = [];
210
-
211
- if (parsedItem?.podcastSoundbites?.length) {
212
- for (const s of parsedItem.podcastSoundbites) {
213
- dtos.push({
214
- start_time: s.startTime.toFixed(2),
215
- duration: s.duration.toFixed(2),
216
- title: s.title || null
217
- });
218
- }
219
- }
220
-
221
- return dtos;
222
- };
223
-
224
- export const compatItemTranscriptDtos = (parsedItem: Episode) => {
225
- const dtos = [];
226
-
227
- if (parsedItem?.podcastTranscripts?.length) {
228
- for (const t of parsedItem.podcastTranscripts) {
229
- dtos.push({
230
- url: t.url,
231
- type: t.type,
232
- language: t.language || null,
233
- rel: t.rel || null
234
- });
235
- }
236
- }
237
-
238
- return dtos;
239
- };
240
-
241
- export const compatItemTxtDtos = (parsedItem: Episode) => {
242
- const dtos = [];
243
-
244
- if (parsedItem?.podcastTxt?.length) {
245
- for (const txt of parsedItem.podcastTxt) {
246
- dtos.push({
247
- purpose: txt.purpose || null,
248
- value: txt.value
249
- });
250
- }
251
- }
252
-
253
- return dtos;
254
- };
255
-
256
- export const compatItemValueDtos = (parsedItem: Episode) => {
257
- let dtos = [];
258
- if (parsedItem.value) {
259
- const dto = compatItemValue(parsedItem.value);
260
- const formattedDto = {
261
- item_value: {
262
- type: dto.type,
263
- method: dto.method,
264
- suggested: dto.suggested || null
265
- },
266
- item_value_recipients: dto.item_value_recipients,
267
- item_value_time_splits: dto.item_value_time_splits
268
- };
269
-
270
- dtos.push(formattedDto);
271
- }
272
- return dtos;
273
- };
@@ -1,18 +0,0 @@
1
- import { Phase4PodcastLiveItem } from "podcast-partytime/dist/parser/phase/phase-4";
2
- import { getLiveItemStatusEnumValue, LiveItemStatusEnum } from "podverse-orm";
3
-
4
- export const compatLiveItemsDtos = (parsedLiveItems: Phase4PodcastLiveItem[]) => {
5
- const dtos = [];
6
- for (const parsedLiveItem of parsedLiveItems) {
7
- dtos.push({
8
- liveItem: {
9
- live_item_status: getLiveItemStatusEnumValue(parsedLiveItem.status) ?? LiveItemStatusEnum.Pending,
10
- start_time: parsedLiveItem.start,
11
- end_time: parsedLiveItem.end || null
12
- },
13
- item: parsedLiveItem
14
- });
15
- }
16
-
17
- return dtos;
18
- };
@@ -1,64 +0,0 @@
1
- import { Phase4Value, Phase4ValueRecipient } from "podcast-partytime";
2
-
3
- export const compatChannelValue = (value: Phase4Value) => {
4
- return {
5
- type: value.type,
6
- method: value.method,
7
- suggested: parseFloat(value.suggested ?? '0') || null,
8
- channel_value_recipients: compatValueRecipients(value.recipients)
9
- };
10
- };
11
-
12
- export const compatItemValue = (value: Phase4Value) => {
13
- return {
14
- type: value.type,
15
- method: value.method,
16
- suggested: parseFloat(value.suggested ?? '0') || null,
17
- item_value_recipients: compatValueRecipients(value.recipients),
18
- item_value_time_splits: value.valueTimeSplits?.map((valueTimeSplit) => {
19
- if (valueTimeSplit.type === 'remoteItem') {
20
- return {
21
- meta: {
22
- start_time: valueTimeSplit.startTime.toFixed(2),
23
- duration: valueTimeSplit.duration.toFixed(2),
24
- remote_start_time: valueTimeSplit.remoteStartTime?.toFixed(2) || (0).toFixed(2),
25
- remote_percentage: valueTimeSplit.remotePercentage?.toFixed(2) || (100).toFixed(2),
26
- },
27
- item_value_time_splits_recipients: [],
28
- item_value_time_splits_remote_item: valueTimeSplit.remoteItem ? {
29
- feed_guid: valueTimeSplit.remoteItem.feedGuid,
30
- feed_url: valueTimeSplit.remoteItem.feedUrl || null,
31
- item_guid: valueTimeSplit.remoteItem.itemGuid || null,
32
- title: /* PTDO: ri.title || */ null
33
- } : null
34
- };
35
- } else {
36
- // else: valueTimeSplit.type === 'recipients'
37
- return {
38
- meta: {
39
- start_time: valueTimeSplit.startTime.toFixed(2),
40
- duration: valueTimeSplit.duration.toFixed(2),
41
- remote_start_time: (0).toFixed(2),
42
- remote_percentage: (100).toFixed(2),
43
- },
44
- item_value_time_splits_recipients: compatValueRecipients(valueTimeSplit.recipients),
45
- item_value_time_splits_remote_item: null
46
- };
47
- }
48
- }) || []
49
- };
50
- };
51
-
52
- const compatValueRecipients = (recipients: Phase4ValueRecipient[]) => {
53
- return recipients.map((recipient) => {
54
- return {
55
- type: recipient.type,
56
- address: recipient.address,
57
- split: recipient.split,
58
- name: recipient.name || null,
59
- custom_key: recipient.customKey || null,
60
- custom_value: recipient.customValue || null,
61
- fee: recipient.fee || false
62
- };
63
- }) || [];
64
- };
@@ -1,16 +0,0 @@
1
- interface Service<T, P> {
2
- updateMany(parentEntity: P, dtos: Partial<T>[]): Promise<T[]>;
3
- deleteAll(parentEntity: P): Promise<void>;
4
- }
5
-
6
- export const handleParsedManyData = async<T, P> (
7
- parentEntity: P,
8
- service: Service<T, P>,
9
- dtos: Partial<T>[]
10
- ) => {
11
- if (dtos.length > 0) {
12
- await service.updateMany(parentEntity, dtos);
13
- } else {
14
- await service.deleteAll(parentEntity);
15
- }
16
- };
@@ -1,17 +0,0 @@
1
- interface Service<T, P> {
2
- update(parentEntity: P, dto: Partial<T>): Promise<T>;
3
- _delete?(parentEntity: P): Promise<void>;
4
- }
5
-
6
- export const handleParsedOneData = async <T, P>(
7
- parentEntity: P,
8
- service: Service<T, P>,
9
- dto: Partial<T> | null
10
- ) => {
11
- if (dto) {
12
- await service.update(parentEntity, dto);
13
- } else if (service._delete) {
14
- await service._delete(parentEntity);
15
- }
16
- };
17
-
@@ -1,55 +0,0 @@
1
- import { FeedObject } from "podcast-partytime";
2
- import { AppDataSource, Channel, ChannelService, ChannelSeasonIndex } from "podverse-orm";
3
- import { compatChannelDto } from "@parser/lib/compat/partytime/channel";
4
- import { handleParsedChannelAbout } from "@parser/lib/rss/channel/channelAbout";
5
- import { handleParsedChannelChat } from "@parser/lib/rss/channel/channelChat";
6
- import { handleParsedChannelDescription } from "@parser/lib/rss/channel/channelDescription";
7
- import { handleParsedChannelFunding } from "@parser/lib/rss/channel/channelFunding";
8
- import { handleParsedChannelImage } from "@parser/lib/rss/channel/channelImage";
9
- import { handleParsedChannelLicense } from "@parser/lib/rss/channel/channelLicense";
10
- import { handleParsedChannelLocation } from "@parser/lib/rss/channel/channelLocation";
11
- import { handleParsedChannelPerson } from "@parser/lib/rss/channel/channelPerson";
12
- import { handleParsedChannelPodroll } from "@parser/lib/rss/channel/channelPodroll";
13
- import { handleParsedChannelRemoteItem } from "@parser/lib/rss/channel/channelRemoteItem";
14
- import { handleParsedChannelSocialInteract } from "@parser/lib/rss/channel/channelSocialInteract";
15
- import { handleParsedChannelTrailer } from "@parser/lib/rss/channel/channelTrailer";
16
- import { handleParsedChannelTxt } from "@parser/lib/rss/channel/channelTxt";
17
- import { handleParsedChannelValue } from "@parser/lib/rss/channel/channelValue";
18
-
19
- export const handleParsedChannel = async (parsedFeed: FeedObject, channel: Channel, channelSeasonIndex: ChannelSeasonIndex) => {
20
- const channelService = new ChannelService();
21
- const channelDto = compatChannelDto(parsedFeed);
22
- await channelService.update(channel.id, channelDto);
23
-
24
- // TODO: add channelCategory support
25
-
26
- await AppDataSource.manager.transaction(async transactionalEntityManager => {
27
- await handleParsedChannelAbout(parsedFeed, channel, transactionalEntityManager);
28
- await handleParsedChannelChat(parsedFeed, channel, transactionalEntityManager);
29
- await handleParsedChannelDescription(parsedFeed, channel, transactionalEntityManager);
30
- await handleParsedChannelFunding(parsedFeed, channel, transactionalEntityManager);
31
- await handleParsedChannelImage(parsedFeed, channel, transactionalEntityManager);
32
- await handleParsedChannelLicense(parsedFeed, channel, transactionalEntityManager);
33
- await handleParsedChannelLocation(parsedFeed, channel, transactionalEntityManager);
34
- await handleParsedChannelPerson(parsedFeed, channel, transactionalEntityManager);
35
- await handleParsedChannelPodroll(parsedFeed, channel, transactionalEntityManager);
36
-
37
- // PTDO: add channelPublisher support
38
- // const channelPublisherService = new ChannelPublisherService();
39
- // const channelPublisherRemoteItemService = new ChannelPublisherRemoteItemService();
40
-
41
- // const channelPublisherRemoteItemDtos = compatChannelPublisherRemoteItemDtos(parsedFeed);
42
- // if (channelPublisherRemoteItemDtos.length > 0) {
43
- // const channel_publisher = await channelPublisherService.update(channel);
44
- // await channelPublisherRemoteItemService.updateMany(channel_publisher, channelPodrollRemoteItemDtos);
45
- // } else {
46
- // await channelPublisherService.delete(channel);
47
- // }
48
-
49
- await handleParsedChannelRemoteItem(parsedFeed, channel, transactionalEntityManager);
50
- await handleParsedChannelSocialInteract(parsedFeed, channel, transactionalEntityManager);
51
- await handleParsedChannelTrailer(parsedFeed, channel, channelSeasonIndex, transactionalEntityManager);
52
- await handleParsedChannelTxt(parsedFeed, channel, transactionalEntityManager);
53
- await handleParsedChannelValue(parsedFeed, channel, transactionalEntityManager);
54
- });
55
- };
@@ -1,13 +0,0 @@
1
- import { FeedObject } from "podcast-partytime";
2
- import { ChannelAboutService, Channel, EntityManager } from "podverse-orm";
3
- import { compatChannelAboutDto } from "@parser/lib/compat/partytime/channel";
4
-
5
- export const handleParsedChannelAbout = async (
6
- parsedFeed: FeedObject,
7
- channel: Channel,
8
- transactionalEntityManager: EntityManager
9
- ) => {
10
- const channelAboutService = new ChannelAboutService(transactionalEntityManager);
11
- const channelAboutDto = compatChannelAboutDto(parsedFeed);
12
- await channelAboutService.update(channel, channelAboutDto);
13
- };
@@ -1,14 +0,0 @@
1
- import { FeedObject } from "podcast-partytime";
2
- import { Channel, ChannelChatService, EntityManager } from "podverse-orm";
3
- import { compatChannelChatDto } from "@parser/lib/compat/partytime/channel";
4
- import { handleParsedOneData } from "../base/handleParsedOneData";
5
-
6
- export const handleParsedChannelChat = async (
7
- parsedFeed: FeedObject,
8
- channel: Channel,
9
- transactionalEntityManager: EntityManager
10
- ) => {
11
- const channelChatService = new ChannelChatService(transactionalEntityManager);
12
- const channelChatDto = compatChannelChatDto(parsedFeed);
13
- await handleParsedOneData(channel, channelChatService, channelChatDto);
14
- };
@@ -1,14 +0,0 @@
1
- import { FeedObject } from "podcast-partytime";
2
- import { Channel, ChannelDescriptionService, EntityManager } from "podverse-orm";
3
- import { compatChannelDescriptionDto } from "@parser/lib/compat/partytime/channel";
4
- import { handleParsedOneData } from "../base/handleParsedOneData";
5
-
6
- export const handleParsedChannelDescription = async (
7
- parsedFeed: FeedObject,
8
- channel: Channel,
9
- transactionalEntityManager: EntityManager
10
- ) => {
11
- const channelDescriptionService = new ChannelDescriptionService(transactionalEntityManager);
12
- const channelDescriptionDto = compatChannelDescriptionDto(parsedFeed);
13
- await handleParsedOneData(channel, channelDescriptionService, channelDescriptionDto);
14
- };
@@ -1,14 +0,0 @@
1
- import { FeedObject } from "podcast-partytime";
2
- import { Channel, ChannelFundingService, EntityManager } from "podverse-orm";
3
- import { compatChannelFundingDtos } from "@parser/lib/compat/partytime/channel";
4
- import { handleParsedManyData } from "../base/handleParsedManyData";
5
-
6
- export const handleParsedChannelFunding = async (
7
- parsedFeed: FeedObject,
8
- channel: Channel,
9
- transactionalEntityManager: EntityManager
10
- ) => {
11
- const channelFundingService = new ChannelFundingService(transactionalEntityManager);
12
- const channelFundingDtos = compatChannelFundingDtos(parsedFeed);
13
- await handleParsedManyData(channel, channelFundingService, channelFundingDtos);
14
- };
@@ -1,14 +0,0 @@
1
- import { FeedObject } from "podcast-partytime";
2
- import { Channel, ChannelImageService, EntityManager } from "podverse-orm";
3
- import { compatChannelImageDtos } from "@parser/lib/compat/partytime/channel";
4
- import { handleParsedManyData } from "../base/handleParsedManyData";
5
-
6
- export const handleParsedChannelImage = async (
7
- parsedFeed: FeedObject,
8
- channel: Channel,
9
- transactionalEntityManager: EntityManager
10
- ) => {
11
- const channelImageService = new ChannelImageService(transactionalEntityManager);
12
- const channelImageDtos = compatChannelImageDtos(parsedFeed);
13
- await handleParsedManyData(channel, channelImageService, channelImageDtos);
14
- };
@@ -1,14 +0,0 @@
1
- import { FeedObject } from "podcast-partytime";
2
- import { Channel, ChannelLicenseService, EntityManager } from "podverse-orm";
3
- import { compatChannelLicenseDto } from "@parser/lib/compat/partytime/channel";
4
- import { handleParsedOneData } from "../base/handleParsedOneData";
5
-
6
- export const handleParsedChannelLicense = async (
7
- parsedFeed: FeedObject,
8
- channel: Channel,
9
- transactionalEntityManager: EntityManager
10
- ) => {
11
- const channelLicenseService = new ChannelLicenseService(transactionalEntityManager);
12
- const channelLicenseDtos = compatChannelLicenseDto(parsedFeed);
13
- await handleParsedOneData(channel, channelLicenseService, channelLicenseDtos);
14
- };
@@ -1,14 +0,0 @@
1
- import { FeedObject } from "podcast-partytime";
2
- import { Channel, ChannelLocationService, EntityManager } from "podverse-orm";
3
- import { compatChannelLocationDto } from "@parser/lib/compat/partytime/channel";
4
- import { handleParsedOneData } from "../base/handleParsedOneData";
5
-
6
- export const handleParsedChannelLocation = async (
7
- parsedFeed: FeedObject,
8
- channel: Channel,
9
- transactionalEntityManager: EntityManager
10
- ) => {
11
- const channelLocationService = new ChannelLocationService(transactionalEntityManager);
12
- const channelLocationDtos = compatChannelLocationDto(parsedFeed);
13
- await handleParsedOneData(channel, channelLocationService, channelLocationDtos);
14
- };
@@ -1,14 +0,0 @@
1
- import { FeedObject } from "podcast-partytime";
2
- import { Channel, ChannelPersonService, EntityManager } from "podverse-orm";
3
- import { compatChannelPersonDtos } from "@parser/lib/compat/partytime/channel";
4
- import { handleParsedManyData } from "../base/handleParsedManyData";
5
-
6
- export const handleParsedChannelPerson = async (
7
- parsedFeed: FeedObject,
8
- channel: Channel,
9
- transactionalEntityManager: EntityManager
10
- ) => {
11
- const channelPersonService = new ChannelPersonService(transactionalEntityManager);
12
- const channelPersonDtos = compatChannelPersonDtos(parsedFeed);
13
- await handleParsedManyData(channel, channelPersonService, channelPersonDtos);
14
- };
@@ -1,21 +0,0 @@
1
- import { FeedObject } from "podcast-partytime";
2
- import { Channel, ChannelPodrollService, ChannelPodrollRemoteItemService, EntityManager } from "podverse-orm";
3
- import { compatChannelPodrollRemoteItemDtos } from "@parser/lib/compat/partytime/channel";
4
-
5
- export const handleParsedChannelPodroll = async (
6
- parsedFeed: FeedObject,
7
- channel: Channel,
8
- transactionalEntityManager: EntityManager
9
- ) => {
10
- const channelPodrollService = new ChannelPodrollService(transactionalEntityManager);
11
- const channelPodrollDto = {};
12
- const channelPodrollRemoteItemService = new ChannelPodrollRemoteItemService(transactionalEntityManager);
13
- const channelPodrollRemoteItemDtos = compatChannelPodrollRemoteItemDtos(parsedFeed);
14
-
15
- if (channelPodrollRemoteItemDtos.length > 0) {
16
- const channel_podroll = await channelPodrollService.update(channel, channelPodrollDto);
17
- await channelPodrollRemoteItemService.updateMany(channel_podroll, channelPodrollRemoteItemDtos);
18
- } else {
19
- await channelPodrollService.delete(channel);
20
- }
21
- };
@@ -1,14 +0,0 @@
1
- import { FeedObject } from "podcast-partytime";
2
- import { Channel, ChannelRemoteItemService, EntityManager } from "podverse-orm";
3
- import { compatChannelRemoteItemDtos } from "@parser/lib/compat/partytime/channel";
4
- import { handleParsedManyData } from "../base/handleParsedManyData";
5
-
6
- export const handleParsedChannelRemoteItem = async (
7
- parsedFeed: FeedObject,
8
- channel: Channel,
9
- transactionalEntityManager: EntityManager
10
- ) => {
11
- const channelRemoteItemService = new ChannelRemoteItemService(transactionalEntityManager);
12
- const channelRemoteItemDtos = compatChannelRemoteItemDtos(parsedFeed);
13
- await handleParsedManyData(channel, channelRemoteItemService, channelRemoteItemDtos);
14
- };
@@ -1,14 +0,0 @@
1
- import { FeedObject } from "podcast-partytime";
2
- import { Channel, ChannelSeasonService } from "podverse-orm";
3
- import { compatChannelSeasonDtos } from "@parser/lib/compat/partytime/channel";
4
-
5
- export const handleParsedChannelSeasons = async (parsedFeed: FeedObject, channel: Channel): Promise<void> => {
6
- const channelSeasonService = new ChannelSeasonService();
7
- const channelSeasonDtos = compatChannelSeasonDtos(parsedFeed);
8
-
9
- if (channelSeasonDtos.length > 0) {
10
- await channelSeasonService.updateMany(channel, channelSeasonDtos);
11
- } else {
12
- await channelSeasonService.deleteAll(channel);
13
- }
14
- };
@@ -1,14 +0,0 @@
1
- import { FeedObject } from "podcast-partytime";
2
- import { Channel, ChannelSocialInteractService, EntityManager } from "podverse-orm";
3
- import { compatChannelSocialInteractDtos } from "@parser/lib/compat/partytime/channel";
4
- import { handleParsedManyData } from "../base/handleParsedManyData";
5
-
6
- export const handleParsedChannelSocialInteract = async (
7
- parsedFeed: FeedObject,
8
- channel: Channel,
9
- transactionalEntityManager: EntityManager
10
- ) => {
11
- const channelSocialInteractService = new ChannelSocialInteractService(transactionalEntityManager);
12
- const channelSocialInteractDtos = compatChannelSocialInteractDtos(parsedFeed);
13
- await handleParsedManyData(channel, channelSocialInteractService, channelSocialInteractDtos);
14
- };