podverse-parser 5.0.8 → 5.1.0-alpha.0

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 (129) hide show
  1. package/dist/config/index.d.ts +11 -0
  2. package/dist/config/index.d.ts.map +1 -0
  3. package/dist/config/index.js +13 -0
  4. package/dist/factories/podcastIndex.d.ts +3 -0
  5. package/dist/factories/podcastIndex.d.ts.map +1 -0
  6. package/dist/factories/podcastIndex.js +9 -0
  7. package/dist/index.d.ts +2 -1
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +3 -2
  10. package/dist/lib/chapters/chapters.d.ts.map +1 -1
  11. package/dist/lib/compat/chapters/chapters.d.ts.map +1 -1
  12. package/dist/lib/compat/chapters/chapters.js +3 -2
  13. package/dist/lib/compat/partytime/channel.d.ts +6 -3
  14. package/dist/lib/compat/partytime/channel.d.ts.map +1 -1
  15. package/dist/lib/compat/partytime/channel.js +48 -37
  16. package/dist/lib/compat/partytime/item.d.ts +30 -9
  17. package/dist/lib/compat/partytime/item.d.ts.map +1 -1
  18. package/dist/lib/compat/partytime/item.js +66 -35
  19. package/dist/lib/compat/partytime/liveItem.d.ts.map +1 -1
  20. package/dist/lib/compat/partytime/liveItem.js +8 -1
  21. package/dist/lib/compat/partytime/value.d.ts.map +1 -1
  22. package/dist/lib/compat/partytime/value.js +1 -1
  23. package/dist/lib/notifications/index.d.ts +8 -0
  24. package/dist/lib/notifications/index.d.ts.map +1 -0
  25. package/dist/lib/notifications/index.js +48 -0
  26. package/dist/lib/rss/base/handleParsedManyData.d.ts.map +1 -1
  27. package/dist/lib/rss/base/handleParsedOneData.d.ts.map +1 -1
  28. package/dist/lib/rss/channel/channel.d.ts.map +1 -1
  29. package/dist/lib/rss/channel/channel.js +32 -27
  30. package/dist/lib/rss/channel/channelAbout.d.ts +1 -1
  31. package/dist/lib/rss/channel/channelAbout.d.ts.map +1 -1
  32. package/dist/lib/rss/channel/channelAbout.js +3 -0
  33. package/dist/lib/rss/channel/channelCategory.d.ts +4 -0
  34. package/dist/lib/rss/channel/channelCategory.d.ts.map +1 -0
  35. package/dist/lib/rss/channel/channelCategory.js +28 -0
  36. package/dist/lib/rss/channel/channelChat.d.ts +1 -1
  37. package/dist/lib/rss/channel/channelChat.d.ts.map +1 -1
  38. package/dist/lib/rss/channel/channelChat.js +3 -0
  39. package/dist/lib/rss/channel/channelDescription.d.ts +1 -1
  40. package/dist/lib/rss/channel/channelDescription.d.ts.map +1 -1
  41. package/dist/lib/rss/channel/channelDescription.js +3 -0
  42. package/dist/lib/rss/channel/channelFunding.d.ts +1 -1
  43. package/dist/lib/rss/channel/channelFunding.d.ts.map +1 -1
  44. package/dist/lib/rss/channel/channelFunding.js +3 -0
  45. package/dist/lib/rss/channel/channelImage.d.ts +1 -1
  46. package/dist/lib/rss/channel/channelImage.d.ts.map +1 -1
  47. package/dist/lib/rss/channel/channelImage.js +3 -0
  48. package/dist/lib/rss/channel/channelLicense.d.ts +1 -1
  49. package/dist/lib/rss/channel/channelLicense.d.ts.map +1 -1
  50. package/dist/lib/rss/channel/channelLicense.js +3 -0
  51. package/dist/lib/rss/channel/channelLocation.d.ts +1 -1
  52. package/dist/lib/rss/channel/channelLocation.d.ts.map +1 -1
  53. package/dist/lib/rss/channel/channelLocation.js +3 -0
  54. package/dist/lib/rss/channel/channelPerson.d.ts +1 -1
  55. package/dist/lib/rss/channel/channelPerson.d.ts.map +1 -1
  56. package/dist/lib/rss/channel/channelPerson.js +3 -0
  57. package/dist/lib/rss/channel/channelPodroll.d.ts +1 -1
  58. package/dist/lib/rss/channel/channelPodroll.d.ts.map +1 -1
  59. package/dist/lib/rss/channel/channelPodroll.js +3 -0
  60. package/dist/lib/rss/channel/channelPublisher.d.ts +4 -0
  61. package/dist/lib/rss/channel/channelPublisher.d.ts.map +1 -0
  62. package/dist/lib/rss/channel/channelPublisher.js +31 -0
  63. package/dist/lib/rss/channel/channelRemoteItem.d.ts +1 -1
  64. package/dist/lib/rss/channel/channelRemoteItem.d.ts.map +1 -1
  65. package/dist/lib/rss/channel/channelRemoteItem.js +3 -0
  66. package/dist/lib/rss/channel/channelSeason.d.ts.map +1 -1
  67. package/dist/lib/rss/channel/channelSeason.js +3 -0
  68. package/dist/lib/rss/channel/channelSocialInteract.d.ts +1 -1
  69. package/dist/lib/rss/channel/channelSocialInteract.d.ts.map +1 -1
  70. package/dist/lib/rss/channel/channelSocialInteract.js +3 -0
  71. package/dist/lib/rss/channel/channelTrailer.d.ts +1 -1
  72. package/dist/lib/rss/channel/channelTrailer.d.ts.map +1 -1
  73. package/dist/lib/rss/channel/channelTrailer.js +4 -1
  74. package/dist/lib/rss/channel/channelTxt.d.ts +1 -1
  75. package/dist/lib/rss/channel/channelTxt.d.ts.map +1 -1
  76. package/dist/lib/rss/channel/channelTxt.js +3 -0
  77. package/dist/lib/rss/channel/channelValue.d.ts +1 -1
  78. package/dist/lib/rss/channel/channelValue.d.ts.map +1 -1
  79. package/dist/lib/rss/channel/channelValue.js +3 -0
  80. package/dist/lib/rss/feed/feed.d.ts +2 -1
  81. package/dist/lib/rss/feed/feed.d.ts.map +1 -1
  82. package/dist/lib/rss/feed/feed.js +33 -14
  83. package/dist/lib/rss/hash/parsedFeed.d.ts.map +1 -1
  84. package/dist/lib/rss/item/item.d.ts +36 -3
  85. package/dist/lib/rss/item/item.d.ts.map +1 -1
  86. package/dist/lib/rss/item/item.js +153 -22
  87. package/dist/lib/rss/item/itemAbout.d.ts +1 -1
  88. package/dist/lib/rss/item/itemAbout.d.ts.map +1 -1
  89. package/dist/lib/rss/item/itemChaptersFeed.d.ts +1 -1
  90. package/dist/lib/rss/item/itemChaptersFeed.d.ts.map +1 -1
  91. package/dist/lib/rss/item/itemChat.d.ts +1 -1
  92. package/dist/lib/rss/item/itemChat.d.ts.map +1 -1
  93. package/dist/lib/rss/item/itemDescription.d.ts +1 -1
  94. package/dist/lib/rss/item/itemDescription.d.ts.map +1 -1
  95. package/dist/lib/rss/item/itemEnclosure.d.ts +1 -1
  96. package/dist/lib/rss/item/itemEnclosure.d.ts.map +1 -1
  97. package/dist/lib/rss/item/itemImage.d.ts +1 -1
  98. package/dist/lib/rss/item/itemImage.d.ts.map +1 -1
  99. package/dist/lib/rss/item/itemLicense.d.ts +1 -1
  100. package/dist/lib/rss/item/itemLicense.d.ts.map +1 -1
  101. package/dist/lib/rss/item/itemLocation.d.ts +1 -1
  102. package/dist/lib/rss/item/itemLocation.d.ts.map +1 -1
  103. package/dist/lib/rss/item/itemPerson.d.ts +1 -1
  104. package/dist/lib/rss/item/itemPerson.d.ts.map +1 -1
  105. package/dist/lib/rss/item/itemSeason.d.ts +1 -1
  106. package/dist/lib/rss/item/itemSeason.d.ts.map +1 -1
  107. package/dist/lib/rss/item/itemSeasonEpisode.d.ts +1 -1
  108. package/dist/lib/rss/item/itemSeasonEpisode.d.ts.map +1 -1
  109. package/dist/lib/rss/item/itemSocialInteract.d.ts +1 -1
  110. package/dist/lib/rss/item/itemSocialInteract.d.ts.map +1 -1
  111. package/dist/lib/rss/item/itemSoundbite.d.ts +1 -1
  112. package/dist/lib/rss/item/itemSoundbite.d.ts.map +1 -1
  113. package/dist/lib/rss/item/itemTranscript.d.ts +1 -1
  114. package/dist/lib/rss/item/itemTranscript.d.ts.map +1 -1
  115. package/dist/lib/rss/item/itemTxt.d.ts +1 -1
  116. package/dist/lib/rss/item/itemTxt.d.ts.map +1 -1
  117. package/dist/lib/rss/item/itemValue.d.ts +2 -2
  118. package/dist/lib/rss/item/itemValue.d.ts.map +1 -1
  119. package/dist/lib/rss/item/itemValue.js +7 -1
  120. package/dist/lib/rss/liveItem/liveItem.d.ts +4 -1
  121. package/dist/lib/rss/liveItem/liveItem.d.ts.map +1 -1
  122. package/dist/lib/rss/liveItem/liveItem.js +45 -14
  123. package/dist/lib/rss/parser.d.ts +1 -2
  124. package/dist/lib/rss/parser.d.ts.map +1 -1
  125. package/dist/lib/rss/parser.js +52 -49
  126. package/dist/lib/rss/remoteItemParser.d.ts +3 -0
  127. package/dist/lib/rss/remoteItemParser.d.ts.map +1 -0
  128. package/dist/lib/rss/remoteItemParser.js +121 -0
  129. package/package.json +5 -4
