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,14 +0,0 @@
|
|
|
1
|
-
import { Episode } from "podcast-partytime";
|
|
2
|
-
import { EntityManager, Item, ItemLicenseService } from "podverse-orm";
|
|
3
|
-
import { compatItemLicenseDto } from "@parser/lib/compat/partytime/item";
|
|
4
|
-
import { handleParsedOneData } from "../base/handleParsedOneData";
|
|
5
|
-
|
|
6
|
-
export const handleParsedItemLicense = async (
|
|
7
|
-
parsedItem: Episode,
|
|
8
|
-
item: Item,
|
|
9
|
-
transactionalEntityManager: EntityManager
|
|
10
|
-
) => {
|
|
11
|
-
const itemLicenseService = new ItemLicenseService(transactionalEntityManager);
|
|
12
|
-
const itemLicenseDto = compatItemLicenseDto(parsedItem);
|
|
13
|
-
await handleParsedOneData(item, itemLicenseService, itemLicenseDto);
|
|
14
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Episode } from "podcast-partytime";
|
|
2
|
-
import { EntityManager, Item, ItemLocationService } from "podverse-orm";
|
|
3
|
-
import { compatItemLocationDto } from "@parser/lib/compat/partytime/item";
|
|
4
|
-
import { handleParsedOneData } from "../base/handleParsedOneData";
|
|
5
|
-
|
|
6
|
-
export const handleParsedItemLocation = async (
|
|
7
|
-
parsedItem: Episode,
|
|
8
|
-
item: Item,
|
|
9
|
-
transactionalEntityManager: EntityManager
|
|
10
|
-
) => {
|
|
11
|
-
const itemLocationService = new ItemLocationService(transactionalEntityManager);
|
|
12
|
-
const itemLocationDto = compatItemLocationDto(parsedItem);
|
|
13
|
-
await handleParsedOneData(item, itemLocationService, itemLocationDto);
|
|
14
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Episode } from "podcast-partytime";
|
|
2
|
-
import { EntityManager, Item, ItemPersonService } from "podverse-orm";
|
|
3
|
-
import { compatItemPersonDtos } from "@parser/lib/compat/partytime/item";
|
|
4
|
-
import { handleParsedManyData } from "../base/handleParsedManyData";
|
|
5
|
-
|
|
6
|
-
export const handleParsedItemPerson = async (
|
|
7
|
-
parsedItem: Episode,
|
|
8
|
-
item: Item,
|
|
9
|
-
transactionalEntityManager: EntityManager
|
|
10
|
-
) => {
|
|
11
|
-
const itemPersonService = new ItemPersonService(transactionalEntityManager);
|
|
12
|
-
const itemPersonDtos = compatItemPersonDtos(parsedItem);
|
|
13
|
-
await handleParsedManyData(item, itemPersonService, itemPersonDtos);
|
|
14
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Episode } from "podcast-partytime";
|
|
2
|
-
import { ChannelSeasonIndex, EntityManager, Item, ItemSeasonDto,
|
|
3
|
-
ItemSeasonService } from "podverse-orm";
|
|
4
|
-
import { compatItemSeasonDto } from "@parser/lib/compat/partytime/item";
|
|
5
|
-
import { handleParsedOneData } from "../base/handleParsedOneData";
|
|
6
|
-
|
|
7
|
-
export const handleParsedItemSeason = async (
|
|
8
|
-
parsedItem: Episode,
|
|
9
|
-
item: Item,
|
|
10
|
-
channelSeasonIndex: ChannelSeasonIndex,
|
|
11
|
-
transactionalEntityManager: EntityManager
|
|
12
|
-
) => {
|
|
13
|
-
const itemSeasonService = new ItemSeasonService(transactionalEntityManager);
|
|
14
|
-
const itemSeasonDto = compatItemSeasonDto(parsedItem);
|
|
15
|
-
|
|
16
|
-
if (itemSeasonDto) {
|
|
17
|
-
const channel_season = itemSeasonDto.number ? channelSeasonIndex[itemSeasonDto.number] : null;
|
|
18
|
-
if (channel_season) {
|
|
19
|
-
const enrichedItemSeasonDto: ItemSeasonDto = {
|
|
20
|
-
title: itemSeasonDto.title,
|
|
21
|
-
channel_season
|
|
22
|
-
};
|
|
23
|
-
await handleParsedOneData(item, itemSeasonService, enrichedItemSeasonDto);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Episode } from "podcast-partytime";
|
|
2
|
-
import { EntityManager, Item, ItemSeasonEpisodeService } from "podverse-orm";
|
|
3
|
-
import { compatItemSeasonEpisodeDto } from "@parser/lib/compat/partytime/item";
|
|
4
|
-
import { handleParsedOneData } from "../base/handleParsedOneData";
|
|
5
|
-
|
|
6
|
-
export const handleParsedItemSeasonEpisode = async (
|
|
7
|
-
parsedItem: Episode,
|
|
8
|
-
item: Item,
|
|
9
|
-
transactionalEntityManager: EntityManager
|
|
10
|
-
) => {
|
|
11
|
-
const itemSeasonEpisodeService = new ItemSeasonEpisodeService(transactionalEntityManager);
|
|
12
|
-
const itemSeasonEpisodeDto = compatItemSeasonEpisodeDto(parsedItem);
|
|
13
|
-
await handleParsedOneData(item, itemSeasonEpisodeService, itemSeasonEpisodeDto);
|
|
14
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Episode } from "podcast-partytime";
|
|
2
|
-
import { EntityManager, Item, ItemSocialInteractService } from "podverse-orm";
|
|
3
|
-
import { compatItemSocialInteractDtos } from "@parser/lib/compat/partytime/item";
|
|
4
|
-
import { handleParsedManyData } from "../base/handleParsedManyData";
|
|
5
|
-
|
|
6
|
-
export const handleParsedItemSocialInteract = async (
|
|
7
|
-
parsedItem: Episode,
|
|
8
|
-
item: Item,
|
|
9
|
-
transactionalEntityManager: EntityManager
|
|
10
|
-
) => {
|
|
11
|
-
const itemSocialInteractService = new ItemSocialInteractService(transactionalEntityManager);
|
|
12
|
-
const itemSocialInteractDtos = compatItemSocialInteractDtos(parsedItem);
|
|
13
|
-
await handleParsedManyData(item, itemSocialInteractService, itemSocialInteractDtos);
|
|
14
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Episode } from "podcast-partytime";
|
|
2
|
-
import { EntityManager, Item, ItemSoundbiteService } from "podverse-orm";
|
|
3
|
-
import { compatItemSoundbiteDtos } from "@parser/lib/compat/partytime/item";
|
|
4
|
-
import { handleParsedManyData } from "../base/handleParsedManyData";
|
|
5
|
-
|
|
6
|
-
export const handleParsedItemSoundbite = async (
|
|
7
|
-
parsedItem: Episode,
|
|
8
|
-
item: Item,
|
|
9
|
-
transactionalEntityManager: EntityManager
|
|
10
|
-
) => {
|
|
11
|
-
const itemSoundbiteService = new ItemSoundbiteService(transactionalEntityManager);
|
|
12
|
-
const itemSoundbiteDtos = compatItemSoundbiteDtos(parsedItem);
|
|
13
|
-
await handleParsedManyData(item, itemSoundbiteService, itemSoundbiteDtos);
|
|
14
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Episode } from "podcast-partytime";
|
|
2
|
-
import { EntityManager, Item, ItemTranscriptService } from "podverse-orm";
|
|
3
|
-
import { compatItemTranscriptDtos } from "@parser/lib/compat/partytime/item";
|
|
4
|
-
import { handleParsedManyData } from "../base/handleParsedManyData";
|
|
5
|
-
|
|
6
|
-
export const handleParsedItemTranscript = async (
|
|
7
|
-
parsedItem: Episode,
|
|
8
|
-
item: Item,
|
|
9
|
-
transactionalEntityManager: EntityManager
|
|
10
|
-
) => {
|
|
11
|
-
const itemTranscriptService = new ItemTranscriptService(transactionalEntityManager);
|
|
12
|
-
const itemTranscriptDtos = compatItemTranscriptDtos(parsedItem);
|
|
13
|
-
await handleParsedManyData(item, itemTranscriptService, itemTranscriptDtos);
|
|
14
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Episode } from "podcast-partytime";
|
|
2
|
-
import { EntityManager, Item, ItemTxtService } from "podverse-orm";
|
|
3
|
-
import { compatItemTxtDtos } from "@parser/lib/compat/partytime/item";
|
|
4
|
-
import { handleParsedManyData } from "../base/handleParsedManyData";
|
|
5
|
-
|
|
6
|
-
export const handleParsedItemTxt = async (
|
|
7
|
-
parsedItem: Episode,
|
|
8
|
-
item: Item,
|
|
9
|
-
transactionalEntityManager: EntityManager
|
|
10
|
-
) => {
|
|
11
|
-
const itemTxtService = new ItemTxtService(transactionalEntityManager);
|
|
12
|
-
const itemTxtDtos = compatItemTxtDtos(parsedItem);
|
|
13
|
-
await handleParsedManyData(item, itemTxtService, itemTxtDtos);
|
|
14
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { Episode } from "podcast-partytime";
|
|
2
|
-
import { EntityManager, Item, ItemValueService, ItemValueRecipientService, ItemValueTimeSplitService,
|
|
3
|
-
ItemValueTimeSplitRecipientService, ItemValueTimeSplitRemoteItemService
|
|
4
|
-
} from "podverse-orm";
|
|
5
|
-
import { compatItemValueDtos } from "@parser/lib/compat/partytime/item";
|
|
6
|
-
|
|
7
|
-
export const handleParsedItemValue = async (
|
|
8
|
-
parsedItem: Episode,
|
|
9
|
-
item: Item,
|
|
10
|
-
transactionalEntityManager: EntityManager
|
|
11
|
-
) => {
|
|
12
|
-
const itemValueService = new ItemValueService(transactionalEntityManager);
|
|
13
|
-
const itemValueDtos = compatItemValueDtos(parsedItem);
|
|
14
|
-
const itemValueRecipientService = new ItemValueRecipientService(transactionalEntityManager);
|
|
15
|
-
const itemValueTimeSplitService = new ItemValueTimeSplitService(transactionalEntityManager);
|
|
16
|
-
const itemValueTimeSplitRecipientService = new ItemValueTimeSplitRecipientService(transactionalEntityManager);
|
|
17
|
-
const itemValueTimeSplitRemoteItemService = new ItemValueTimeSplitRemoteItemService(transactionalEntityManager);
|
|
18
|
-
|
|
19
|
-
if (itemValueDtos.length > 0) {
|
|
20
|
-
for (const itemValueDto of itemValueDtos) {
|
|
21
|
-
const item_value = await itemValueService.update(item, itemValueDto.item_value);
|
|
22
|
-
|
|
23
|
-
const itemValueRecipientDtos = itemValueDto.item_value_recipients;
|
|
24
|
-
if (itemValueRecipientDtos.length > 0) {
|
|
25
|
-
for (const itemValueRecipientDto of itemValueRecipientDtos) {
|
|
26
|
-
await itemValueRecipientService.update(item_value, itemValueRecipientDto);
|
|
27
|
-
}
|
|
28
|
-
} else {
|
|
29
|
-
await itemValueRecipientService.deleteAll(item_value);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const itemValueTimeSplitDtos = itemValueDto.item_value_time_splits;
|
|
33
|
-
if (itemValueTimeSplitDtos.length > 0) {
|
|
34
|
-
for (const itemValueTimeSplitDto of itemValueTimeSplitDtos) {
|
|
35
|
-
const item_value_time_split = await itemValueTimeSplitService.update(item_value, itemValueTimeSplitDto.meta);
|
|
36
|
-
|
|
37
|
-
const itemValueTimeSplitRecipientDtos = itemValueTimeSplitDto.item_value_time_splits_recipients;
|
|
38
|
-
if (itemValueTimeSplitRecipientDtos.length > 0) {
|
|
39
|
-
for (const itemValueTimeSplitRecipientDto of itemValueTimeSplitRecipientDtos) {
|
|
40
|
-
await itemValueTimeSplitRecipientService.update(item_value_time_split, itemValueTimeSplitRecipientDto);
|
|
41
|
-
}
|
|
42
|
-
} else {
|
|
43
|
-
await itemValueTimeSplitRecipientService.deleteAll(item_value_time_split);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const itemValueTimeSplitRemoteItemDto = itemValueTimeSplitDto.item_value_time_splits_remote_item;
|
|
47
|
-
if (itemValueTimeSplitRemoteItemDto) {
|
|
48
|
-
await itemValueTimeSplitRemoteItemService.update(item_value_time_split, itemValueTimeSplitRemoteItemDto);
|
|
49
|
-
} else {
|
|
50
|
-
await itemValueTimeSplitRemoteItemService.deleteAll(item_value_time_split);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
} else {
|
|
54
|
-
await itemValueTimeSplitService.deleteAll(item_value);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
} else {
|
|
58
|
-
await itemValueService.deleteAll(item);
|
|
59
|
-
}
|
|
60
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { chunkArray } from "podverse-helpers";
|
|
2
|
-
import { Phase4PodcastLiveItem } from "podcast-partytime/dist/parser/phase/phase-4";
|
|
3
|
-
import { AppDataSource, Channel, ChannelSeasonIndex, ItemService, LiveItemService } from "podverse-orm";
|
|
4
|
-
import { compatLiveItemsDtos } from "@parser/lib/compat/partytime/liveItem";
|
|
5
|
-
import { handleParsedItem } from "../item/item";
|
|
6
|
-
|
|
7
|
-
export const handleParsedLiveItems = async (parsedLiveItems: Phase4PodcastLiveItem[], channel: Channel, channelSeasonIndex: ChannelSeasonIndex) => {
|
|
8
|
-
const itemService = new ItemService();
|
|
9
|
-
const existingLiveItems = await itemService.getAllItemsWithLiveItemByChannel(channel, { select: ['id'] });
|
|
10
|
-
const existingLiveItemIds = existingLiveItems.map(live_item => live_item.id);
|
|
11
|
-
const updatedLiveItemIds: number[] = [];
|
|
12
|
-
const liveItemObjDtos = compatLiveItemsDtos(parsedLiveItems);
|
|
13
|
-
|
|
14
|
-
const liveItemObjDtosBatchs = chunkArray(liveItemObjDtos, 100);
|
|
15
|
-
for (const liveItemObjDtosBatch of liveItemObjDtosBatchs) {
|
|
16
|
-
await AppDataSource.manager.transaction(async transactionalEntityManager => {
|
|
17
|
-
for (const liveItemObjDto of liveItemObjDtosBatch) {
|
|
18
|
-
// PTDO: how to make any unnecessary?
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
-
const itemDto = liveItemObjDto.item as any;
|
|
21
|
-
|
|
22
|
-
const item = await handleParsedItem(itemDto, channel, channelSeasonIndex, transactionalEntityManager);
|
|
23
|
-
updatedLiveItemIds.push(item.id);
|
|
24
|
-
|
|
25
|
-
const liveItemService = new LiveItemService();
|
|
26
|
-
const liveItemDto = liveItemObjDto.liveItem;
|
|
27
|
-
await liveItemService.update(item, liveItemDto);
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const itemIdsToDelete = existingLiveItemIds.filter(id => !updatedLiveItemIds.includes(id));
|
|
33
|
-
await itemService.deleteMany(itemIdsToDelete);
|
|
34
|
-
};
|
package/src/lib/rss/parser.ts
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { parseFeed } from 'podcast-partytime';
|
|
2
|
-
import { request } from 'podverse-helpers';
|
|
3
|
-
import { ChannelService, ChannelSeasonService, FeedLogService, FeedService } from 'podverse-orm';
|
|
4
|
-
import { handleParsedChannel } from "@parser/lib/rss/channel/channel";
|
|
5
|
-
import { handleParsedItems } from './item/item';
|
|
6
|
-
import { handleParsedChannelSeasons } from './channel/channelSeason';
|
|
7
|
-
import { handleParsedLiveItems } from './liveItem/liveItem';
|
|
8
|
-
import { handleGetRSSFeed, handleParsedFeed } from './feed/feed';
|
|
9
|
-
|
|
10
|
-
/*
|
|
11
|
-
NOTE: All RSS feeds that have a podcast_index_id will be saved to the database.
|
|
12
|
-
RSS feeds without podcast_index_id (Add By RSS feeds) will NOT be saved to the database.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
// TEMP: exists for development purposes
|
|
16
|
-
export const parseAllRSSFeeds = async () => {
|
|
17
|
-
const feedService = new FeedService();
|
|
18
|
-
const feeds = await feedService.getAll();
|
|
19
|
-
for (const feed of feeds) {
|
|
20
|
-
return await parseRSSFeedAndSaveToDatabase(feed.url, feed?.channel?.podcast_index_id);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const getAndParseRSSFeed = async (url: string) => {
|
|
25
|
-
const xml: string = await request(url);
|
|
26
|
-
const parsedFeed = parseFeed(xml, { allowMissingGuid: true });
|
|
27
|
-
|
|
28
|
-
if (!parsedFeed) {
|
|
29
|
-
throw new Error(`getAndParseRSSFeed: parsedFeed not found for ${url}`);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return parsedFeed;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
// export const parseRSSAddByRSSFeed = async (url: string) => {
|
|
36
|
-
// const parsedFeed = await getAndParseRSSFeed(url);
|
|
37
|
-
// const compatData = convertParsedRSSFeedToCompat(parsedFeed);
|
|
38
|
-
// return compatData;
|
|
39
|
-
// };
|
|
40
|
-
|
|
41
|
-
export const parseRSSFeedAndSaveToDatabase = async (url: string, podcast_index_id: number) => {
|
|
42
|
-
const feedService = new FeedService();
|
|
43
|
-
|
|
44
|
-
let feed = await feedService.getBy({ url, podcast_index_id });
|
|
45
|
-
if (!feed) {
|
|
46
|
-
throw new Error(`parseRSSFeedAndSaveToDatabase: feed not found for ${url}`);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const parsedFeed = await handleGetRSSFeed(feed);
|
|
50
|
-
feed = await handleParsedFeed(parsedFeed, url, podcast_index_id);
|
|
51
|
-
|
|
52
|
-
try {
|
|
53
|
-
await feedService.update(feed.id, { is_parsing: new Date() });
|
|
54
|
-
|
|
55
|
-
const channelService = new ChannelService();
|
|
56
|
-
const channel = await channelService.getOrCreateByPodcastIndexId({ feed, podcast_index_id });
|
|
57
|
-
|
|
58
|
-
// ChannelSeason must be parsed before anything else, because the channel season rows
|
|
59
|
-
// need to be created for other data to have a foreign key to them.
|
|
60
|
-
await handleParsedChannelSeasons(parsedFeed, channel);
|
|
61
|
-
const channelSeasonService = new ChannelSeasonService();
|
|
62
|
-
const channelSeasonIndex = await channelSeasonService.getChannelSeasonIndex(channel);
|
|
63
|
-
|
|
64
|
-
await handleParsedChannel(parsedFeed, channel, channelSeasonIndex);
|
|
65
|
-
|
|
66
|
-
// PTDO: if publisher feed, handle publisher remote item data
|
|
67
|
-
// else handle parsed items
|
|
68
|
-
await handleParsedItems(parsedFeed.items, channel, channelSeasonIndex);
|
|
69
|
-
|
|
70
|
-
if (parsedFeed.podcastLiveItems) {
|
|
71
|
-
await handleParsedLiveItems(parsedFeed.podcastLiveItems, channel, channelSeasonIndex);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// TODO: handle new item notifications
|
|
75
|
-
|
|
76
|
-
// TODO: handle new live_item notifications
|
|
77
|
-
|
|
78
|
-
const feedLogService = new FeedLogService();
|
|
79
|
-
await feedLogService.update(feed, { last_finished_parse_time: new Date() });
|
|
80
|
-
} finally {
|
|
81
|
-
await feedService.update(feed.id, { is_parsing: null });
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return feed;
|
|
85
|
-
};
|
package/tsconfig.json
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES6",
|
|
4
|
-
"module": "commonjs",
|
|
5
|
-
"strict": true,
|
|
6
|
-
"noImplicitAny": true,
|
|
7
|
-
"esModuleInterop": true,
|
|
8
|
-
"experimentalDecorators": true,
|
|
9
|
-
"emitDecoratorMetadata": true,
|
|
10
|
-
"skipLibCheck": true,
|
|
11
|
-
"declaration": true,
|
|
12
|
-
"declarationMap": true,
|
|
13
|
-
"forceConsistentCasingInFileNames": true,
|
|
14
|
-
"outDir": "./dist",
|
|
15
|
-
"rootDir": "./src",
|
|
16
|
-
"baseUrl": "./",
|
|
17
|
-
"paths": {
|
|
18
|
-
"@parser/*": ["src/*"]
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"include": [
|
|
22
|
-
"./src/**/*.ts"
|
|
23
|
-
],
|
|
24
|
-
"exclude": ["node_modules"]
|
|
25
|
-
}
|