podverse-parser 5.1.19-alpha.0 → 5.1.21-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.
@@ -1 +1 @@
1
- {"version":3,"file":"handleNewItemNotifications.d.ts","sourceRoot":"","sources":["../../../src/lib/notifications/handleNewItemNotifications.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAA6B,MAAM,cAAc,CAAC;AAElE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAuCpE;;GAEG;AACH,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,OAAO,EAChB,iBAAiB,EAAE,uBAAuB,GACzC,OAAO,CAAC,IAAI,CAAC,CAgFf"}
1
+ {"version":3,"file":"handleNewItemNotifications.d.ts","sourceRoot":"","sources":["../../../src/lib/notifications/handleNewItemNotifications.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAA6B,MAAM,cAAc,CAAC;AAElE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAuCpE;;GAEG;AACH,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,OAAO,EAChB,iBAAiB,EAAE,uBAAuB,GACzC,OAAO,CAAC,IAAI,CAAC,CAiFf"}
@@ -98,7 +98,8 @@ function handleNewItemNotifications(channel, parsedItemsResult) {
98
98
  imageUrl: (0, sharedNotificationHelpers_1.getBestImageUrl)(item, channelImages),
99
99
  itemIdText: item.id_text,
100
100
  channelIdText: channel.id_text,
101
- messageType
101
+ messageType,
102
+ mediumId: channel.medium_id
102
103
  }));
103
104
  // Group devices by locale and platform
104
105
  const groupedDevices = (0, sharedNotificationHelpers_1.groupDevicesByLocaleAndPlatform)(allDevices);
@@ -84,7 +84,8 @@ function sendLiveItemNotificationsForStatus(channel, itemGuids, channelImages, m
84
84
  imageUrl: (0, sharedNotificationHelpers_1.getBestImageUrl)(item, channelImages),
85
85
  itemIdText: item.id_text,
86
86
  channelIdText: channel.id_text,
87
- messageType
87
+ messageType,
88
+ mediumId: channel.medium_id
88
89
  }));
89
90
  // Group devices by locale and platform
90
91
  const groupedDevices = (0, sharedNotificationHelpers_1.groupDevicesByLocaleAndPlatform)(allDevices);
@@ -14,6 +14,7 @@ export type ItemNotificationData = {
14
14
  itemIdText: string;
15
15
  channelIdText: string;
16
16
  messageType: NotificationMessageType;
17
+ mediumId: number;
17
18
  };