@@ -10,12 +10,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.handleParsedChannelRemoteItem = void 0;
13
+ const podverse_helpers_1 = require("podverse-helpers");
13
14
  const podverse_orm_1 = require("podverse-orm");
14
15
  const channel_1 = require("@parser/lib/compat/partytime/channel");
15
16
  const handleParsedManyData_1 = require("../base/handleParsedManyData");
16
17
  const handleParsedChannelRemoteItem = (parsedFeed, channel, transactionalEntityManager) => __awaiter(void 0, void 0, void 0, function* () {
18
+ podverse_helpers_1.timerManager.start("handleParsedChannelRemoteItem");
17
19
  const channelRemoteItemService = new podverse_orm_1.ChannelRemoteItemService(transactionalEntityManager);
18
20
  const channelRemoteItemDtos = (0, channel_1.compatChannelRemoteItemDtos)(parsedFeed);
19
21
  yield (0, handleParsedManyData_1.handleParsedManyData)(channel, channelRemoteItemService, channelRemoteItemDtos);
22
+ podverse_helpers_1.timerManager.end("handleParsedChannelRemoteItem");
20
23
  });
21
24
  exports.handleParsedChannelRemoteItem = handleParsedChannelRemoteItem;
@@ -1 +1 @@
1
- {"version":3,"file":"channelSeason.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/channel/channelSeason.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAwB,MAAM,cAAc,CAAC;AAG7D,eAAO,MAAM,0BAA0B,eAAsB,UAAU,WAAW,OAAO,KAAG,OAAO,CAAC,IAAI,CASvG,CAAC"}
1
+ {"version":3,"file":"channelSeason.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/channel/channelSeason.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAwB,MAAM,cAAc,CAAC;AAG7D,eAAO,MAAM,0BAA0B,GAAU,YAAY,UAAU,EAAE,SAAS,OAAO,KAAG,OAAO,CAAC,IAAI,CAWvG,CAAC"}
@@ -10,9 +10,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.handleParsedChannelSeasons = void 0;
13
+ const podverse_helpers_1 = require("podverse-helpers");
13
14
  const podverse_orm_1 = require("podverse-orm");
14
15
  const channel_1 = require("@parser/lib/compat/partytime/channel");
