podverse-parser 5.0.0-beta.1 → 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.
- package/{src/index.ts → dist/index.d.ts} +1 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/lib/chapters/chapters.d.ts +3 -0
- package/dist/lib/chapters/chapters.d.ts.map +1 -0
- package/dist/lib/chapters/chapters.js +59 -0
- package/dist/lib/compat/channel.d.ts +108 -0
- package/dist/lib/compat/channel.d.ts.map +1 -0
- package/dist/lib/compat/channel.js +279 -0
- package/dist/lib/compat/chapters/chapters.d.ts +11 -0
- package/dist/lib/compat/chapters/chapters.d.ts.map +1 -0
- package/dist/lib/compat/chapters/chapters.js +16 -0
- package/dist/lib/compat/partytime/channel.d.ts +110 -0
- package/dist/lib/compat/partytime/channel.d.ts.map +1 -0
- package/dist/lib/compat/partytime/channel.js +281 -0
- package/dist/lib/compat/partytime/compatFull.d.ts +6 -0
- package/dist/lib/compat/partytime/compatFull.d.ts.map +1 -0
- package/dist/lib/compat/partytime/compatFull.js +11 -0
- package/dist/lib/compat/partytime/funding.d.ts +6 -0
- package/dist/lib/compat/partytime/funding.d.ts.map +1 -0
- package/dist/lib/compat/partytime/funding.js +10 -0
- package/dist/lib/compat/partytime/item.d.ts +146 -0
- package/dist/lib/compat/partytime/item.d.ts.map +1 -0
- package/dist/lib/compat/partytime/item.js +264 -0
- package/dist/lib/compat/partytime/liveItem.d.ts +11 -0
- package/dist/lib/compat/partytime/liveItem.d.ts.map +1 -0
- package/dist/lib/compat/partytime/liveItem.js +20 -0
- package/dist/lib/compat/partytime/value.d.ts +62 -0
- package/dist/lib/compat/partytime/value.d.ts.map +1 -0
- package/dist/lib/compat/partytime/value.js +69 -0
- package/dist/lib/rss/base/handleParsedManyData.d.ts +7 -0
- package/dist/lib/rss/base/handleParsedManyData.d.ts.map +1 -0
- package/dist/lib/rss/base/handleParsedManyData.js +21 -0
- package/dist/lib/rss/base/handleParsedOneData.d.ts +7 -0
- package/dist/lib/rss/base/handleParsedOneData.d.ts.map +1 -0
- package/dist/lib/rss/base/handleParsedOneData.js +21 -0
- package/dist/lib/rss/channel/channel.d.ts +4 -0
- package/dist/lib/rss/channel/channel.d.ts.map +1 -0
- package/dist/lib/rss/channel/channel.js +61 -0
- package/dist/lib/rss/channel/channelAbout.d.ts +4 -0
- package/dist/lib/rss/channel/channelAbout.d.ts.map +1 -0
- package/dist/lib/rss/channel/channelAbout.js +20 -0
- package/dist/lib/rss/channel/channelChat.d.ts +4 -0
- package/dist/lib/rss/channel/channelChat.d.ts.map +1 -0
- package/dist/lib/rss/channel/channelChat.js +21 -0
- package/dist/lib/rss/channel/channelDescription.d.ts +4 -0
- package/dist/lib/rss/channel/channelDescription.d.ts.map +1 -0
- package/dist/lib/rss/channel/channelDescription.js +21 -0
- package/dist/lib/rss/channel/channelFunding.d.ts +4 -0
- package/dist/lib/rss/channel/channelFunding.d.ts.map +1 -0
- package/dist/lib/rss/channel/channelFunding.js +21 -0
- package/dist/lib/rss/channel/channelImage.d.ts +4 -0
- package/dist/lib/rss/channel/channelImage.d.ts.map +1 -0
- package/dist/lib/rss/channel/channelImage.js +21 -0
- package/dist/lib/rss/channel/channelLicense.d.ts +4 -0
- package/dist/lib/rss/channel/channelLicense.d.ts.map +1 -0
- package/dist/lib/rss/channel/channelLicense.js +21 -0
- package/dist/lib/rss/channel/channelLocation.d.ts +4 -0
- package/dist/lib/rss/channel/channelLocation.d.ts.map +1 -0
- package/dist/lib/rss/channel/channelLocation.js +21 -0
- package/dist/lib/rss/channel/channelPerson.d.ts +4 -0
- package/dist/lib/rss/channel/channelPerson.d.ts.map +1 -0
- package/dist/lib/rss/channel/channelPerson.js +21 -0
- package/dist/lib/rss/channel/channelPodroll.d.ts +4 -0
- package/dist/lib/rss/channel/channelPodroll.d.ts.map +1 -0
- package/dist/lib/rss/channel/channelPodroll.js +28 -0
- package/dist/lib/rss/channel/channelRemoteItem.d.ts +4 -0
- package/dist/lib/rss/channel/channelRemoteItem.d.ts.map +1 -0
- package/dist/lib/rss/channel/channelRemoteItem.js +21 -0
- package/dist/lib/rss/channel/channelSeason.d.ts +4 -0
- package/dist/lib/rss/channel/channelSeason.d.ts.map +1 -0
- package/dist/lib/rss/channel/channelSeason.js +25 -0
- package/dist/lib/rss/channel/channelSocialInteract.d.ts +4 -0
- package/dist/lib/rss/channel/channelSocialInteract.d.ts.map +1 -0
- package/dist/lib/rss/channel/channelSocialInteract.js +21 -0
- package/dist/lib/rss/channel/channelTrailer.d.ts +4 -0
- package/dist/lib/rss/channel/channelTrailer.d.ts.map +1 -0
- package/dist/lib/rss/channel/channelTrailer.js +36 -0
- package/dist/lib/rss/channel/channelTxt.d.ts +4 -0
- package/dist/lib/rss/channel/channelTxt.d.ts.map +1 -0
- package/dist/lib/rss/channel/channelTxt.js +21 -0
- package/dist/lib/rss/channel/channelValue.d.ts +4 -0
- package/dist/lib/rss/channel/channelValue.d.ts.map +1 -0
- package/dist/lib/rss/channel/channelValue.js +37 -0
- package/dist/lib/rss/feed/feed.d.ts +5 -0
- package/dist/lib/rss/feed/feed.d.ts.map +1 -0
- package/dist/lib/rss/feed/feed.js +80 -0
- package/dist/lib/rss/hash/parsedFeed.d.ts +3 -0
- package/dist/lib/rss/hash/parsedFeed.d.ts.map +1 -0
- package/dist/lib/rss/hash/parsedFeed.js +22 -0
- package/dist/lib/rss/item/item.d.ts +5 -0
- package/dist/lib/rss/item/item.d.ts.map +1 -0
- package/dist/lib/rss/item/item.js +80 -0
- package/dist/lib/rss/item/itemAbout.d.ts +4 -0
- package/dist/lib/rss/item/itemAbout.d.ts.map +1 -0
- package/dist/lib/rss/item/itemAbout.js +20 -0
- package/dist/lib/rss/item/itemChaptersFeed.d.ts +4 -0
- package/dist/lib/rss/item/itemChaptersFeed.d.ts.map +1 -0
- package/dist/lib/rss/item/itemChaptersFeed.js +21 -0
- package/dist/lib/rss/item/itemChat.d.ts +4 -0
- package/dist/lib/rss/item/itemChat.d.ts.map +1 -0
- package/dist/lib/rss/item/itemChat.js +21 -0
- package/dist/lib/rss/item/itemContentLink.d.ts +1 -0
- package/dist/lib/rss/item/itemContentLink.d.ts.map +1 -0
- package/dist/lib/rss/item/itemContentLink.js +1 -0
- package/dist/lib/rss/item/itemDescription.d.ts +4 -0
- package/dist/lib/rss/item/itemDescription.d.ts.map +1 -0
- package/dist/lib/rss/item/itemDescription.js +21 -0
- package/dist/lib/rss/item/itemEnclosure.d.ts +4 -0
- package/dist/lib/rss/item/itemEnclosure.d.ts.map +1 -0
- package/dist/lib/rss/item/itemEnclosure.js +40 -0
- package/dist/lib/rss/item/itemImage.d.ts +4 -0
- package/dist/lib/rss/item/itemImage.d.ts.map +1 -0
- package/dist/lib/rss/item/itemImage.js +21 -0
- package/dist/lib/rss/item/itemLicense.d.ts +4 -0
- package/dist/lib/rss/item/itemLicense.d.ts.map +1 -0
- package/dist/lib/rss/item/itemLicense.js +21 -0
- package/dist/lib/rss/item/itemLocation.d.ts +4 -0
- package/dist/lib/rss/item/itemLocation.d.ts.map +1 -0
- package/dist/lib/rss/item/itemLocation.js +21 -0
- package/dist/lib/rss/item/itemPerson.d.ts +4 -0
- package/dist/lib/rss/item/itemPerson.d.ts.map +1 -0
- package/dist/lib/rss/item/itemPerson.js +21 -0
- package/dist/lib/rss/item/itemSeason.d.ts +4 -0
- package/dist/lib/rss/item/itemSeason.d.ts.map +1 -0
- package/dist/lib/rss/item/itemSeason.js +30 -0
- package/dist/lib/rss/item/itemSeasonEpisode.d.ts +4 -0
- package/dist/lib/rss/item/itemSeasonEpisode.d.ts.map +1 -0
- package/dist/lib/rss/item/itemSeasonEpisode.js +21 -0
- package/dist/lib/rss/item/itemSocialInteract.d.ts +4 -0
- package/dist/lib/rss/item/itemSocialInteract.d.ts.map +1 -0
- package/dist/lib/rss/item/itemSocialInteract.js +21 -0
- package/dist/lib/rss/item/itemSoundbite.d.ts +4 -0
- package/dist/lib/rss/item/itemSoundbite.d.ts.map +1 -0
- package/dist/lib/rss/item/itemSoundbite.js +21 -0
- package/dist/lib/rss/item/itemTranscript.d.ts +4 -0
- package/dist/lib/rss/item/itemTranscript.d.ts.map +1 -0
- package/dist/lib/rss/item/itemTranscript.js +21 -0
- package/dist/lib/rss/item/itemTxt.d.ts +4 -0
- package/dist/lib/rss/item/itemTxt.d.ts.map +1 -0
- package/dist/lib/rss/item/itemTxt.js +21 -0
- package/dist/lib/rss/item/itemValue.d.ts +4 -0
- package/dist/lib/rss/item/itemValue.d.ts.map +1 -0
- package/dist/lib/rss/item/itemValue.js +65 -0
- package/dist/lib/rss/liveItem/liveItem.d.ts +4 -0
- package/dist/lib/rss/liveItem/liveItem.d.ts.map +1 -0
- package/dist/lib/rss/liveItem/liveItem.js +41 -0
- package/dist/lib/rss/parser.d.ts +4 -0
- package/dist/lib/rss/parser.d.ts.map +1 -0
- package/dist/lib/rss/parser.js +83 -0
- package/dist/module-alias-config.d.ts +2 -0
- package/dist/module-alias-config.d.ts.map +1 -0
- package/dist/module-alias-config.js +7 -0
- package/package.json +4 -1
- package/.nvmrc +0 -1
- package/eslint.config.mjs +0 -38
- package/src/lib/chapters/chapters.ts +0 -54
- package/src/lib/compat/channel.ts +0 -287
- package/src/lib/compat/chapters/chapters.ts +0 -23
- package/src/lib/compat/partytime/channel.ts +0 -289
- package/src/lib/compat/partytime/compatFull.ts +0 -7
- package/src/lib/compat/partytime/funding.ts +0 -8
- package/src/lib/compat/partytime/item.ts +0 -273
- package/src/lib/compat/partytime/liveItem.ts +0 -18
- package/src/lib/compat/partytime/value.ts +0 -64
- package/src/lib/rss/base/handleParsedManyData.ts +0 -16
- package/src/lib/rss/base/handleParsedOneData.ts +0 -17
- package/src/lib/rss/channel/channel.ts +0 -55
- package/src/lib/rss/channel/channelAbout.ts +0 -13
- package/src/lib/rss/channel/channelChat.ts +0 -14
- package/src/lib/rss/channel/channelDescription.ts +0 -14
- package/src/lib/rss/channel/channelFunding.ts +0 -14
- package/src/lib/rss/channel/channelImage.ts +0 -14
- package/src/lib/rss/channel/channelLicense.ts +0 -14
- package/src/lib/rss/channel/channelLocation.ts +0 -14
- package/src/lib/rss/channel/channelPerson.ts +0 -14
- package/src/lib/rss/channel/channelPodroll.ts +0 -21
- package/src/lib/rss/channel/channelRemoteItem.ts +0 -14
- package/src/lib/rss/channel/channelSeason.ts +0 -14
- package/src/lib/rss/channel/channelSocialInteract.ts +0 -14
- package/src/lib/rss/channel/channelTrailer.ts +0 -31
- package/src/lib/rss/channel/channelTxt.ts +0 -14
- package/src/lib/rss/channel/channelValue.ts +0 -30
- package/src/lib/rss/feed/feed.ts +0 -79
- package/src/lib/rss/hash/parsedFeed.ts +0 -9
- package/src/lib/rss/item/item.ts +0 -85
- package/src/lib/rss/item/itemAbout.ts +0 -13
- package/src/lib/rss/item/itemChaptersFeed.ts +0 -14
- package/src/lib/rss/item/itemChat.ts +0 -14
- package/src/lib/rss/item/itemContentLink.ts +0 -0
- package/src/lib/rss/item/itemDescription.ts +0 -14
- package/src/lib/rss/item/itemEnclosure.ts +0 -35
- package/src/lib/rss/item/itemImage.ts +0 -14
- package/src/lib/rss/item/itemLicense.ts +0 -14
- package/src/lib/rss/item/itemLocation.ts +0 -14
- package/src/lib/rss/item/itemPerson.ts +0 -14
- package/src/lib/rss/item/itemSeason.ts +0 -26
- package/src/lib/rss/item/itemSeasonEpisode.ts +0 -14
- package/src/lib/rss/item/itemSocialInteract.ts +0 -14
- package/src/lib/rss/item/itemSoundbite.ts +0 -14
- package/src/lib/rss/item/itemTranscript.ts +0 -14
- package/src/lib/rss/item/itemTxt.ts +0 -14
- package/src/lib/rss/item/itemValue.ts +0 -60
- package/src/lib/rss/liveItem/liveItem.ts +0 -34
- package/src/lib/rss/parser.ts +0 -85
- package/src/module-alias-config.ts +0 -8
- package/tsconfig.json +0 -25
|
@@ -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
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { FeedObject } from "podcast-partytime";
|
|
2
|
-
import { Channel, ChannelSeason, ChannelTrailerDto, ChannelTrailerService, EntityManager } from "podverse-orm";
|
|
3
|
-
import { compatChannelTrailerDtos } from "@parser/lib/compat/partytime/channel";
|
|
4
|
-
|
|
5
|
-
export const handleParsedChannelTrailer = async (
|
|
6
|
-
parsedFeed: FeedObject,
|
|
7
|
-
channel: Channel,
|
|
8
|
-
channelSeasonIndex: Record<number, ChannelSeason>,
|
|
9
|
-
transactionalEntityManager: EntityManager
|
|
10
|
-
) => {
|
|
11
|
-
const channelTrailerService = new ChannelTrailerService(transactionalEntityManager);
|
|
12
|
-
const channelTrailerDtos = compatChannelTrailerDtos(parsedFeed);
|
|
13
|
-
|
|
14
|
-
const enrichedChannelTrailerDtos: ChannelTrailerDto[] = channelTrailerDtos.map((channelTrailerDto) => {
|
|
15
|
-
const channel_season = channelTrailerDto.season ? channelSeasonIndex[channelTrailerDto.season] : null;
|
|
16
|
-
return {
|
|
17
|
-
url: channelTrailerDto.url,
|
|
18
|
-
pubdate: channelTrailerDto.pubdate,
|
|
19
|
-
title: channelTrailerDto.title,
|
|
20
|
-
length: channelTrailerDto.length,
|
|
21
|
-
type: channelTrailerDto.type,
|
|
22
|
-
channel_season
|
|
23
|
-
};
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
if (channelTrailerDtos.length > 0) {
|
|
27
|
-
await channelTrailerService.updateMany(channel, enrichedChannelTrailerDtos);
|
|
28
|
-
} else {
|
|
29
|
-
await channelTrailerService.deleteAll(channel);
|
|
30
|
-
}
|
|
31
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FeedObject } from "podcast-partytime";
|
|
2
|
-
import { Channel, ChannelTxtService, EntityManager } from "podverse-orm";
|
|
3
|
-
import { compatChannelTxtDtos } from "@parser/lib/compat/partytime/channel";
|
|
4
|
-
import { handleParsedManyData } from "../base/handleParsedManyData";
|
|
5
|
-
|
|
6
|
-
export const handleParsedChannelTxt = async (
|
|
7
|
-
parsedFeed: FeedObject,
|
|
8
|
-
channel: Channel,
|
|
9
|
-
transactionalEntityManager: EntityManager
|
|
10
|
-
) => {
|
|
11
|
-
const channelTxtService = new ChannelTxtService(transactionalEntityManager);
|
|
12
|
-
const channelTxtDtos = compatChannelTxtDtos(parsedFeed);
|
|
13
|
-
await handleParsedManyData(channel, channelTxtService, channelTxtDtos);
|
|
14
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { FeedObject } from "podcast-partytime";
|
|
2
|
-
import { Channel, ChannelValueService, ChannelValueRecipientService, EntityManager } from "podverse-orm";
|
|
3
|
-
import { compatChannelValueDtos } from "@parser/lib/compat/partytime/channel";
|
|
4
|
-
|
|
5
|
-
export const handleParsedChannelValue = async (
|
|
6
|
-
parsedFeed: FeedObject,
|
|
7
|
-
channel: Channel,
|
|
8
|
-
transactionalEntityManager: EntityManager
|
|
9
|
-
) => {
|
|
10
|
-
const channelValueService = new ChannelValueService(transactionalEntityManager);
|
|
11
|
-
const channelValueDtos = compatChannelValueDtos(parsedFeed);
|
|
12
|
-
const channelValueRecipientService = new ChannelValueRecipientService(transactionalEntityManager);
|
|
13
|
-
|
|
14
|
-
if (channelValueDtos.length > 0) {
|
|
15
|
-
for (const channelValueDto of channelValueDtos) {
|
|
16
|
-
const channel_value = await channelValueService.update(channel, channelValueDto.channel_value);
|
|
17
|
-
|
|
18
|
-
const channelValueRecipientDtos = channelValueDto.channel_value_recipients;
|
|
19
|
-
if (channelValueRecipientDtos.length > 0) {
|
|
20
|
-
for (const channelValueRecipientDto of channelValueRecipientDtos) {
|
|
21
|
-
await channelValueRecipientService.update(channel_value, channelValueRecipientDto);
|
|
22
|
-
}
|
|
23
|
-
} else {
|
|
24
|
-
await channelValueService.deleteAll(channel);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
} else {
|
|
28
|
-
await channelValueService.deleteAll(channel);
|
|
29
|
-
}
|
|
30
|
-
};
|
package/src/lib/rss/feed/feed.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { FeedObject } from "podcast-partytime";
|
|
2
|
-
import { throwRequestError } from "podverse-helpers";
|
|
3
|
-
import { checkIfFeedFlagStatusShouldParse, Feed, FeedService, FeedLogService } from "podverse-orm";
|
|
4
|
-
import { getParsedFeedMd5Hash } from "../hash/parsedFeed";
|
|
5
|
-
import { getAndParseRSSFeed } from "../parser";
|
|
6
|
-
|
|
7
|
-
export const handleGetRSSFeed = async (feed: Feed): Promise<FeedObject> => {
|
|
8
|
-
const feedLogService = new FeedLogService();
|
|
9
|
-
let parsedFeed: FeedObject | null = null;
|
|
10
|
-
|
|
11
|
-
try {
|
|
12
|
-
parsedFeed = await getAndParseRSSFeed(feed.url);
|
|
13
|
-
await feedLogService.update(feed, {
|
|
14
|
-
last_http_status: 200,
|
|
15
|
-
last_good_http_status_time: new Date()
|
|
16
|
-
});
|
|
17
|
-
} catch (error) {
|
|
18
|
-
// TODO: how to handle errors?
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
-
const statusCode = (error as any).statusCode as number;
|
|
21
|
-
const feedLog = await feedLogService.get(feed);
|
|
22
|
-
if (statusCode) {
|
|
23
|
-
await feedLogService.update(feed, {
|
|
24
|
-
last_http_status: statusCode,
|
|
25
|
-
parse_errors: (feedLog?.parse_errors || 0) + 1,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
return throwRequestError(error);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (!parsedFeed) {
|
|
32
|
-
const feedLog = await feedLogService.get(feed);
|
|
33
|
-
await feedLogService.update(feed, {
|
|
34
|
-
last_http_status: 200,
|
|
35
|
-
last_finished_parse_time: new Date(),
|
|
36
|
-
parse_errors: (feedLog?.parse_errors || 0) + 1,
|
|
37
|
-
});
|
|
38
|
-
return throwRequestError('parsedFeed no data found');
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return parsedFeed;
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const handleParsedFeed = async (parsedFeed: FeedObject, url: string, podcast_index_id: number): Promise<Feed> => {
|
|
45
|
-
const feedService = new FeedService();
|
|
46
|
-
const feed = await feedService.getOrCreate({ url, podcast_index_id });
|
|
47
|
-
|
|
48
|
-
// TODO: move before partytime parsing
|
|
49
|
-
if (!checkIfFeedFlagStatusShouldParse(feed.feed_flag_status.id)) {
|
|
50
|
-
throw new Error(`parseRSSFeedAndSaveToDatabase: feed_flag_status.status is not None or AlwaysAllow for ${url}`);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
checkIfFeedIsParsing(feed);
|
|
54
|
-
|
|
55
|
-
const currentFeedFileHash = getParsedFeedMd5Hash(parsedFeed);
|
|
56
|
-
|
|
57
|
-
if (feed.last_parsed_file_hash === currentFeedFileHash) {
|
|
58
|
-
throw new Error(`Feed ${feed.id} has no changes since last parsed.`);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return feedService.update(feed.id, { last_parsed_file_hash: currentFeedFileHash });
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
const checkIfFeedIsParsing = (feed: Feed): void => {
|
|
65
|
-
// TODO: handle with caching db / redis instead of database?
|
|
66
|
-
if (feed.is_parsing) {
|
|
67
|
-
const parsingDate = new Date(feed.is_parsing);
|
|
68
|
-
const currentDate = new Date();
|
|
69
|
-
const timeDifference = (currentDate.getTime() - parsingDate.getTime()) / (1000 * 60);
|
|
70
|
-
|
|
71
|
-
if (isNaN(parsingDate.getTime())) {
|
|
72
|
-
throw new Error(`Feed ${feed.id} has an invalid parsing date`);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (timeDifference <= 30) {
|
|
76
|
-
throw new Error(`Feed ${feed.id} is already parsing`);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { getMd5Hash } from "podverse-helpers";
|
|
2
|
-
import { FeedObject } from "podcast-partytime";
|
|
3
|
-
|
|
4
|
-
export const getParsedFeedMd5Hash = (parsedFeed: FeedObject): string => {
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
|
-
const { lastUpdate, lastBuildDate, pubDate, ...parsedFeedPruned } = parsedFeed;
|
|
7
|
-
const currentFeedFileHash = getMd5Hash(parsedFeedPruned);
|
|
8
|
-
return currentFeedFileHash;
|
|
9
|
-
};
|
package/src/lib/rss/item/item.ts
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { Episode } from "podcast-partytime";
|
|
2
|
-
import { chunkArray } from "podverse-helpers";
|
|
3
|
-
import { AppDataSource, Channel, ChannelSeasonIndex, EntityManager, ItemService } from "podverse-orm";
|
|
4
|
-
import { compatItemDto } from "@parser/lib/compat/partytime/item";
|
|
5
|
-
import { handleParsedItemAbout } from "@parser/lib/rss/item/itemAbout";
|
|
6
|
-
import { handleParsedItemChaptersFeed } from "@parser/lib/rss/item/itemChaptersFeed";
|
|
7
|
-
import { handleParsedItemDescription } from "@parser/lib/rss/item/itemDescription";
|
|
8
|
-
import { handleParsedItemEnclosure } from "@parser/lib/rss/item/itemEnclosure";
|
|
9
|
-
import { handleParsedItemImage } from "@parser/lib/rss/item/itemImage";
|
|
10
|
-
import { handleParsedItemLicense } from "@parser/lib/rss/item/itemLicense";
|
|
11
|
-
import { handleParsedItemLocation } from "@parser/lib/rss/item/itemLocation";
|
|
12
|
-
import { handleParsedItemPerson } from "@parser/lib/rss/item/itemPerson";
|
|
13
|
-
import { handleParsedItemSeason } from "@parser/lib/rss/item/itemSeason";
|
|
14
|
-
import { handleParsedItemSeasonEpisode } from "@parser/lib/rss/item/itemSeasonEpisode";
|
|
15
|
-
import { handleParsedItemSocialInteract } from "@parser/lib/rss/item/itemSocialInteract";
|
|
16
|
-
import { handleParsedItemSoundbite } from "@parser/lib/rss/item/itemSoundbite";
|
|
17
|
-
import { handleParsedItemTranscript } from "@parser/lib/rss/item/itemTranscript";
|
|
18
|
-
import { handleParsedItemTxt } from "@parser/lib/rss/item/itemTxt";
|
|
19
|
-
import { handleParsedItemValue } from "@parser/lib/rss/item/itemValue";
|
|
20
|
-
import { handleParsedItemChat } from "@parser/lib/rss/item/itemChat";
|
|
21
|
-
|
|
22
|
-
export const handleParsedItems = async (parsedItems: Episode[], channel: Channel, channelSeasonIndex: ChannelSeasonIndex) => {
|
|
23
|
-
const itemService = new ItemService();
|
|
24
|
-
const existingItems = await itemService.getAllItemsByChannel(channel, { select: ['id'] });
|
|
25
|
-
const existingItemIds = existingItems.map(item => item.id);
|
|
26
|
-
const updatedItemIds: number[] = [];
|
|
27
|
-
|
|
28
|
-
const parsedItemBatchs = chunkArray(parsedItems, 100);
|
|
29
|
-
for (const parsedItemBatch of parsedItemBatchs) {
|
|
30
|
-
await AppDataSource.manager.transaction(async transactionalEntityManager => {
|
|
31
|
-
for (const parsedItem of parsedItemBatch) {
|
|
32
|
-
const item = await handleParsedItem(
|
|
33
|
-
parsedItem,
|
|
34
|
-
channel,
|
|
35
|
-
channelSeasonIndex,
|
|
36
|
-
transactionalEntityManager
|
|
37
|
-
);
|
|
38
|
-
updatedItemIds.push(item.id);
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const itemIdsToDelete = existingItemIds.filter(id => !updatedItemIds.includes(id));
|
|
44
|
-
await itemService.deleteMany(itemIdsToDelete);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const handleParsedItem = async (
|
|
48
|
-
parsedItem: Episode,
|
|
49
|
-
channel: Channel,
|
|
50
|
-
channelSeasonIndex: ChannelSeasonIndex,
|
|
51
|
-
transactionalEntityManager: EntityManager
|
|
52
|
-
) => {
|
|
53
|
-
const itemService = new ItemService();
|
|
54
|
-
const itemDto = compatItemDto(parsedItem);
|
|
55
|
-
const item = await itemService.update(channel, itemDto);
|
|
56
|
-
|
|
57
|
-
await handleParsedItemAbout(parsedItem, item, transactionalEntityManager);
|
|
58
|
-
await handleParsedItemChaptersFeed(parsedItem, item, transactionalEntityManager);
|
|
59
|
-
await handleParsedItemChat(parsedItem, item, transactionalEntityManager);
|
|
60
|
-
|
|
61
|
-
// // PTDO: add itemContentLinkService support after partytime adds chat support
|
|
62
|
-
// const itemContentLinkService = new ItemContentLinkService();
|
|
63
|
-
// const itemContentLinkDtos = compatItemContentLinkDtos(parsedItem);
|
|
64
|
-
// if (itemContentLinkDtos.length) {
|
|
65
|
-
// await itemContentLinkService.updateMany(item, itemContentLinkDtos);
|
|
66
|
-
// } else {
|
|
67
|
-
// await itemContentLinkService._deleteAll(item);
|
|
68
|
-
// }
|
|
69
|
-
|
|
70
|
-
await handleParsedItemDescription(parsedItem, item, transactionalEntityManager);
|
|
71
|
-
await handleParsedItemEnclosure(parsedItem, item, transactionalEntityManager);
|
|
72
|
-
await handleParsedItemImage(parsedItem, item, transactionalEntityManager);
|
|
73
|
-
await handleParsedItemLicense(parsedItem, item, transactionalEntityManager);
|
|
74
|
-
await handleParsedItemLocation(parsedItem, item, transactionalEntityManager);
|
|
75
|
-
await handleParsedItemPerson(parsedItem, item, transactionalEntityManager);
|
|
76
|
-
await handleParsedItemSeason(parsedItem, item, channelSeasonIndex, transactionalEntityManager);
|
|
77
|
-
await handleParsedItemSeasonEpisode(parsedItem, item, transactionalEntityManager);
|
|
78
|
-
await handleParsedItemSocialInteract(parsedItem, item, transactionalEntityManager);
|
|
79
|
-
await handleParsedItemSoundbite(parsedItem, item, transactionalEntityManager);
|
|
80
|
-
await handleParsedItemTranscript(parsedItem, item, transactionalEntityManager);
|
|
81
|
-
await handleParsedItemTxt(parsedItem, item, transactionalEntityManager);
|
|
82
|
-
await handleParsedItemValue(parsedItem, item, transactionalEntityManager);
|
|
83
|
-
|
|
84
|
-
return item;
|
|
85
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Episode } from "podcast-partytime";
|
|
2
|
-
import { EntityManager, Item, ItemAboutService } from "podverse-orm";
|
|
3
|
-
import { compatItemAboutDto } from "@parser/lib/compat/partytime/item";
|
|
4
|
-
|
|
5
|
-
export const handleParsedItemAbout = async (
|
|
6
|
-
parsedItem: Episode,
|
|
7
|
-
item: Item,
|
|
8
|
-
transactionalEntityManager: EntityManager
|
|
9
|
-
) => {
|
|
10
|
-
const itemAboutService = new ItemAboutService(transactionalEntityManager);
|
|
11
|
-
const itemAboutDto = compatItemAboutDto(parsedItem);
|
|
12
|
-
await itemAboutService.update(item, itemAboutDto);
|
|
13
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Episode } from "podcast-partytime";
|
|
2
|
-
import { EntityManager, Item, ItemChaptersFeedService } from "podverse-orm";
|
|
3
|
-
import { compatItemChaptersFeedDto } from "@parser/lib/compat/partytime/item";
|
|
4
|
-
import { handleParsedOneData } from "../base/handleParsedOneData";
|
|
5
|
-
|
|
6
|
-
export const handleParsedItemChaptersFeed = async (
|
|
7
|
-
parsedItem: Episode,
|
|
8
|
-
item: Item,
|
|
9
|
-
transactionalEntityManager: EntityManager
|
|
10
|
-
) => {
|
|
11
|
-
const itemChaptersFeedService = new ItemChaptersFeedService(transactionalEntityManager);
|
|
12
|
-
const itemChaptersFeedDto = compatItemChaptersFeedDto(parsedItem);
|
|
13
|
-
await handleParsedOneData(item, itemChaptersFeedService, itemChaptersFeedDto);
|
|
14
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Episode } from "podcast-partytime";
|
|
2
|
-
import { EntityManager, Item, ItemChatService } from "podverse-orm";
|
|
3
|
-
import { compatItemChatDto } from "@parser/lib/compat/partytime/item";
|
|
4
|
-
import { handleParsedOneData } from "../base/handleParsedOneData";
|
|
5
|
-
|
|
6
|
-
export const handleParsedItemChat = async (
|
|
7
|
-
parsedItem: Episode,
|
|
8
|
-
item: Item,
|
|
9
|
-
transactionalEntityManager: EntityManager
|
|
10
|
-
) => {
|
|
11
|
-
const itemChatService = new ItemChatService(transactionalEntityManager);
|
|
12
|
-
const itemChatDto = compatItemChatDto(parsedItem);
|
|
13
|
-
await handleParsedOneData(item, itemChatService, itemChatDto);
|
|
14
|
-
};
|
|
File without changes
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Episode } from "podcast-partytime";
|
|
2
|
-
import { EntityManager, Item, ItemDescriptionService } from "podverse-orm";
|
|
3
|
-
import { compatItemDescriptionDto } from "@parser/lib/compat/partytime/item";
|
|
4
|
-
import { handleParsedOneData } from "../base/handleParsedOneData";
|
|
5
|
-
|
|
6
|
-
export const handleParsedItemDescription = async (
|
|
7
|
-
parsedItem: Episode,
|
|
8
|
-
item: Item,
|
|
9
|
-
transactionalEntityManager: EntityManager
|
|
10
|
-
) => {
|
|
11
|
-
const itemDescriptionService = new ItemDescriptionService(transactionalEntityManager);
|
|
12
|
-
const itemDescriptionDto = compatItemDescriptionDto(parsedItem);
|
|
13
|
-
await handleParsedOneData(item, itemDescriptionService, itemDescriptionDto);
|
|
14
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Episode } from "podcast-partytime";
|
|
2
|
-
import { EntityManager, Item, ItemEnclosureService, ItemEnclosureSourceService,
|
|
3
|
-
ItemEnclosureIntegrityService } from "podverse-orm";
|
|
4
|
-
import { compatItemEnclosureDtos } from "@parser/lib/compat/partytime/item";
|
|
5
|
-
|
|
6
|
-
export const handleParsedItemEnclosure = async (
|
|
7
|
-
parsedItem: Episode,
|
|
8
|
-
item: Item,
|
|
9
|
-
transactionalEntityManager: EntityManager
|
|
10
|
-
) => {
|
|
11
|
-
const itemEnclosureService = new ItemEnclosureService(transactionalEntityManager);
|
|
12
|
-
const itemEnclosureDtos = compatItemEnclosureDtos(parsedItem);
|
|
13
|
-
|
|
14
|
-
if (itemEnclosureDtos.length > 0) {
|
|
15
|
-
for (const itemEnclosureDto of itemEnclosureDtos) {
|
|
16
|
-
const item_enclosure = await itemEnclosureService.update(item, itemEnclosureDto.item_enclosure);
|
|
17
|
-
|
|
18
|
-
const itemEnclosureSourceDtos = itemEnclosureDto.item_enclosure_sources;
|
|
19
|
-
if (itemEnclosureSourceDtos.length > 0) {
|
|
20
|
-
const itemEnclosureSourceService = new ItemEnclosureSourceService(transactionalEntityManager);
|
|
21
|
-
await itemEnclosureSourceService.updateMany(item_enclosure, itemEnclosureSourceDtos);
|
|
22
|
-
} else {
|
|
23
|
-
await itemEnclosureService.deleteAll(item);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const itemEnclosureIntegrityDto = itemEnclosureDto.item_enclosure_integrity;
|
|
27
|
-
if (itemEnclosureIntegrityDto) {
|
|
28
|
-
const itemEnclosureIntegrityService = new ItemEnclosureIntegrityService(transactionalEntityManager);
|
|
29
|
-
await itemEnclosureIntegrityService.update(item_enclosure, itemEnclosureIntegrityDto);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
} else {
|
|
33
|
-
await itemEnclosureService.deleteAll(item);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Episode } from "podcast-partytime";
|
|
2
|
-
import { EntityManager, Item, ItemImageService } from "podverse-orm";
|
|
3
|
-
import { compatItemImageDtos } from "@parser/lib/compat/partytime/item";
|
|
4
|
-
import { handleParsedManyData } from "../base/handleParsedManyData";
|
|
5
|
-
|
|
6
|
-
export const handleParsedItemImage = async (
|
|
7
|
-
parsedItem: Episode,
|
|
8
|
-
item: Item,
|
|
9
|
-
transactionalEntityManager: EntityManager
|
|
10
|
-
) => {
|
|
11
|
-
const itemImageService = new ItemImageService(transactionalEntityManager);
|
|
12
|
-
const itemImageDtos = compatItemImageDtos(parsedItem);
|
|
13
|
-
await handleParsedManyData(item, itemImageService, itemImageDtos);
|
|
14
|
-
};
|