18
19
  /**
19
20
  * Selects the best image from a list based on notification requirements.
@@ -1 +1 @@
1
- {"version":3,"file":"sharedNotificationHelpers.d.ts","sourceRoot":"","sources":["../../../src/lib/notifications/sharedNotificationHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC7F,OAAO,EAML,OAAO,EACP,YAAY,EAEZ,IAAI,EACL,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAA4B,mBAAmB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAItJ,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,oBAAoB,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,uBAAuB,CAAC;CACtC,CAAC;AAOF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EACzF,MAAM,EAAE,CAAC,EAAE,GACV,M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BAAoB,EAAE,MAAM,EAAE,CAAC,CAAC,CAgB7H;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAUjF;AAED;;GAEG;AACH,wBAAsB,6BAA6B,CACjD,aAAa,EAAE,MAAM,EACrB,gBAAgB,EAAE,2BAA2B,GAC5C,OAAO,CAAC;IAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAAC,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,mBAAmB,EAAE,CAAC,CAAC;IAAC,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;IAAC,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,IAAI,CAAC,CA+FlM;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,iBAAiB,EAAE,oBAAoB,EAAE,EACzC,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,oBAAoB,EAAE,MAAM,EAAE,CAAC,CAAC,EAChE,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,mBAAmB,EAAE,CAAC,EACxD,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,GAC7C,OAAO,CAAC,IAAI,CAAC,CAwGf"}
@@ -208,7 +208,7 @@ function getDevicesForNotificationType(channelIdText, notificationType) {
208
208
  function sendItemNotifications(itemNotifications, groupedDevices, webPushSubscriptions, upSubscriptions) {
209
209
  return __awaiter(this, void 0, void 0, function* () {
210
210
  for (const itemNotification of itemNotifications) {
211
- const messageText = `${itemNotification.channelTitle} - ${itemNotification.itemTitle}`;
211
+ const messageText = itemNotification.itemTitle;
212
212
  // Send to FCM devices
213
213
  for (const [locale, platformMap] of groupedDevices) {
214
214
  for (const [platform, tokens] of platformMap) {
@@ -220,8 +220,10 @@ function sendItemNotifications(itemNotifications, groupedDevices, webPushSubscri
220
220
  messageType: itemNotification.messageType,
221
221
  locale,
222
222
  platform,
223
- icon: itemNotification.imageUrl || undefined,
223
+ body: itemNotification.channelTitle,
224
+ image: itemNotification.imageUrl || undefined,
224
225
  linkIdText: itemNotification.itemIdText,
226
+ mediumId: itemNotification.mediumId,
225
227
  data: {
226
228
  itemIdText: itemNotification.itemIdText,
227
229
  channelIdText: itemNotification.channelIdText,
@@ -245,8 +247,10 @@ function sendItemNotifications(itemNotifications, groupedDevices, webPushSubscri
245
247
  messageText,
246
248
  messageType: itemNotification.messageType,
247
249
  locale,
248
- icon: itemNotification.imageUrl || undefined,
250
+ body: itemNotification.channelTitle,
251
+ image: itemNotification.imageUrl || undefined,
249
252
  linkIdText: itemNotification.itemIdText,
253
+ mediumId: itemNotification.mediumId,
250
254
  data: {
251
255
  itemIdText: itemNotification.itemIdText,
252
256
  channelIdText: itemNotification.channelIdText,
@@ -270,8 +274,10 @@ function sendItemNotifications(itemNotifications, groupedDevices, webPushSubscri
270
274
  messageText,
271
275
  messageType: itemNotification.messageType,
272
276
  locale,
273
- icon: itemNotification.imageUrl || undefined,
277
+ body: itemNotification.channelTitle,
278
+ image: itemNotification.imageUrl || undefined,
274
279
  linkIdText: itemNotification.itemIdText,
280
+ mediumId: itemNotification.mediumId,
275
281
  data: {
276
282
  itemIdText: itemNotification.itemIdText,
277
283
  channelIdText: itemNotification.channelIdText,
@@ -1 +1 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../src/lib/rss/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EAKxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAa,MAAM,oBAAoB,CAAC;AAmC3D,eAAO,MAAM,kBAAkB,GAAU,KAAK,MAAM,wBAUnD,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,0BAA0B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,IAAI,EAAE,uBAAuB,GAAG,IAAI,CAAC;CACtC,CAAA;AAED,MAAM,MAAM,oCAAoC,GAAG;IACjD,UAAU,EAAE,OAAO,CAAC;IACpB,mBAAmB,EAAE,2BAA2B,CAAC;CAClD,CAAA;AAgBD,eAAO,MAAM,6BAA6B,GACxC,KAAK,MAAM,EACX,kBAAkB,MAAM,EACxB,SAAS,oCAAoC;;;;;;cAsI9C,CAAC"}
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../src/lib/rss/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EAKxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAa,MAAM,oBAAoB,CAAC;AAmC3D,eAAO,MAAM,kBAAkB,GAAU,KAAK,MAAM,wBAUnD,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,0BAA0B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,IAAI,EAAE,uBAAuB,GAAG,IAAI,CAAC;CACtC,CAAA;AAED,MAAM,MAAM,oCAAoC,GAAG;IACjD,UAAU,EAAE,OAAO,CAAC;IACpB,mBAAmB,EAAE,2BAA2B,CAAC;CAClD,CAAA;AAgBD,eAAO,MAAM,6BAA6B,GACxC,KAAK,MAAM,EACX,kBAAkB,MAAM,EACxB,SAAS,oCAAoC;;;;;;cAuI9C,CAAC"}
@@ -96,6 +96,7 @@ const parseRSSFeedAndSaveToDatabase = (url, podcast_index_id, options) => __awai
96
96
  }
97
97
  parsedFeed = yield (0, feed_1.handleRequestRSSFeed)(feed);
98
98
  feed = yield (0, feed_1.handleParsedFeed)(parsedFeed, feed, options);
99
+ // A race condition is possible. Save "is_parsing" state to valkey instead?
99
100
  yield feedService.update(feed.id, { is_parsing: new Date() });
100
101
  if ((0, podverse_orm_1.checkIfSpamFeed)(parsedFeed)) {
101
102
  yield feedService.updateFlagStatus(feed, podverse_orm_1.FeedFlagStatusStatusEnum.Spam);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "podverse-parser",
3
- "version": "5.1.19-alpha.0",
3
+ "version": "5.1.21-alpha.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -17,10 +17,10 @@
17
17
  "license": "AGPLv3",
18
18
  "dependencies": {
19
19
  "module-alias": "^2.2.3",
20
- "podverse-external-services": "^5.1.19-alpha.0",
21
- "podverse-helpers": "^5.1.19-alpha.0",
22
- "podverse-notifications": "^5.1.19-alpha.0",
23
- "podverse-orm": "^5.1.19-alpha.0",
20
+ "podverse-external-services": "^5.1.21-alpha.0",
21
+ "podverse-helpers": "^5.1.21-alpha.0",
22
+ "podverse-notifications": "^5.1.21-alpha.0",
23
+ "podverse-orm": "^5.1.21-alpha.0",
24
24
  "podverse-partytime": "^5.0.0"
25
25
  },
26
26
  "devDependencies": {