15
16
  const handleParsedChannelSeasons = (parsedFeed, channel) => __awaiter(void 0, void 0, void 0, function* () {
17
+ podverse_helpers_1.timerManager.start('handleParsedChannelSeasons');
16
18
  const channelSeasonService = new podverse_orm_1.ChannelSeasonService();
17
19
  const channelSeasonDtos = (0, channel_1.compatChannelSeasonDtos)(parsedFeed);
18
20
  if (channelSeasonDtos.length > 0) {
@@ -21,5 +23,6 @@ const handleParsedChannelSeasons = (parsedFeed, channel) => __awaiter(void 0, vo
21
23
  else {
22
24
  yield channelSeasonService.deleteAll(channel);
23
25
  }
26
+ podverse_helpers_1.timerManager.end('handleParsedChannelSeasons');
24
27
  });
25
28
  exports.handleParsedChannelSeasons = handleParsedChannelSeasons;
@@ -1,4 +1,4 @@
1
1
  import { FeedObject } from "podcast-partytime";
2
2
  import { Channel, EntityManager } from "podverse-orm";
3
- export declare const handleParsedChannelSocialInteract: (parsedFeed: FeedObject, channel: Channel, transactionalEntityManager: EntityManager) => Promise<void>;
3
+ export declare const handleParsedChannelSocialInteract: (parsedFeed: FeedObject, channel: Channel, transactionalEntityManager?: EntityManager) => Promise<void>;
4
4
  //# sourceMappingURL=channelSocialInteract.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"channelSocialInteract.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/channel/channelSocialInteract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAgC,aAAa,EAAE,MAAM,cAAc,CAAC;AAIpF,eAAO,MAAM,iCAAiC,eAChC,UAAU,WACb,OAAO,8BACY,aAAa,kBAK1C,CAAC"}
1
+ {"version":3,"file":"channelSocialInteract.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/channel/channelSocialInteract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAgC,aAAa,EAAE,MAAM,cAAc,CAAC;AAIpF,eAAO,MAAM,iCAAiC,GAC5C,YAAY,UAAU,EACtB,SAAS,OAAO,EAChB,6BAA6B,aAAa,kBAO3C,CAAC"}
@@ -10,12 +10,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.handleParsedChannelSocialInteract = void 0;
13
+ const podverse_helpers_1 = require("podverse-helpers");
13
14
  const podverse_orm_1 = require("podverse-orm");
14
15
  const channel_1 = require("@parser/lib/compat/partytime/channel");
15
16
  const handleParsedManyData_1 = require("../base/handleParsedManyData");
16
17
  const handleParsedChannelSocialInteract = (parsedFeed, channel, transactionalEntityManager) => __awaiter(void 0, void 0, void 0, function* () {
18
+ podverse_helpers_1.timerManager.start("handleParsedChannelSocialInteract");
17
19
  const channelSocialInteractService = new podverse_orm_1.ChannelSocialInteractService(transactionalEntityManager);
18
20
  const channelSocialInteractDtos = (0, channel_1.compatChannelSocialInteractDtos)(parsedFeed);
19
21
  yield (0, handleParsedManyData_1.handleParsedManyData)(channel, channelSocialInteractService, channelSocialInteractDtos);
22
+ podverse_helpers_1.timerManager.end("handleParsedChannelSocialInteract");
20
23
  });
21
24
  exports.handleParsedChannelSocialInteract = handleParsedChannelSocialInteract;
@@ -1,4 +1,4 @@
1
1
  import { FeedObject } from "podcast-partytime";
2
2
  import { Channel, ChannelSeason, EntityManager } from "podverse-orm";
3
- export declare const handleParsedChannelTrailer: (parsedFeed: FeedObject, channel: Channel, channelSeasonIndex: Record<number, ChannelSeason>, transactionalEntityManager: EntityManager) => Promise<void>;
3
+ export declare const handleParsedChannelTrailer: (parsedFeed: FeedObject, channel: Channel, channelSeasonIndex: Record<number, ChannelSeason>, transactionalEntityManager?: EntityManager) => Promise<void>;
4
4
  //# sourceMappingURL=channelTrailer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"channelTrailer.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/channel/channelTrailer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,aAAa,EAA4C,aAAa,EAAE,MAAM,cAAc,CAAC;AAG/G,eAAO,MAAM,0BAA0B,eACzB,UAAU,WACb,OAAO,sBACI,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,8BACrB,aAAa,kBAsB1C,CAAC"}
1
+ {"version":3,"file":"channelTrailer.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/channel/channelTrailer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,aAAa,EAA4C,aAAa,EAAE,MAAM,cAAc,CAAC;AAG/G,eAAO,MAAM,0BAA0B,GACrC,YAAY,UAAU,EACtB,SAAS,OAAO,EAChB,oBAAoB,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EACjD,6BAA6B,aAAa,kBAwB3C,CAAC"}
@@ -10,16 +10,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.handleParsedChannelTrailer = void 0;
13
+ const podverse_helpers_1 = require("podverse-helpers");
13
14
  const podverse_orm_1 = require("podverse-orm");
14
15
  const channel_1 = require("@parser/lib/compat/partytime/channel");
15
16
  const handleParsedChannelTrailer = (parsedFeed, channel, channelSeasonIndex, transactionalEntityManager) => __awaiter(void 0, void 0, void 0, function* () {
17
+ podverse_helpers_1.timerManager.start("handleParsedChannelTrailer");
16
18
  const channelTrailerService = new podverse_orm_1.ChannelTrailerService(transactionalEntityManager);
17
19
  const channelTrailerDtos = (0, channel_1.compatChannelTrailerDtos)(parsedFeed);
18
20
  const enrichedChannelTrailerDtos = channelTrailerDtos.map((channelTrailerDto) => {
19
21
  const channel_season = channelTrailerDto.season ? channelSeasonIndex[channelTrailerDto.season] : null;
20
22
  return {
21
23
  url: channelTrailerDto.url,
22
- pubdate: channelTrailerDto.pubdate,
24
+ pub_date: channelTrailerDto.pub_date,
23
25
  title: channelTrailerDto.title,
24
26
  length: channelTrailerDto.length,
25
27
  type: channelTrailerDto.type,
@@ -32,5 +34,6 @@ const handleParsedChannelTrailer = (parsedFeed, channel, channelSeasonIndex, tra
32
34
  else {
33
35
  yield channelTrailerService.deleteAll(channel);
34
36
  }
37
+ podverse_helpers_1.timerManager.end("handleParsedChannelTrailer");
35
38
  });
36
39
  exports.handleParsedChannelTrailer = handleParsedChannelTrailer;
@@ -1,4 +1,4 @@
1
1
  import { FeedObject } from "podcast-partytime";
2
2
  import { Channel, EntityManager } from "podverse-orm";
3
- export declare const handleParsedChannelTxt: (parsedFeed: FeedObject, channel: Channel, transactionalEntityManager: EntityManager) => Promise<void>;
3
+ export declare const handleParsedChannelTxt: (parsedFeed: FeedObject, channel: Channel, transactionalEntityManager?: EntityManager) => Promise<void>;
4
4
  //# sourceMappingURL=channelTxt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"channelTxt.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/channel/channelTxt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAqB,aAAa,EAAE,MAAM,cAAc,CAAC;AAIzE,eAAO,MAAM,sBAAsB,eACrB,UAAU,WACb,OAAO,8BACY,aAAa,kBAK1C,CAAC"}
1
+ {"version":3,"file":"channelTxt.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/channel/channelTxt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAqB,aAAa,EAAE,MAAM,cAAc,CAAC;AAIzE,eAAO,MAAM,sBAAsB,GACjC,YAAY,UAAU,EACtB,SAAS,OAAO,EAChB,6BAA6B,aAAa,kBAO3C,CAAC"}
@@ -10,12 +10,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.handleParsedChannelTxt = void 0;
13
+ const podverse_helpers_1 = require("podverse-helpers");
13
14
  const podverse_orm_1 = require("podverse-orm");
14
15
  const channel_1 = require("@parser/lib/compat/partytime/channel");
15
16
  const handleParsedManyData_1 = require("../base/handleParsedManyData");
16
17
  const handleParsedChannelTxt = (parsedFeed, channel, transactionalEntityManager) => __awaiter(void 0, void 0, void 0, function* () {
18
+ podverse_helpers_1.timerManager.start("handleParsedChannelTxt");
17
19
  const channelTxtService = new podverse_orm_1.ChannelTxtService(transactionalEntityManager);
18
20
  const channelTxtDtos = (0, channel_1.compatChannelTxtDtos)(parsedFeed);
19
21
  yield (0, handleParsedManyData_1.handleParsedManyData)(channel, channelTxtService, channelTxtDtos);
22
+ podverse_helpers_1.timerManager.end("handleParsedChannelTxt");
20
23
  });
21
24
  exports.handleParsedChannelTxt = handleParsedChannelTxt;
@@ -1,4 +1,4 @@
1
1
  import { FeedObject } from "podcast-partytime";
2
2
  import { Channel, EntityManager } from "podverse-orm";
3
- export declare const handleParsedChannelValue: (parsedFeed: FeedObject, channel: Channel, transactionalEntityManager: EntityManager) => Promise<void>;
3
+ export declare const handleParsedChannelValue: (parsedFeed: FeedObject, channel: Channel, transactionalEntityManager?: EntityManager) => Promise<void>;
4
4
  //# sourceMappingURL=channelValue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"channelValue.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/channel/channelValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAqD,aAAa,EAAE,MAAM,cAAc,CAAC;AAGzG,eAAO,MAAM,wBAAwB,eACvB,UAAU,WACb,OAAO,8BACY,aAAa,kBAsB1C,CAAC"}
1
+ {"version":3,"file":"channelValue.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/channel/channelValue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAqD,aAAa,EAAE,MAAM,cAAc,CAAC;AAGzG,eAAO,MAAM,wBAAwB,GACnC,YAAY,UAAU,EACtB,SAAS,OAAO,EAChB,6BAA6B,aAAa,kBAwB3C,CAAC"}
@@ -10,9 +10,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.handleParsedChannelValue = void 0;
13
+ const podverse_helpers_1 = require("podverse-helpers");
13
14
  const podverse_orm_1 = require("podverse-orm");
14
15
  const channel_1 = require("@parser/lib/compat/partytime/channel");
15
16
  const handleParsedChannelValue = (parsedFeed, channel, transactionalEntityManager) => __awaiter(void 0, void 0, void 0, function* () {
17
+ podverse_helpers_1.timerManager.start("handleParsedChannelValue");
16
18
  const channelValueService = new podverse_orm_1.ChannelValueService(transactionalEntityManager);
17
19
  const channelValueDtos = (0, channel_1.compatChannelValueDtos)(parsedFeed);
18
20
  const channelValueRecipientService = new podverse_orm_1.ChannelValueRecipientService(transactionalEntityManager);
@@ -33,5 +35,6 @@ const handleParsedChannelValue = (parsedFeed, channel, transactionalEntityManage
33
35
  else {
34
36
  yield channelValueService.deleteAll(channel);
35
37
  }
38
+ podverse_helpers_1.timerManager.end("handleParsedChannelValue");
36
39
  });
37
40
  exports.handleParsedChannelValue = handleParsedChannelValue;
@@ -1,5 +1,6 @@
1
1
  import { FeedObject } from "podcast-partytime";
2
2
  import { Feed } from "podverse-orm";
3
- export declare const handleGetRSSFeed: (feed: Feed) => Promise<FeedObject>;
3
+ export declare const handleGetRSSFeed: (url: string, podcast_index_id: number) => Promise<Feed>;
4
+ export declare const handleRequestRSSFeed: (feed: Feed) => Promise<FeedObject>;
4
5
  export declare const handleParsedFeed: (parsedFeed: FeedObject, feed: Feed) => Promise<Feed>;
5
6
  //# sourceMappingURL=feed.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"feed.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/feed/feed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAoC,IAAI,EAA+B,MAAM,cAAc,CAAC;AAInG,eAAO,MAAM,gBAAgB,SAAgB,IAAI,KAAG,OAAO,CAAC,UAAU,CAmCrE,CAAC;AAEF,eAAO,MAAM,gBAAgB,eAAsB,UAAU,QAAQ,IAAI,KAAG,OAAO,CAAC,IAAI,CAiBvF,CAAC"}
1
+ {"version":3,"file":"feed.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/feed/feed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,OAAO,EAAE,IAAI,EAA+B,MAAM,cAAc,CAAC;AAKjE,eAAO,MAAM,gBAAgB,GAAU,KAAK,MAAM,EAAE,kBAAkB,MAAM,KAAG,OAAO,CAAC,IAAI,CA0B1F,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAU,MAAM,IAAI,KAAG,OAAO,CAAC,UAAU,CAsCzE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAU,YAAY,UAAU,EAAE,MAAM,IAAI,KAAG,OAAO,CAAC,IAAI,CAYvF,CAAC"}
@@ -9,12 +9,35 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.handleParsedFeed = exports.handleGetRSSFeed = void 0;
12
+ exports.handleParsedFeed = exports.handleRequestRSSFeed = exports.handleGetRSSFeed = void 0;
13
13
  const podverse_helpers_1 = require("podverse-helpers");
14
14
  const podverse_orm_1 = require("podverse-orm");
15
+ const config_1 = require("@parser/config");
15
16
  const parsedFeed_1 = require("../hash/parsedFeed");
16
17
  const parser_1 = require("../parser");
17
- const handleGetRSSFeed = (feed) => __awaiter(void 0, void 0, void 0, function* () {
18
+ const handleGetRSSFeed = (url, podcast_index_id) => __awaiter(void 0, void 0, void 0, function* () {
19
+ podverse_helpers_1.timerManager.start('handleGetRSSFeed');
20
+ const feedService = new podverse_orm_1.FeedService();
21
+ let feed = yield feedService.getByUrlAndPodcastIndexId({ url, podcast_index_id });
22
+ if (!feed) {
23
+ feed = yield feedService.getByPodcastIndexId({ podcast_index_id });
24
+ if (feed) {
25
+ feed.url = url;
26
+ yield feedService.update(feed.id, { url });
27
+ }
28
+ }
29
+ if (!feed) {
30
+ feed = yield feedService.getOrCreate({ url, podcast_index_id });
31
+ }
32
+ podverse_helpers_1.timerManager.end('handleGetRSSFeed');
33
+ if (!feed) {
34
+ throw new Error(`parseRSSFeedAndSaveToDatabase: feed not found for ${url}`);
35
+ }
36
+ return feed;
37
+ });
38
+ exports.handleGetRSSFeed = handleGetRSSFeed;
39
+ const handleRequestRSSFeed = (feed) => __awaiter(void 0, void 0, void 0, function* () {
40
+ podverse_helpers_1.timerManager.start('handleRequestRSSFeed');
18
41
  const feedLogService = new podverse_orm_1.FeedLogService();
19
42
  let parsedFeed = null;
20
43
  try {
@@ -46,18 +69,17 @@ const handleGetRSSFeed = (feed) => __awaiter(void 0, void 0, void 0, function* (
46
69
  });
47
70
  return (0, podverse_helpers_1.throwRequestError)('parsedFeed no data found');
48
71
  }
72
+ podverse_helpers_1.timerManager.end('handleRequestRSSFeed');
49
73
  return parsedFeed;
50
74
  });
51
- exports.handleGetRSSFeed = handleGetRSSFeed;
75
+ exports.handleRequestRSSFeed = handleRequestRSSFeed;
52
76
  const handleParsedFeed = (parsedFeed, feed) => __awaiter(void 0, void 0, void 0, function* () {
53
- // TODO: move before partytime parsing
54
- if (!(0, podverse_orm_1.checkIfFeedFlagStatusShouldParse)(feed.feed_flag_status.id)) {
55
- throw new Error(`parseRSSFeedAndSaveToDatabase: feed_flag_status.status is not None or AlwaysAllow for ${feed.id} ${feed.channel.podcast_index_id} ${feed.url}`);
56
- }
57
- checkIfFeedIsParsing(feed);
58
77
  const currentFeedFileHash = (0, parsedFeed_1.getParsedFeedMd5Hash)(parsedFeed);
59
- if (feed.last_parsed_file_hash === currentFeedFileHash) {
60
- throw new Error(`Feed ${feed.id} has no changes since last parsed.`);
78
+ if (config_1.config.nodeEnv === 'production') {
79
+ checkIfFeedIsParsing(feed);
80
+ if (feed.last_parsed_file_hash === currentFeedFileHash) {
81
+ throw new Error(`Feed ${feed.id} has no changes since last parsed.`);
82
+ }
61
83
  }
62
84
  const feedService = new podverse_orm_1.FeedService();
63
85
  return feedService.update(feed.id, { last_parsed_file_hash: currentFeedFileHash });
@@ -69,10 +91,7 @@ const checkIfFeedIsParsing = (feed) => {
69
91
  const parsingDate = new Date(feed.is_parsing);
70
92
  const currentDate = new Date();
71
93
  const timeDifference = (currentDate.getTime() - parsingDate.getTime()) / (1000 * 60);
72
- if (isNaN(parsingDate.getTime())) {
73
- throw new Error(`Feed ${feed.id} has an invalid parsing date`);
74
- }
75
- if (timeDifference <= 30) {
94
+ if (timeDifference <= 15) {
76
95
  throw new Error(`Feed ${feed.id} is already parsing`);
77
96
  }
78
97
  }
@@ -1 +1 @@
1
- {"version":3,"file":"parsedFeed.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/hash/parsedFeed.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,eAAO,MAAM,oBAAoB,eAAgB,UAAU,KAAG,MAK7D,CAAC"}
1
+ {"version":3,"file":"parsedFeed.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/hash/parsedFeed.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,eAAO,MAAM,oBAAoB,GAAI,YAAY,UAAU,KAAG,MAK7D,CAAC"}
@@ -1,5 +1,38 @@
1
1
  import { Episode } from "podcast-partytime";
2
- import { Channel, ChannelSeasonIndex, EntityManager } from "podverse-orm";
3
- export declare const handleParsedItems: (parsedItems: Episode[], channel: Channel, channelSeasonIndex: ChannelSeasonIndex) => Promise<void>;
4
- export declare const handleParsedItem: (parsedItem: Episode, channel: Channel, channelSeasonIndex: ChannelSeasonIndex, transactionalEntityManager: EntityManager) => Promise<Item>;
2
+ import { Channel, ChannelSeasonIndex } from "podverse-orm";
3
+ type ItemTimerAccumulator = {
4
+ updateItem: number;
5
+ handleParsedItemAbout: number;
6
+ handleParsedItemChaptersFeed: number;
7
+ handleParsedItemChat: number;
8
+ handleParsedItemDescription: number;
9
+ handleParsedItemEnclosure: number;
10
+ handleParsedItemImage: number;
11
+ handleParsedItemLicense: number;
12
+ handleParsedItemLocation: number;
13
+ handleParsedItemPerson: number;
14
+ handleParsedItemSeason: number;
15
+ handleParsedItemSeasonEpisode: number;
16
+ handleParsedItemSocialInteract: number;
17
+ handleParsedItemSoundbite: number;
18
+ handleParsedItemTranscript: number;
19
+ handleParsedItemTxt: number;
20
+ handleParsedItemValue: number;
21
+ };
22
+ type HandleParsedItem = {
23
+ parsedItem: any;
24
+ channel: Channel;
25
+ channelSeasonIndex: ChannelSeasonIndex;
26
+ transactionalEntityManager?: any;
27
+ timerAccumulator: ItemTimerAccumulator;
28
+ isLiveItem?: boolean;
29
+ };
30
+ export declare const createItemTimerAccumulator: () => ItemTimerAccumulator;
31
+ export type HandleParsedItemsResult = {
32
+ newItemGuids: string[];
33
+ newItemGuidEnclosureUrls: string[];
34
+ };
35
+ export declare const handleParsedItems: (parsedItems: Episode[], channel: Channel, channelSeasonIndex: ChannelSeasonIndex) => Promise<HandleParsedItemsResult>;
36
+ export declare const handleParsedItem: ({ parsedItem, channel, channelSeasonIndex, transactionalEntityManager, timerAccumulator, isLiveItem }: HandleParsedItem) => Promise<Item>;
37
+ export {};
5
38
  //# sourceMappingURL=item.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/item/item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAiB,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAe,MAAM,cAAc,CAAC;AA+BtG,eAAO,MAAM,iBAAiB,gBAAuB,OAAO,EAAE,WAAW,OAAO,sBAAsB,kBAAkB,kBAyBvH,CAAC;AAEF,eAAO,MAAM,gBAAgB,eACf,OAAO,WACV,OAAO,sBACI,kBAAkB,8BACV,aAAa,kBAkC1C,CAAC"}
1
+ {"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/item/item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAA0B,OAAO,EAAE,kBAAkB,EAAe,MAAM,cAAc,CAAC;AA2ChG,KAAK,oBAAoB,GAAG;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,4BAA4B,EAAE,MAAM,CAAC;IACrC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,2BAA2B,EAAE,MAAM,CAAC;IACpC,yBAAyB,EAAE,MAAM,CAAC;IAClC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,uBAAuB,EAAE,MAAM,CAAC;IAChC,wBAAwB,EAAE,MAAM,CAAC;IACjC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,6BAA6B,EAAE,MAAM,CAAC;IACtC,8BAA8B,EAAE,MAAM,CAAC;IACvC,yBAAyB,EAAE,MAAM,CAAC;IAClC,0BAA0B,EAAE,MAAM,CAAC;IACnC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,qBAAqB,EAAE,MAAM,CAAC;CAC/B,CAAC;AAWF,KAAK,gBAAgB,GAAG;IACtB,UAAU,EAAE,GAAG,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;IAChB,kBAAkB,EAAE,kBAAkB,CAAA;IACtC,0BAA0B,CAAC,EAAE,GAAG,CAAA;IAChC,gBAAgB,EAAE,oBAAoB,CAAA;IACtC,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAC;AAEF,eAAO,MAAM,0BAA0B,QAAO,oBAqB7C,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,wBAAwB,EAAE,MAAM,EAAE,CAAA;CACnC,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAU,aAAa,OAAO,EAAE,EAAE,SAAS,OAAO,EAAE,oBAAoB,kBAAkB,KAAG,OAAO,CAAC,uBAAuB,CAqEzJ,CAAC;AAwCF,eAAO,MAAM,gBAAgB,GAAU,uGAOpC,gBAAgB,kBAoFlB,CAAC"}
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.handleParsedItem = exports.handleParsedItems = void 0;
12
+ exports.handleParsedItem = exports.handleParsedItems = exports.createItemTimerAccumulator = void 0;
13
13
  const podverse_helpers_1 = require("podverse-helpers");
14
14
  const podverse_orm_1 = require("podverse-orm");
15
15
  const item_1 = require("@parser/lib/compat/partytime/item");
@@ -29,43 +29,148 @@ const itemTranscript_1 = require("@parser/lib/rss/item/itemTranscript");
29
29
  const itemTxt_1 = require("@parser/lib/rss/item/itemTxt");
30
30
  const itemValue_1 = require("@parser/lib/rss/item/itemValue");
31
31
  const itemChat_1 = require("@parser/lib/rss/item/itemChat");
32
- const removeDuplicates = (parsedItems) => {
33
- const seen = new Set();
34
- return parsedItems.reduce((acc, item) => {
35
- const enclosureUrl = item.enclosure.url.slice(0, podverse_helpers_1.DATABASE_CONSTANTS.varchar_url);
36
- if (!seen.has(enclosureUrl)) {
37
- seen.add(enclosureUrl);
38
- acc.push(item);
32
+ const config_1 = require("@parser/config");
33
+ const itemFlagStatus_1 = require("podverse-orm/dist/entities/item/itemFlagStatus");
34
+ const removeInvalidItems = (parsedItems) => {
35
+ const seenEnclosureUrls = new Set();
36
+ const seenGuids = new Set();
37
+ const validUrlPattern = /^https?:\/\//;
38
+ return parsedItems.reduce((acc, parsedItem) => {
39
+ const enclosureUrl = parsedItem.enclosure.url.slice(0, podverse_helpers_1.DATABASE_CONSTANTS.varchar_url);
40
+ const guid = parsedItem.guid;
41
+ if (!validUrlPattern.test(enclosureUrl)) {
42
+ return acc;
43
+ }
44
+ if (!seenEnclosureUrls.has(enclosureUrl) && !seenGuids.has(guid)) {
45
+ seenEnclosureUrls.add(enclosureUrl);
46
+ seenGuids.add(guid);
47
+ acc.push(parsedItem);
39
48
  }
40
49
  return acc;
41
50
  }, []);
42
51
  };
52
+ const createItemTimerAccumulator = () => {
53
+ const timerAccumulator = {
54
+ updateItem: 0,
55
+ handleParsedItemAbout: 0,
56
+ handleParsedItemChaptersFeed: 0,
57
+ handleParsedItemChat: 0,
58
+ handleParsedItemDescription: 0,
59
+ handleParsedItemEnclosure: 0,
60
+ handleParsedItemImage: 0,
61
+ handleParsedItemLicense: 0,
62
+ handleParsedItemLocation: 0,
63
+ handleParsedItemPerson: 0,
64
+ handleParsedItemSeason: 0,
65
+ handleParsedItemSeasonEpisode: 0,
66
+ handleParsedItemSocialInteract: 0,
67
+ handleParsedItemSoundbite: 0,
68
+ handleParsedItemTranscript: 0,
69
+ handleParsedItemTxt: 0,
70
+ handleParsedItemValue: 0
71
+ };
72
+ return timerAccumulator;
73
+ };
74
+ exports.createItemTimerAccumulator = createItemTimerAccumulator;
43
75
  const handleParsedItems = (parsedItems, channel, channelSeasonIndex) => __awaiter(void 0, void 0, void 0, function* () {
44
76
  const itemService = new podverse_orm_1.ItemService();
45
- const existingItems = yield itemService.getAllItemsByChannel(channel, { select: ['id'] });
77
+ podverse_helpers_1.timerManager.start('getManyByChannel');
78
+ const existingItems = yield itemService.getManyByChannel(channel, { select: ['id', 'guid', 'guid_enclosure_url'] });
79
+ podverse_helpers_1.timerManager.end('getManyByChannel');
80
+ podverse_helpers_1.timerManager.start('existingItemIds');
46
81
  const existingItemIds = existingItems.map(item => item.id);
82
+ const existingItemGuids = new Set(existingItems.map(item => item.guid));
83
+ const existingItemGuidEnclosureUrls = new Set(existingItems.map(item => item.guid_enclosure_url));
47
84
  const updatedItemIds = [];
48
- const uniqueParsedItems = removeDuplicates(parsedItems);
49
- const parsedItemBatchs = (0, podverse_helpers_1.chunkArray)(uniqueParsedItems, 50);
85
+ const newItemGuids = [];
86
+ const newItemGuidEnclosureUrls = [];
87
+ const uniqueParsedItems = removeInvalidItems(parsedItems);
88
+ const parsedItemBatchs = (0, podverse_helpers_1.chunkArray)(uniqueParsedItems, 100);
89
+ const timerAccumulator = (0, exports.createItemTimerAccumulator)();
90
+ podverse_helpers_1.timerManager.end('existingItemIds');
50
91
  for (const parsedItemBatch of parsedItemBatchs) {
51
- yield podverse_orm_1.AppDataSource.manager.transaction((transactionalEntityManager) => __awaiter(void 0, void 0, void 0, function* () {
52
- for (const parsedItem of parsedItemBatch) {
53
- const item = yield (0, exports.handleParsedItem)(parsedItem, channel, channelSeasonIndex, transactionalEntityManager);
54
- updatedItemIds.push(item.id);
55
- }
56
- }));
92
+ podverse_helpers_1.timerManager.start('handleParsedItemBatch');
93
+ if (config_1.config.shouldLogTimer) {
94
+ yield handleParsedItemBatch({
95
+ parsedItemBatch,
96
+ channel,
97
+ channelSeasonIndex,
98
+ updatedItemIds,
99
+ timerAccumulator,
100
+ newItemGuids,
101
+ newItemGuidEnclosureUrls,
102
+ existingItemGuids,
103
+ existingItemGuidEnclosureUrls
104
+ });
105
+ }
106
+ else {
107
+ yield podverse_orm_1.AppDataSourceReadWrite.manager.transaction((transactionalEntityManager) => __awaiter(void 0, void 0, void 0, function* () {
108
+ yield handleParsedItemBatch({
109
+ parsedItemBatch,
110
+ channel,
111
+ channelSeasonIndex,
112
+ transactionalEntityManager,
113
+ updatedItemIds,
114
+ timerAccumulator,
115
+ newItemGuids,
116
+ newItemGuidEnclosureUrls,
117
+ existingItemGuids,
118
+ existingItemGuidEnclosureUrls
119
+ });
120
+ }));
121
+ }
122
+ podverse_helpers_1.timerManager.end('handleParsedItemBatch');
123
+ }
124
+ if (config_1.config.shouldLogTimer) {
125
+ Object.entries(timerAccumulator).forEach(([key, value]) => {
126
+ podverse_helpers_1.logger.info(`${key} took ${value}ms`);
127
+ });
57
128
  }
58
129
  const itemIdsToDelete = existingItemIds.filter(id => !updatedItemIds.includes(id));
59
- yield itemService.deleteMany(itemIdsToDelete);
130
+ const itemsToDelete = existingItems.filter(item => itemIdsToDelete.includes(item.id));
131
+ yield itemService.updateManyFlagStatus(itemsToDelete, itemFlagStatus_1.ItemFlagStatusStatusEnum.PendingArchive);
132
+ return {
133
+ newItemGuids,
134
+ newItemGuidEnclosureUrls
135
+ };
60
136
  });
61
137
  exports.handleParsedItems = handleParsedItems;
62
- const handleParsedItem = (parsedItem, channel, channelSeasonIndex, transactionalEntityManager) => __awaiter(void 0, void 0, void 0, function* () {
138
+ const handleParsedItemBatch = (_a) => __awaiter(void 0, [_a], void 0, function* ({ parsedItemBatch, channel, channelSeasonIndex, transactionalEntityManager, updatedItemIds, timerAccumulator, newItemGuids, newItemGuidEnclosureUrls, existingItemGuids, existingItemGuidEnclosureUrls }) {
139
+ for (const parsedItem of parsedItemBatch) {
140
+ const item = yield (0, exports.handleParsedItem)({
141
+ parsedItem,
142
+ channel,
143
+ channelSeasonIndex,
144
+ transactionalEntityManager,
145
+ timerAccumulator
146
+ });
147
+ updatedItemIds.push(item.id);
148
+ const guid = parsedItem.guid;
149
+ const guidEnclosureUrl = (0, podverse_helpers_1.formatGuidEnclosureUrl)(parsedItem.enclosure.url);
150
+ if (guid && !existingItemGuids.has(guid)) {
151
+ newItemGuids.push(guid);
152
+ }
153
+ else if (guidEnclosureUrl && !existingItemGuidEnclosureUrls.has(guidEnclosureUrl)) {
154
+ newItemGuidEnclosureUrls.push(guidEnclosureUrl);
155
+ }
156
+ }
157
+ });
158
+ const handleParsedItem = (_a) => __awaiter(void 0, [_a], void 0, function* ({ parsedItem, channel, channelSeasonIndex, transactionalEntityManager, timerAccumulator, isLiveItem }) {
63
159
  const itemService = new podverse_orm_1.ItemService();
64
- const itemDto = (0, item_1.compatItemDto)(parsedItem);
65
- const item = yield itemService.update(channel, itemDto);
160
+ const itemDto = (0, item_1.compatItemDto)(parsedItem, { isLiveItem });
161
+ podverse_helpers_1.timerManager.start('updateItem');
162
+ const item = yield itemService.update(channel, itemFlagStatus_1.ItemFlagStatusStatusEnum.Active, itemDto);
163
+ timerAccumulator.updateItem = podverse_helpers_1.timerManager.end('updateItem', true) + timerAccumulator.updateItem;
164
+ const preventTimerLog = true;
165
+ podverse_helpers_1.timerManager.start('handleParsedItemAbout');
66
166
  yield (0, itemAbout_1.handleParsedItemAbout)(parsedItem, item, transactionalEntityManager);
167
+ timerAccumulator.handleParsedItemAbout = podverse_helpers_1.timerManager.end('handleParsedItemAbout', preventTimerLog) + timerAccumulator.handleParsedItemAbout;
168
+ podverse_helpers_1.timerManager.start('handleParsedItemChapterFeed');
67
169
  yield (0, itemChaptersFeed_1.handleParsedItemChaptersFeed)(parsedItem, item, transactionalEntityManager);
170
+ timerAccumulator.handleParsedItemChaptersFeed = podverse_helpers_1.timerManager.end('handleParsedItemChapterFeed', preventTimerLog) + timerAccumulator.handleParsedItemChaptersFeed;
171
+ podverse_helpers_1.timerManager.start('handleParsedItemChat');
68
172
  yield (0, itemChat_1.handleParsedItemChat)(parsedItem, item, transactionalEntityManager);
173
+ timerAccumulator.handleParsedItemChat = podverse_helpers_1.timerManager.end('handleParsedItemChat', preventTimerLog) + timerAccumulator.handleParsedItemChat;
69
174
  // // PTDO: add itemContentLinkService support after partytime adds chat support
70
175
  // const itemContentLinkService = new ItemContentLinkService();
71
176
  // const itemContentLinkDtos = compatItemContentLinkDtos(parsedItem);
@@ -74,19 +179,45 @@ const handleParsedItem = (parsedItem, channel, channelSeasonIndex, transactional
74
179
  // } else {
75
180
  // await itemContentLinkService._deleteAll(item);
76
181
  // }
182
+ podverse_helpers_1.timerManager.start('handleParsedItemDescription');
77
183
  yield (0, itemDescription_1.handleParsedItemDescription)(parsedItem, item, transactionalEntityManager);
184
+ timerAccumulator.handleParsedItemDescription = podverse_helpers_1.timerManager.end('handleParsedItemDescription', preventTimerLog) + timerAccumulator.handleParsedItemDescription;
185
+ podverse_helpers_1.timerManager.start('handleParsedItemEnclosure');
78
186
  yield (0, itemEnclosure_1.handleParsedItemEnclosure)(parsedItem, item, transactionalEntityManager);
187
+ timerAccumulator.handleParsedItemEnclosure = podverse_helpers_1.timerManager.end('handleParsedItemEnclosure', preventTimerLog) + timerAccumulator.handleParsedItemEnclosure;
188
+ podverse_helpers_1.timerManager.start('handleParsedItemImage');
79
189
  yield (0, itemImage_1.handleParsedItemImage)(parsedItem, item, transactionalEntityManager);
190
+ timerAccumulator.handleParsedItemImage = podverse_helpers_1.timerManager.end('handleParsedItemImage', preventTimerLog) + timerAccumulator.handleParsedItemImage;
191
+ podverse_helpers_1.timerManager.start('handleParsedItemLicense');
80
192
  yield (0, itemLicense_1.handleParsedItemLicense)(parsedItem, item, transactionalEntityManager);
193
+ timerAccumulator.handleParsedItemLicense = podverse_helpers_1.timerManager.end('handleParsedItemLicense', preventTimerLog) + timerAccumulator.handleParsedItemLicense;
194
+ podverse_helpers_1.timerManager.start('handleParsedItemLocation');
81
195
  yield (0, itemLocation_1.handleParsedItemLocation)(parsedItem, item, transactionalEntityManager);
196
+ timerAccumulator.handleParsedItemLocation = podverse_helpers_1.timerManager.end('handleParsedItemLocation', preventTimerLog) + timerAccumulator.handleParsedItemLocation;
197
+ podverse_helpers_1.timerManager.start('handleParsedItemPerson');
82
198
  yield (0, itemPerson_1.handleParsedItemPerson)(parsedItem, item, transactionalEntityManager);
199
+ timerAccumulator.handleParsedItemPerson = podverse_helpers_1.timerManager.end('handleParsedItemPerson', preventTimerLog) + timerAccumulator.handleParsedItemPerson;
200
+ podverse_helpers_1.timerManager.start('handleParsedItemSeason');
83
201
  yield (0, itemSeason_1.handleParsedItemSeason)(parsedItem, item, channelSeasonIndex, transactionalEntityManager);
202
+ timerAccumulator.handleParsedItemSeason = podverse_helpers_1.timerManager.end('handleParsedItemSeason', preventTimerLog) + timerAccumulator.handleParsedItemSeason;
203
+ podverse_helpers_1.timerManager.start('handleParsedItemSeasonEpisode');
84
204
  yield (0, itemSeasonEpisode_1.handleParsedItemSeasonEpisode)(parsedItem, item, transactionalEntityManager);
205
+ timerAccumulator.handleParsedItemSeasonEpisode = podverse_helpers_1.timerManager.end('handleParsedItemSeasonEpisode', preventTimerLog) + timerAccumulator.handleParsedItemSeasonEpisode;
206
+ podverse_helpers_1.timerManager.start('handleParsedItemSocialInteract');
85
207
  yield (0, itemSocialInteract_1.handleParsedItemSocialInteract)(parsedItem, item, transactionalEntityManager);
208
+ timerAccumulator.handleParsedItemSocialInteract = podverse_helpers_1.timerManager.end('handleParsedItemSocialInteract', preventTimerLog) + timerAccumulator.handleParsedItemSocialInteract;
209
+ podverse_helpers_1.timerManager.start('handleParsedItemSoundbite');
86
210
  yield (0, itemSoundbite_1.handleParsedItemSoundbite)(parsedItem, item, transactionalEntityManager);
211
+ timerAccumulator.handleParsedItemSoundbite = podverse_helpers_1.timerManager.end('handleParsedItemSoundbite', preventTimerLog) + timerAccumulator.handleParsedItemSoundbite;
212
+ podverse_helpers_1.timerManager.start('handleParsedItemTranscript');
87
213
  yield (0, itemTranscript_1.handleParsedItemTranscript)(parsedItem, item, transactionalEntityManager);
214
+ timerAccumulator.handleParsedItemTranscript = podverse_helpers_1.timerManager.end('handleParsedItemTranscript', preventTimerLog) + timerAccumulator.handleParsedItemTranscript;
215
+ podverse_helpers_1.timerManager.start('handleParsedItemTxt');
88
216
  yield (0, itemTxt_1.handleParsedItemTxt)(parsedItem, item, transactionalEntityManager);
89
- yield (0, itemValue_1.handleParsedItemValue)(parsedItem, item, transactionalEntityManager);
217
+ timerAccumulator.handleParsedItemTxt = podverse_helpers_1.timerManager.end('handleParsedItemTxt', preventTimerLog) + timerAccumulator.handleParsedItemTxt;
218
+ podverse_helpers_1.timerManager.start('handleParsedItemValue');
219
+ yield (0, itemValue_1.handleParsedItemValue)(parsedItem, item, channel, transactionalEntityManager);
220
+ timerAccumulator.handleParsedItemValue = podverse_helpers_1.timerManager.end('handleParsedItemValue', preventTimerLog) + timerAccumulator.handleParsedItemValue;
90
221
  return item;
91
222
  });
92
223
  exports.handleParsedItem = handleParsedItem;
@@ -1,4 +1,4 @@
1
1
  import { Episode } from "podcast-partytime";
2
2
  import { EntityManager, Item } from "podverse-orm";
3
- export declare const handleParsedItemAbout: (parsedItem: Episode, item: Item, transactionalEntityManager: EntityManager) => Promise<void>;
3
+ export declare const handleParsedItemAbout: (parsedItem: Episode, item: Item, transactionalEntityManager?: EntityManager) => Promise<void>;
4
4
  //# sourceMappingURL=itemAbout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"itemAbout.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/item/itemAbout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,IAAI,EAAoB,MAAM,cAAc,CAAC;AAGrE,eAAO,MAAM,qBAAqB,eACpB,OAAO,QACb,IAAI,8BACkB,aAAa,kBAK1C,CAAC"}
1
+ {"version":3,"file":"itemAbout.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/item/itemAbout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,IAAI,EAAoB,MAAM,cAAc,CAAC;AAGrE,eAAO,MAAM,qBAAqB,GAChC,YAAY,OAAO,EACnB,MAAM,IAAI,EACV,6BAA6B,aAAa,kBAK3C,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import { Episode } from "podcast-partytime";
2
2
  import { EntityManager, Item } from "podverse-orm";
3
- export declare const handleParsedItemChaptersFeed: (parsedItem: Episode, item: Item, transactionalEntityManager: EntityManager) => Promise<void>;
3
+ export declare const handleParsedItemChaptersFeed: (parsedItem: Episode, item: Item, transactionalEntityManager?: EntityManager) => Promise<void>;
4
4
  //# sourceMappingURL=itemChaptersFeed.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"itemChaptersFeed.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/item/itemChaptersFeed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,IAAI,EAA2B,MAAM,cAAc,CAAC;AAI5E,eAAO,MAAM,4BAA4B,eAC3B,OAAO,QACb,IAAI,8BACkB,aAAa,kBAK1C,CAAC"}
1
+ {"version":3,"file":"itemChaptersFeed.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/item/itemChaptersFeed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,IAAI,EAA2B,MAAM,cAAc,CAAC;AAI5E,eAAO,MAAM,4BAA4B,GACvC,YAAY,OAAO,EACnB,MAAM,IAAI,EACV,6BAA6B,aAAa,kBAK3C,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import { Episode } from "podcast-partytime";
2
2
  import { EntityManager, Item } from "podverse-orm";
3
- export declare const handleParsedItemChat: (parsedItem: Episode, item: Item, transactionalEntityManager: EntityManager) => Promise<void>;
3
+ export declare const handleParsedItemChat: (parsedItem: Episode, item: Item, transactionalEntityManager?: EntityManager) => Promise<void>;
4
4
  //# sourceMappingURL=itemChat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"itemChat.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/item/itemChat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AAIpE,eAAO,MAAM,oBAAoB,eACnB,OAAO,QACb,IAAI,8BACkB,aAAa,kBAK1C,CAAC"}
1
+ {"version":3,"file":"itemChat.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/item/itemChat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AAIpE,eAAO,MAAM,oBAAoB,GAC/B,YAAY,OAAO,EACnB,MAAM,IAAI,EACV,6BAA6B,aAAa,kBAK3C,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import { Episode } from "podcast-partytime";
2
2
  import { EntityManager, Item } from "podverse-orm";
3
- export declare const handleParsedItemDescription: (parsedItem: Episode, item: Item, transactionalEntityManager: EntityManager) => Promise<void>;
3
+ export declare const handleParsedItemDescription: (parsedItem: Episode, item: Item, transactionalEntityManager?: EntityManager) => Promise<void>;
4
4
  //# sourceMappingURL=itemDescription.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"itemDescription.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/item/itemDescription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,IAAI,EAA0B,MAAM,cAAc,CAAC;AAI3E,eAAO,MAAM,2BAA2B,eAC1B,OAAO,QACb,IAAI,8BACkB,aAAa,kBAK1C,CAAC"}
1
+ {"version":3,"file":"itemDescription.d.ts","sourceRoot":"","sources":["../../../../src/lib/rss/item/itemDescription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,IAAI,EAA0B,MAAM,cAAc,CAAC;AAI3E,eAAO,MAAM,2BAA2B,GACtC,YAAY,OAAO,EACnB,MAAM,IAAI,EACV,6BAA6B,aAAa,kBAK3C,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import { Episode } from "podcast-partytime";
2
2
  import { EntityManager, Item } from "podverse-orm";
3
- export declare const handleParsedItemEnclosure: (parsedItem: Episode, item: Item, transactionalEntityManager: EntityManager) => Promise<void>;
3
+ export declare const handleParsedItemEnclosure: (parsedItem: Episode, item: Item, transactionalEntityManager?: EntityManager) => Promise<void>;
4
4
  //# sourceMappingURL=itemEnclosure.d.ts.map