podverse-orm 5.1.5-alpha.1 → 5.1.6-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.
- package/dist/lib/feedFlagHelpers.d.ts +4 -4
- package/dist/lib/feedFlagHelpers.d.ts.map +1 -1
- package/dist/lib/feedFlagHelpers.js +4 -2
- package/dist/services/account/accountFollowingChannel.d.ts +3 -3
- package/dist/services/account/accountFollowingChannel.d.ts.map +1 -1
- package/dist/services/account/accountFollowingChannel.js +9 -6
- package/dist/services/account/accountFollowingPlaylist.d.ts +2 -1
- package/dist/services/account/accountFollowingPlaylist.d.ts.map +1 -1
- package/dist/services/account/accountFollowingPlaylist.js +3 -2
- package/dist/services/channel/channel.d.ts +2 -2
- package/dist/services/channel/channel.d.ts.map +1 -1
- package/dist/services/channel/channel.js +3 -2
- package/dist/services/clip.d.ts +2 -2
- package/dist/services/clip.d.ts.map +1 -1
- package/dist/services/clip.js +3 -2
- package/dist/services/item/item.d.ts +3 -3
- package/dist/services/item/item.d.ts.map +1 -1
- package/dist/services/item/item.js +10 -7
- package/dist/services/playlist/playlist.d.ts +2 -2
- package/dist/services/playlist/playlist.d.ts.map +1 -1
- package/dist/services/playlist/playlist.js +2 -1
- package/dist/services/stats/statsAggregatedChannel.d.ts +2 -2
- package/dist/services/stats/statsAggregatedChannel.d.ts.map +1 -1
- package/dist/services/stats/statsAggregatedChannel.js +3 -3
- package/dist/services/stats/statsAggregatedClip.d.ts +3 -3
- package/dist/services/stats/statsAggregatedClip.d.ts.map +1 -1
- package/dist/services/stats/statsAggregatedClip.js +6 -6
- package/dist/services/stats/statsAggregatedItem.d.ts +3 -3
- package/dist/services/stats/statsAggregatedItem.d.ts.map +1 -1
- package/dist/services/stats/statsAggregatedItem.js +9 -10
- package/dist/services/stats/statsAggregatedPlaylist.d.ts +3 -3
- package/dist/services/stats/statsAggregatedPlaylist.d.ts.map +1 -1
- package/dist/services/stats/statsAggregatedPlaylist.js +4 -2
- package/package.json +5 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QueryParamsMedium } from "podverse-helpers";
|
|
2
2
|
type ActiveFeedWhere = {
|
|
3
3
|
channel_ids: number[] | null;
|
|
4
|
-
|
|
4
|
+
mediumType: QueryParamsMedium | null;
|
|
5
5
|
category_id: number | null;
|
|
6
6
|
};
|
|
7
|
-
export declare function getActiveFeedWhere({ channel_ids,
|
|
7
|
+
export declare function getActiveFeedWhere({ channel_ids, mediumType, category_id }: ActiveFeedWhere): {
|
|
8
8
|
channel: {
|
|
9
9
|
feed: {
|
|
10
10
|
feed_flag_status: import("typeorm").FindOperator<any>;
|
|
@@ -12,7 +12,7 @@ export declare function getActiveFeedWhere({ channel_ids, medium_id, category_id
|
|
|
12
12
|
channel_categories?: {
|
|
13
13
|
category_id: import("typeorm").EqualOperator<number>;
|
|
14
14
|
} | undefined;
|
|
15
|
-
medium_id?: import("typeorm").
|
|
15
|
+
medium_id?: import("typeorm").FindOperator<any> | undefined;
|
|
16
16
|
id?: import("typeorm").FindOperator<any> | undefined;
|
|
17
17
|
};
|
|
18
18
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feedFlagHelpers.d.ts","sourceRoot":"","sources":["../../src/lib/feedFlagHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"feedFlagHelpers.d.ts","sourceRoot":"","sources":["../../src/lib/feedFlagHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAI/E,KAAK,eAAe,GAAG;IACrB,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC7B,UAAU,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACrC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAA;AAED,wBAAgB,kBAAkB,CAAC,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,EAAE,eAAe;;;;;;;;;;;EAY3F"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getActiveFeedWhere = getActiveFeedWhere;
|
|
4
|
+
const podverse_helpers_1 = require("podverse-helpers");
|
|
4
5
|
const typeorm_1 = require("typeorm");
|
|
5
6
|
const feedFlagStatus_1 = require("@orm/entities/feed/feedFlagStatus");
|
|
6
|
-
function getActiveFeedWhere({ channel_ids,
|
|
7
|
+
function getActiveFeedWhere({ channel_ids, mediumType, category_id }) {
|
|
8
|
+
const medium_ids = (0, podverse_helpers_1.getMediumIdArrayFromType)(mediumType);
|
|
7
9
|
return {
|
|
8
|
-
channel: Object.assign(Object.assign(Object.assign(Object.assign({}, ((channel_ids === null || channel_ids === void 0 ? void 0 : channel_ids.length) ? { id: (0, typeorm_1.In)(channel_ids) } : {})), (
|
|
10
|
+
channel: Object.assign(Object.assign(Object.assign(Object.assign({}, ((channel_ids === null || channel_ids === void 0 ? void 0 : channel_ids.length) ? { id: (0, typeorm_1.In)(channel_ids) } : {})), (medium_ids ? { medium_id: (0, typeorm_1.In)(medium_ids) } : {})), (category_id ? { channel_categories: { category_id: (0, typeorm_1.Equal)(category_id) } } : {})), { feed: {
|
|
9
11
|
feed_flag_status: (0, typeorm_1.In)([feedFlagStatus_1.FeedFlagStatusStatusEnum.Active, feedFlagStatus_1.FeedFlagStatusStatusEnum.AlwaysParse])
|
|
10
12
|
} })
|
|
11
13
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QueryParamsMedium } from 'podverse-helpers';
|
|
2
2
|
import { EntityManager, FindManyOptions } from 'typeorm';
|
|
3
3
|
import { AccountFollowingChannel } from '@orm/entities/account/accountFollowingChannel';
|
|
4
4
|
import { BaseManyService } from '@orm/services/base/baseManyService';
|
|
@@ -6,8 +6,8 @@ export declare class AccountFollowingChannelService extends BaseManyService<Acco
|
|
|
6
6
|
private accountService;
|
|
7
7
|
private channelService;
|
|
8
8
|
constructor(transactionalEntityManager?: EntityManager);
|
|
9
|
-
getFollowedChannels(account_id: number,
|
|
10
|
-
getFollowedChannelsWithCount(account_id: number,
|
|
9
|
+
getFollowedChannels(account_id: number, mediumType: QueryParamsMedium | null, config?: FindManyOptions<AccountFollowingChannel>): Promise<AccountFollowingChannel[]>;
|
|
10
|
+
getFollowedChannelsWithCount(account_id: number, mediumType: QueryParamsMedium | null, config?: FindManyOptions<AccountFollowingChannel>): Promise<{
|
|
11
11
|
count: number;
|
|
12
12
|
results: AccountFollowingChannel[];
|
|
13
13
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accountFollowingChannel.d.ts","sourceRoot":"","sources":["../../../src/services/account/accountFollowingChannel.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"accountFollowingChannel.d.ts","sourceRoot":"","sources":["../../../src/services/account/accountFollowingChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,aAAa,EAAS,eAAe,EAAM,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAIrE,qBAAa,8BAA+B,SAAQ,eAAe,CAAC,uBAAuB,EAAE,SAAS,CAAC;IACrG,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,cAAc,CAAiB;gBAE3B,0BAA0B,CAAC,EAAE,aAAa;IAMhD,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,GAAG,IAAI,EAChF,MAAM,CAAC,EAAE,eAAe,CAAC,uBAAuB,CAAC,GAAG,OAAO,CAAC,uBAAuB,EAAE,CAAC;IAuBlF,4BAA4B,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,iBAAiB,GAAG,IAAI,EACzF,MAAM,CAAC,EAAE,eAAe,CAAC,uBAAuB,CAAC,GAAG,OAAO,CAAC;QAC1D,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,uBAAuB,EAAE,CAAA;KAAE,CAAC;IAwBlD,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAoB5F,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAalF"}
|
|
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.AccountFollowingChannelService = void 0;
|
|
13
|
+
const podverse_helpers_1 = require("podverse-helpers");
|
|
13
14
|
const typeorm_1 = require("typeorm");
|
|
14
15
|
const accountFollowingChannel_1 = require("@orm/entities/account/accountFollowingChannel");
|
|
15
16
|
const baseManyService_1 = require("@orm/services/base/baseManyService");
|
|
@@ -21,22 +22,24 @@ class AccountFollowingChannelService extends baseManyService_1.BaseManyService {
|
|
|
21
22
|
this.accountService = new account_1.AccountService();
|
|
22
23
|
this.channelService = new channel_1.ChannelService();
|
|
23
24
|
}
|
|
24
|
-
getFollowedChannels(account_id,
|
|
25
|
+
getFollowedChannels(account_id, mediumType, config) {
|
|
25
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const medium_ids = mediumType ? (0, podverse_helpers_1.getMediumIdArrayFromType)(mediumType) : null;
|
|
26
28
|
const account = yield this.accountService.get(account_id);
|
|
27
29
|
if (!account) {
|
|
28
30
|
throw new Error("Account not found.");
|
|
29
31
|
}
|
|
30
|
-
const finalConfig = Object.assign(Object.assign({}, config), (
|
|
32
|
+
const finalConfig = Object.assign(Object.assign({}, config), (medium_ids ? {
|
|
31
33
|
where: Object.assign(Object.assign({}, config === null || config === void 0 ? void 0 : config.where), { channel: {
|
|
32
|
-
medium_id: (0, typeorm_1.
|
|
34
|
+
medium_id: (0, typeorm_1.In)(medium_ids)
|
|
33
35
|
} })
|
|
34
36
|
} : {}));
|
|
35
37
|
return this._getAll(account, finalConfig);
|
|
36
38
|
});
|
|
37
39
|
}
|
|
38
|
-
getFollowedChannelsWithCount(account_id,
|
|
40
|
+
getFollowedChannelsWithCount(account_id, mediumType, config) {
|
|
39
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
const medium_ids = mediumType ? (0, podverse_helpers_1.getMediumIdArrayFromType)(mediumType) : null;
|
|
40
43
|
const account = yield this.accountService.get(account_id);
|
|
41
44
|
if (!account) {
|
|
42
45
|
throw new Error("Account not found.");
|
|
@@ -44,8 +47,8 @@ class AccountFollowingChannelService extends baseManyService_1.BaseManyService {
|
|
|
44
47
|
const where = {
|
|
45
48
|
account_id: (0, typeorm_1.Equal)(account.id),
|
|
46
49
|
};
|
|
47
|
-
if (
|
|
48
|
-
where['channel'] = { medium_id: (0, typeorm_1.
|
|
50
|
+
if (medium_ids) {
|
|
51
|
+
where['channel'] = { medium_id: (0, typeorm_1.In)(medium_ids) };
|
|
49
52
|
}
|
|
50
53
|
const finalConfig = Object.assign(Object.assign({}, config), { where });
|
|
51
54
|
return this._getAllWithCount(account, finalConfig);
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { EntityManager, FindManyOptions } from 'typeorm';
|
|
2
2
|
import { AccountFollowingPlaylist } from '@orm/entities/account/accountFollowingPlaylist';
|
|
3
3
|
import { BaseManyService } from '@orm/services/base/baseManyService';
|
|
4
|
+
import { QueryParamsQueueMedium } from 'podverse-helpers';
|
|
4
5
|
export declare class AccountFollowingPlaylistService extends BaseManyService<AccountFollowingPlaylist, 'account'> {
|
|
5
6
|
private accountService;
|
|
6
7
|
private playlistService;
|
|
7
8
|
constructor(transactionalEntityManager?: EntityManager);
|
|
8
9
|
getFollowedPlaylistsPrivate(account_id: number, config?: FindManyOptions<AccountFollowingPlaylist>): Promise<AccountFollowingPlaylist[]>;
|
|
9
|
-
getFollowedPlaylistsPrivateWithCount(account_id: number,
|
|
10
|
+
getFollowedPlaylistsPrivateWithCount(account_id: number, queueMediumType: QueryParamsQueueMedium | null, config?: FindManyOptions<AccountFollowingPlaylist>): Promise<[AccountFollowingPlaylist[], number]>;
|
|
10
11
|
getFollowedPlaylistsPublic(account_id: number, config?: FindManyOptions<AccountFollowingPlaylist>): Promise<AccountFollowingPlaylist[]>;
|
|
11
12
|
followPlaylist(account_id: number, playlist_id_text: string): Promise<AccountFollowingPlaylist>;
|
|
12
13
|
unfollowPlaylist(account_id: number, playlist_id_text: string): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accountFollowingPlaylist.d.ts","sourceRoot":"","sources":["../../../src/services/account/accountFollowingPlaylist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"accountFollowingPlaylist.d.ts","sourceRoot":"","sources":["../../../src/services/account/accountFollowingPlaylist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAS,eAAe,EAAO,MAAM,SAAS,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAGrE,OAAO,EAA4B,sBAAsB,EAAsB,MAAM,kBAAkB,CAAC;AAExG,qBAAa,+BAAgC,SAAQ,eAAe,CAAC,wBAAwB,EAAE,SAAS,CAAC;IACvG,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,eAAe,CAAkB;gBAE7B,0BAA0B,CAAC,EAAE,aAAa;IAMhD,2BAA2B,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,eAAe,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,wBAAwB,EAAE,CAAC;IASxI,oCAAoC,CACxC,UAAU,EAAE,MAAM,EAClB,eAAe,EAAE,sBAAsB,GAAG,IAAI,EAC9C,MAAM,CAAC,EAAE,eAAe,CAAC,wBAAwB,CAAC,GAChD,OAAO,CAAC,CAAC,wBAAwB,EAAE,EAAE,MAAM,CAAC,CAAC;IAkB3C,0BAA0B,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,eAAe,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,wBAAwB,EAAE,CAAC;IAoBvI,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAoB/F,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAapF"}
|
|
@@ -31,9 +31,10 @@ class AccountFollowingPlaylistService extends baseManyService_1.BaseManyService
|
|
|
31
31
|
return this._getAll(account, config);
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
-
getFollowedPlaylistsPrivateWithCount(account_id,
|
|
34
|
+
getFollowedPlaylistsPrivateWithCount(account_id, queueMediumType, config) {
|
|
35
35
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
|
|
36
|
+
const medium_id = (0, podverse_helpers_1.getQueueMediumIdFromType)(queueMediumType);
|
|
37
|
+
return this.repositoryRead.findAndCount(Object.assign(Object.assign({}, config), { where: Object.assign(Object.assign(Object.assign({}, config === null || config === void 0 ? void 0 : config.where), { account_id }), (medium_id ? { playlist: { medium_id: (0, typeorm_1.Equal)(medium_id) } } : {})), relations: [
|
|
37
38
|
'playlist',
|
|
38
39
|
'playlist.account',
|
|
39
40
|
'playlist.account.account_profile'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MediumEnum } from 'podverse-helpers';
|
|
1
|
+
import { MediumEnum, QueryParamsMedium } from 'podverse-helpers';
|
|
2
2
|
import { FindManyOptions, FindOptionsRelations, FindOptionsWhere, Repository } from 'typeorm';
|
|
3
3
|
import { Channel } from '@orm/entities/channel/channel';
|
|
4
4
|
import { Feed } from '@orm/entities/feed/feed';
|
|
@@ -26,7 +26,7 @@ export declare class ChannelService {
|
|
|
26
26
|
getByIdText(id_text: string, relations?: FindOptionsRelations<Channel>): Promise<Channel | null>;
|
|
27
27
|
getByIdOrIdText(idOrIdText: string, relations?: FindOptionsRelations<Channel>): Promise<Channel | null>;
|
|
28
28
|
getByPodcastIndexId(podcast_index_id: number, relations?: FindOptionsRelations<Channel>): Promise<Channel | null>;
|
|
29
|
-
getMany(config: FindManyOptions<Channel>,
|
|
29
|
+
getMany(config: FindManyOptions<Channel>, mediumType: QueryParamsMedium, category_id: number | null): Promise<Channel[]>;
|
|
30
30
|
getManyCount(config: FindManyOptions<Channel>): Promise<number>;
|
|
31
31
|
getAllByPodcastGuids(config: FindManyOptions<Channel>, podcast_guids: string[]): Promise<Channel[]>;
|
|
32
32
|
getOrCreateByFeed(feed: Feed): Promise<Channel>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../src/services/channel/channel.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../src/services/channel/channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,UAAU,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,gBAAgB,EAAM,UAAU,EAAS,MAAM,SAAS,CAAC;AACzG,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAgB/C,KAAK,UAAU,GAAG;IAChB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;I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E,MAAM,EAAE,SAAS,GAAE,oBAAoB,CAAC,OAAO,CAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAa3G,mBAAmB,CAAC,gBAAgB,EAAE,MAAM,EAAE,SAAS,GAAE,oBAAoB,CAAC,OAAO,CAAM;IAO3F,OAAO,CACX,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,EAChC,UAAU,EAAE,iBAAiB,EAC7B,WAAW,EAAE,MAAM,GAAG,IAAI,GACzB,OAAO,CAAC,OAAO,EAAE,CAAC;IAef,YAAY,CAAC,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IAW/D,oBAAoB,CACxB,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,EAChC,aAAa,EAAE,MAAM,EAAE,GACtB,OAAO,CAAC,OAAO,EAAE,CAAC;IASf,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC;IAiB/C,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC;CAW5D"}
|
|
@@ -203,11 +203,12 @@ class ChannelService {
|
|
|
203
203
|
});
|
|
204
204
|
});
|
|
205
205
|
}
|
|
206
|
-
getMany(config,
|
|
206
|
+
getMany(config, mediumType, category_id) {
|
|
207
207
|
return __awaiter(this, void 0, void 0, function* () {
|
|
208
|
+
const medium_ids = mediumType ? (0, podverse_helpers_1.getMediumIdArrayFromType)(mediumType) : null;
|
|
208
209
|
return this.repositoryRead.find(Object.assign({ where: Object.assign(Object.assign({ feed: {
|
|
209
210
|
feed_flag_status: (0, typeorm_1.In)([feedFlagStatus_1.FeedFlagStatusStatusEnum.Active, feedFlagStatus_1.FeedFlagStatusStatusEnum.AlwaysParse])
|
|
210
|
-
} }, (
|
|
211
|
+
} }, (medium_ids ? { medium_id: (0, typeorm_1.In)(medium_ids) } : {})), (category_id ? { channel_categories: { category_id: (0, typeorm_1.Equal)(category_id) } } : {})) }, config));
|
|
211
212
|
});
|
|
212
213
|
}
|
|
213
214
|
getManyCount(config) {
|
package/dist/services/clip.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EntityManager, FindOneOptions, FindManyOptions } from 'typeorm';
|
|
2
2
|
import { Clip } from '@orm/entities/clip';
|
|
3
3
|
import { BaseManyService } from '@orm/services/base/baseManyService';
|
|
4
|
-
import {
|
|
4
|
+
import { QueryParamsMedium } from 'podverse-helpers';
|
|
5
5
|
export type ClipDto = {
|
|
6
6
|
start_time: string;
|
|
7
7
|
end_time?: string | null;
|
|
@@ -18,7 +18,7 @@ export declare class ClipService extends BaseManyService<Clip, 'account'> {
|
|
|
18
18
|
update(account_id: number, clip_id_text: string, dto: ClipDto): Promise<Clip>;
|
|
19
19
|
delete(account_id: number, clip_id_text: string): Promise<void>;
|
|
20
20
|
getByIdText(clip_id_text: string, config?: FindOneOptions<Clip>): Promise<Clip | null>;
|
|
21
|
-
getManyPublic(
|
|
21
|
+
getManyPublic(mediumType: QueryParamsMedium | null, category_id: number | null, config: FindManyOptions<Clip>): Promise<Clip[]>;
|
|
22
22
|
getManyByChannels(channel_ids: number[], config: FindManyOptions<Clip>): Promise<[Clip[], number]>;
|
|
23
23
|
getManyByChannelAndCountPublic(channel_id_text: string, config: FindManyOptions<Clip>): Promise<[Clip[], number]>;
|
|
24
24
|
getManyByItemAndCountPublic(item_id_text: string, config: FindManyOptions<Clip>): Promise<[Clip[], number]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clip.d.ts","sourceRoot":"","sources":["../../src/services/clip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,eAAe,EAAa,MAAM,SAAS,CAAC;AACpF,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAGrE,OAAO,
|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pC,WAAW,EAAE,MAAM,GAAG,IAAI,EAC1B,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,GAC5B,OAAO,CAAC,IAAI,EAAE,CAAC;IAmBZ,iBAAiB,CACrB,WAAW,EAAE,MAAM,EAAE,EACrB,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,GAC5B,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC;IAiBtB,8BAA8B,CAClC,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,GAC5B,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC;IAiBtB,2BAA2B,CAC/B,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,GAC5B,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC;IAiBtB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IASrD,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;CAa7D"}
|
package/dist/services/clip.js
CHANGED
|
@@ -93,14 +93,15 @@ class ClipService extends baseManyService_1.BaseManyService {
|
|
|
93
93
|
return this.repositoryRead.findOne(options);
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
-
getManyPublic(
|
|
96
|
+
getManyPublic(mediumType, category_id, config) {
|
|
97
97
|
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
const medium_ids = mediumType ? (0, podverse_helpers_1.getMediumIdArrayFromType)(mediumType) : null;
|
|
98
99
|
return this.repositoryRead.find(Object.assign({ where: {
|
|
99
100
|
sharable_status_id: podverse_helpers_1.SharableStatusEnum.Public,
|
|
100
101
|
item: {
|
|
101
102
|
channel: Object.assign(Object.assign({ feed: {
|
|
102
103
|
feed_flag_status: (0, typeorm_1.In)([__1.FeedFlagStatusStatusEnum.Active, __1.FeedFlagStatusStatusEnum.AlwaysParse])
|
|
103
|
-
} }, (
|
|
104
|
+
} }, (medium_ids ? { medium_id: (0, typeorm_1.In)(medium_ids) } : {})), (category_id ? { channel_categories: { category_id: (0, typeorm_1.Equal)(category_id) } } : {}))
|
|
104
105
|
},
|
|
105
106
|
} }, config));
|
|
106
107
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QueryParamsMedium } from 'podverse-helpers';
|
|
2
2
|
import { FindManyOptions, FindOptionsRelations, FindOptionsWhere, Repository } from 'typeorm';
|
|
3
3
|
import { Channel } from '@orm/entities/channel/channel';
|
|
4
4
|
import { Item } from '@orm/entities/item/item';
|
|
@@ -22,7 +22,7 @@ export declare class ItemService {
|
|
|
22
22
|
getByIdText(id_text: string, relations?: FindOptionsRelations<Item>): Promise<Item | null>;
|
|
23
23
|
getByIdOrIdText(idOrIdText: string, relations?: FindOptionsRelations<Item>): Promise<Item | null>;
|
|
24
24
|
getRandomItem(medium_id: number): Promise<Item | null>;
|
|
25
|
-
getMany(config: FindManyOptions<Item>,
|
|
25
|
+
getMany(config: FindManyOptions<Item>, mediumType: QueryParamsMedium | null, category_id: number | null, itemType: 'normal' | 'live-item', liveItemType: 'pending' | 'live' | 'ended' | null): Promise<Item[]>;
|
|
26
26
|
getManyByPodcastGuidAndItemGuid(params: {
|
|
27
27
|
podcast_guid: string;
|
|
28
28
|
item_guid: string;
|
|
@@ -35,7 +35,7 @@ export declare class ItemService {
|
|
|
35
35
|
getManyByChannel(channel: Channel, options?: FindManyOptions<Item>): Promise<Item[]>;
|
|
36
36
|
getManyForQueueByPubDate(item_id_text: string, order: 'forward' | 'backward'): Promise<Item[]>;
|
|
37
37
|
getManyByChannelWithLiveItem(channel: Channel, options?: FindManyOptions<Item>): Promise<Item[]>;
|
|
38
|
-
getManyByChannels(channels: Channel[], options?: FindManyOptions<Item>): Promise<Item[]>;
|
|
38
|
+
getManyByChannels(channels: Channel[], itemType: 'normal' | 'live-item', liveItemType: 'pending' | 'live' | 'ended' | null, options?: FindManyOptions<Item>): Promise<Item[]>;
|
|
39
39
|
getManyByChannelsWithLiveItem(channels: Channel[], options?: FindManyOptions<Item>): Promise<Item[]>;
|
|
40
40
|
update(channel: Channel, item_flag_status_id: ItemFlagStatusStatusEnum, dto: ItemDto): Promise<Item>;
|
|
41
41
|
updateFlagStatus(item: Item, item_flag_status_id: ItemFlagStatusStatusEnum): Promise<Item>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../src/services/item/item.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../../src/services/item/item.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,gBAAgB,EAC7C,UAAU,EACrB,MAAM,SAAS,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAoB/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAG7E,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAA;IACrB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;CAClC,CAAA;AAED,KAAK,YAAY,GAAG;IAClB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAA;CAClC,CAAA;AASD,qBAAa,WAAW;IACtB,SAAS,CAAC,cAAc,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;IAC3C,SAAS,CAAC,mBAAmB,EAAE,UAAU,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mB,EAAE,oBAAoB,CAAC,IAAI,CAmB1D,CAAC"}
|
|
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.itemGetOneRelations = exports.subItemGetManyRelationsWithChannel = exports.itemGetManyRelationsWithChannel = exports.subItemGetManyRelations = exports.itemGetManyRelations = exports.ItemService = void 0;
|
|
13
|
+
const podverse_helpers_1 = require("podverse-helpers");
|
|
13
14
|
const typeorm_1 = require("typeorm");
|
|
14
15
|
const item_1 = require("@orm/entities/item/item");
|
|
15
16
|
const applyProperties_1 = require("@orm/lib/applyProperties");
|
|
@@ -31,6 +32,7 @@ const itemValueTimeSplitRecipient_1 = require("./itemValueTimeSplitRecipient");
|
|
|
31
32
|
const itemValueTimeSplitRemoteItem_1 = require("./itemValueTimeSplitRemoteItem");
|
|
32
33
|
const itemFlagStatus_1 = require("./itemFlagStatus");
|
|
33
34
|
const itemFlagStatus_2 = require("@orm/entities/item/itemFlagStatus");
|
|
35
|
+
const liveItemStatus_1 = require("@orm/entities/liveItem/liveItemStatus");
|
|
34
36
|
const itemQueueListRelations = [
|
|
35
37
|
'item_about',
|
|
36
38
|
'item_enclosures', 'item_enclosures.item_enclosure_sources',
|
|
@@ -192,16 +194,18 @@ class ItemService {
|
|
|
192
194
|
return items[0] || null;
|
|
193
195
|
});
|
|
194
196
|
}
|
|
195
|
-
getMany(config,
|
|
197
|
+
getMany(config, mediumType, category_id, itemType, liveItemType) {
|
|
196
198
|
return __awaiter(this, void 0, void 0, function* () {
|
|
199
|
+
const medium_ids = mediumType ? (0, podverse_helpers_1.getMediumIdArrayFromType)(mediumType) : null;
|
|
200
|
+
const live_item_status_id = (0, liveItemStatus_1.getLiveItemStatusEnumValue)(liveItemType);
|
|
197
201
|
return this.repositoryRead.find(Object.assign(Object.assign({}, config), { where: {
|
|
198
202
|
channel: Object.assign(Object.assign({ feed: {
|
|
199
203
|
feed_flag_status: (0, typeorm_1.In)([1, 2])
|
|
200
|
-
} }, (
|
|
204
|
+
} }, (medium_ids ? { medium_id: (0, typeorm_1.In)(medium_ids) } : {})), (category_id ? { channel_categories: { category_id: (0, typeorm_1.Equal)(category_id) } } : {})),
|
|
201
205
|
item_flag_status: {
|
|
202
206
|
id: itemFlagStatus_2.ItemFlagStatusStatusEnum.Active
|
|
203
207
|
},
|
|
204
|
-
live_item: Object.assign({ id: itemType === 'live-item' ? (0, typeorm_1.Not)((0, typeorm_1.IsNull)()) : (0, typeorm_1.IsNull)() }, (
|
|
208
|
+
live_item: Object.assign({ id: itemType === 'live-item' ? (0, typeorm_1.Not)((0, typeorm_1.IsNull)()) : (0, typeorm_1.IsNull)() }, (live_item_status_id ? { live_item_status_id: (0, typeorm_1.Equal)(live_item_status_id) } : {}))
|
|
205
209
|
} }));
|
|
206
210
|
});
|
|
207
211
|
}
|
|
@@ -335,13 +339,12 @@ class ItemService {
|
|
|
335
339
|
} }, options));
|
|
336
340
|
});
|
|
337
341
|
}
|
|
338
|
-
getManyByChannels(channels, options) {
|
|
342
|
+
getManyByChannels(channels, itemType, liveItemType, options) {
|
|
339
343
|
return __awaiter(this, void 0, void 0, function* () {
|
|
344
|
+
const live_item_status_id = (0, liveItemStatus_1.getLiveItemStatusEnumValue)(liveItemType);
|
|
340
345
|
return this.repositoryRead.find(Object.assign({ where: {
|
|
341
346
|
channel: (0, typeorm_1.In)(channels),
|
|
342
|
-
live_item: {
|
|
343
|
-
id: (0, typeorm_1.IsNull)()
|
|
344
|
-
},
|
|
347
|
+
live_item: Object.assign({ id: itemType === 'live-item' ? (0, typeorm_1.Not)((0, typeorm_1.IsNull)()) : (0, typeorm_1.IsNull)() }, (live_item_status_id ? { live_item_status_id: (0, typeorm_1.Equal)(live_item_status_id) } : {})),
|
|
345
348
|
item_flag_status: {
|
|
346
349
|
id: itemFlagStatus_2.ItemFlagStatusStatusEnum.Active
|
|
347
350
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MediumEnum, SharableStatusEnum } from 'podverse-helpers';
|
|
1
|
+
import { MediumEnum, QueryParamsQueueMedium, SharableStatusEnum } from 'podverse-helpers';
|
|
2
2
|
import { EntityManager, FindManyOptions, FindOneOptions } from 'typeorm';
|
|
3
3
|
import { Playlist } from '@orm/entities/playlist/playlist';
|
|
4
4
|
import { BaseManyService } from '@orm/services/base/baseManyService';
|
|
@@ -18,7 +18,7 @@ export declare class PlaylistService extends BaseManyService<Playlist, 'account'
|
|
|
18
18
|
delete(account_id: number, playlist_id_text: string): Promise<void>;
|
|
19
19
|
getByIdText(playlist_id_text: string, options?: FindOneOptions<Playlist>): Promise<Playlist | null>;
|
|
20
20
|
getManyPublic(options?: FindManyOptions<Playlist>): Promise<Playlist[]>;
|
|
21
|
-
getManyPrivate(account_id: number,
|
|
21
|
+
getManyPrivate(account_id: number, queueMediumType: QueryParamsQueueMedium | null, options?: FindManyOptions<Playlist>): Promise<[Playlist[], number]>;
|
|
22
22
|
getOnePublic(playlist_id_text: string, options?: FindOneOptions<Playlist>): Promise<Playlist | null>;
|
|
23
23
|
getOnePrivate(account_id_text: string, playlist_id_text: string, options?: FindOneOptions<Playlist>): Promise<Playlist | null>;
|
|
24
24
|
getAllFavoritesPrivate(account_id: number): Promise<Playlist[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playlist.d.ts","sourceRoot":"","sources":["../../../src/services/playlist/playlist.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"playlist.d.ts","sourceRoot":"","sources":["../../../src/services/playlist/playlist.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,UAAU,EAAE,sBAAsB,EACnE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAS,eAAe,EAAE,cAAc,EAAO,MAAM,SAAS,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAE,MAAM,i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AAgB,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAYpG,aAAa,CAAC,eAAe,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;IAY9H,sBAAsB,CAAC,UAAU,EAAE,MAAM;CAsBhD"}
|
|
@@ -77,8 +77,9 @@ class PlaylistService extends baseManyService_1.BaseManyService {
|
|
|
77
77
|
return this.repositoryRead.find(Object.assign({ where: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.where), { sharable_status_id: podverse_helpers_1.SharableStatusEnum.Public }) }, options));
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
|
-
getManyPrivate(account_id,
|
|
80
|
+
getManyPrivate(account_id, queueMediumType, options) {
|
|
81
81
|
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
const medium_id = (0, podverse_helpers_1.getQueueMediumIdFromType)(queueMediumType);
|
|
82
83
|
return this.repositoryRead.findAndCount(Object.assign(Object.assign({}, options), { where: Object.assign(Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.where), { account: {
|
|
83
84
|
id: account_id
|
|
84
85
|
} }), (medium_id ? { medium_id: (0, typeorm_1.Equal)(medium_id) } : {})) }));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QueryParamsMedium } from 'podverse-helpers';
|
|
2
2
|
import { FindManyOptions } from 'typeorm';
|
|
3
3
|
import { StatsAggregatedChannel } from '@orm/entities/stats/statsAggregatedChannel';
|
|
4
4
|
import { BaseStatsAggregatedService, UpdateHistoricalOptions } from './baseStatsAggregated';
|
|
@@ -7,7 +7,7 @@ export declare class StatsAggregatedChannelService extends BaseStatsAggregatedSe
|
|
|
7
7
|
constructor();
|
|
8
8
|
protected getIdFieldName(): string;
|
|
9
9
|
private mergeWhere;
|
|
10
|
-
getMany(config: FindManyOptions<StatsAggregatedChannel>,
|
|
10
|
+
getMany(config: FindManyOptions<StatsAggregatedChannel>, mediumType: QueryParamsMedium | null, category_id: number | null): Promise<StatsAggregatedChannel[]>;
|
|
11
11
|
getManyByChannelsAndCount(channel_ids: number[], config: FindManyOptions<StatsAggregatedChannel>): Promise<[StatsAggregatedChannel[], number]>;
|
|
12
12
|
updateAggregatedStats(channel_id: number, updateAllTime?: boolean): Promise<void>;
|
|
13
13
|
updateAggregatedStatsRolling(channel_id: number, updateHistoricalOptions: UpdateHistoricalOptions): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statsAggregatedChannel.d.ts","sourceRoot":"","sources":["../../../src/services/stats/statsAggregatedChannel.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"statsAggregatedChannel.d.ts","sourceRoot":"","sources":["../../../src/services/stats/statsAggregatedChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAEpF,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAG5F,qBAAa,6BAA8B,SAAQ,0BAA0B,CAAC,sBAAsB,EAAE,MAAM,CAAC;IAC3G,OAAO,CAAC,6BAA6B,CAAgC;;IAOrE,SAAS,CAAC,cAAc,IAAI,MAAM;IAIlC,OAAO,CAAC,UAAU;IAIZ,OAAO,CACX,MAAM,EAAE,eAAe,CAAC,sBAAsB,CAAC,EAC/C,UAAU,EAAE,iBAAiB,GAAG,IAAI,EACpC,WAAW,EAAE,MAAM,GAAG,IAAI,GACzB,OAAO,CAAC,sBAAsB,EAAE,CAAC;IAY9B,yBAAyB,CAC7B,WAAW,EAAE,MAAM,EAAE,EACrB,MAAM,EAAE,eAAe,CAAC,sBAAsB,CAAC,GAC9C,OAAO,CAAC,CAAC,sBAAsB,EAAE,EAAE,MAAM,CAAC,CAAC;IAYxC,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,GAAE,OAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxF,4BAA4B,CAAC,UAAU,EAAE,MAAM,EAAE,uBAAuB,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;CAGxH"}
|
|
@@ -25,11 +25,11 @@ class StatsAggregatedChannelService extends baseStatsAggregated_1.BaseStatsAggre
|
|
|
25
25
|
mergeWhere(feedWhere, configWhere) {
|
|
26
26
|
return Object.assign(Object.assign({}, (feedWhere || {})), (configWhere || {}));
|
|
27
27
|
}
|
|
28
|
-
getMany(config,
|
|
28
|
+
getMany(config, mediumType, category_id) {
|
|
29
29
|
return __awaiter(this, void 0, void 0, function* () {
|
|
30
30
|
const feedWhere = (0, feedFlagHelpers_1.getActiveFeedWhere)({
|
|
31
31
|
channel_ids: null,
|
|
32
|
-
|
|
32
|
+
mediumType,
|
|
33
33
|
category_id
|
|
34
34
|
});
|
|
35
35
|
return this.repositoryRead.find(Object.assign(Object.assign({}, config), { where: this.mergeWhere(feedWhere, config.where) }));
|
|
@@ -39,7 +39,7 @@ class StatsAggregatedChannelService extends baseStatsAggregated_1.BaseStatsAggre
|
|
|
39
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
40
|
const feedWhere = (0, feedFlagHelpers_1.getActiveFeedWhere)({
|
|
41
41
|
channel_ids,
|
|
42
|
-
|
|
42
|
+
mediumType: null,
|
|
43
43
|
category_id: null
|
|
44
44
|
});
|
|
45
45
|
return this.repositoryRead.findAndCount(Object.assign(Object.assign({}, config), { where: this.mergeWhere(feedWhere, config.where) }));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QueryParamsMedium } from 'podverse-helpers';
|
|
2
2
|
import { StatsAggregatedClip } from '@orm/entities/stats/statsAggregatedClip';
|
|
3
3
|
import { BaseStatsAggregatedService, UpdateHistoricalOptions } from './baseStatsAggregated';
|
|
4
4
|
import { FindManyOptions } from 'typeorm';
|
|
@@ -6,8 +6,8 @@ export declare class StatsAggregatedClipService extends BaseStatsAggregatedServi
|
|
|
6
6
|
private statsTrackEventClipService;
|
|
7
7
|
constructor();
|
|
8
8
|
protected getIdFieldName(): string;
|
|
9
|
-
getManyPublic(config: FindManyOptions<StatsAggregatedClip>,
|
|
10
|
-
getManyAndCountPublic(config: FindManyOptions<StatsAggregatedClip>,
|
|
9
|
+
getManyPublic(config: FindManyOptions<StatsAggregatedClip>, mediumType: QueryParamsMedium | null, category_id: number | null): Promise<StatsAggregatedClip[]>;
|
|
10
|
+
getManyAndCountPublic(config: FindManyOptions<StatsAggregatedClip>, mediumType: QueryParamsMedium | null, category_id: number | null): Promise<[StatsAggregatedClip[], number]>;
|
|
11
11
|
getManyByChannelsAndCountPublic(channel_ids: number[], config: FindManyOptions<StatsAggregatedClip>): Promise<[StatsAggregatedClip[], number]>;
|
|
12
12
|
getManyByItemAndCountPublic(item_id: number, config: FindManyOptions<StatsAggregatedClip>): Promise<[StatsAggregatedClip[], number]>;
|
|
13
13
|
updateAggregatedStats(clip_id: number, updateAllTime?: boolean): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statsAggregatedClip.d.ts","sourceRoot":"","sources":["../../../src/services/stats/statsAggregatedClip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"statsAggregatedClip.d.ts","sourceRoot":"","sources":["../../../src/services/stats/statsAggregatedClip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAsB,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAE9E,OAAO,EAAE,0BAA0B,EAAE,uBAAuB,EAAE,MA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-
getManyPublic(config,
|
|
26
|
+
getManyPublic(config, mediumType, category_id) {
|
|
27
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
28
|
return this.repositoryRead.find(Object.assign({ where: {
|
|
29
29
|
clip: {
|
|
30
30
|
sharable_status_id: podverse_helpers_1.SharableStatusEnum.Public,
|
|
31
31
|
item: Object.assign({}, (0, feedFlagHelpers_1.getActiveFeedWhere)({
|
|
32
32
|
channel_ids: null,
|
|
33
|
-
|
|
33
|
+
mediumType,
|
|
34
34
|
category_id
|
|
35
35
|
}))
|
|
36
36
|
}
|
|
37
37
|
} }, config));
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
getManyAndCountPublic(config,
|
|
40
|
+
getManyAndCountPublic(config, mediumType, category_id) {
|
|
41
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
42
|
return this.repositoryRead.findAndCount(Object.assign({ where: {
|
|
43
43
|
clip: {
|
|
44
44
|
sharable_status_id: podverse_helpers_1.SharableStatusEnum.Public,
|
|
45
45
|
item: Object.assign({}, (0, feedFlagHelpers_1.getActiveFeedWhere)({
|
|
46
46
|
channel_ids: null,
|
|
47
|
-
|
|
47
|
+
mediumType,
|
|
48
48
|
category_id
|
|
49
49
|
}))
|
|
50
50
|
}
|
|
@@ -58,7 +58,7 @@ class StatsAggregatedClipService extends baseStatsAggregated_1.BaseStatsAggregat
|
|
|
58
58
|
sharable_status_id: podverse_helpers_1.SharableStatusEnum.Public,
|
|
59
59
|
item: Object.assign({}, (0, feedFlagHelpers_1.getActiveFeedWhere)({
|
|
60
60
|
channel_ids,
|
|
61
|
-
|
|
61
|
+
mediumType: null,
|
|
62
62
|
category_id: null
|
|
63
63
|
}))
|
|
64
64
|
}
|
|
@@ -72,7 +72,7 @@ class StatsAggregatedClipService extends baseStatsAggregated_1.BaseStatsAggregat
|
|
|
72
72
|
sharable_status_id: podverse_helpers_1.SharableStatusEnum.Public,
|
|
73
73
|
item: Object.assign({ id: item_id }, (0, feedFlagHelpers_1.getActiveFeedWhere)({
|
|
74
74
|
channel_ids: null,
|
|
75
|
-
|
|
75
|
+
mediumType: null,
|
|
76
76
|
category_id: null
|
|
77
77
|
}))
|
|
78
78
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QueryParamsMedium } from 'podverse-helpers';
|
|
2
2
|
import { StatsAggregatedItem } from '@orm/entities/stats/statsAggregatedItem';
|
|
3
3
|
import { BaseStatsAggregatedService, UpdateHistoricalOptions } from './baseStatsAggregated';
|
|
4
4
|
import { FindManyOptions } from 'typeorm';
|
|
@@ -6,8 +6,8 @@ export declare class StatsAggregatedItemService extends BaseStatsAggregatedServi
|
|
|
6
6
|
private statsTrackEventItemService;
|
|
7
7
|
constructor();
|
|
8
8
|
protected getIdFieldName(): string;
|
|
9
|
-
getMany(config: FindManyOptions<StatsAggregatedItem>,
|
|
10
|
-
getManyByChannelsAndCount(config: FindManyOptions<StatsAggregatedItem>, channel_ids: number[], itemType: 'normal' | 'live-item'): Promise<[StatsAggregatedItem[], number]>;
|
|
9
|
+
getMany(config: FindManyOptions<StatsAggregatedItem>, mediumType: QueryParamsMedium | null, category_id: number | null, itemType: 'normal' | 'live-item', liveItemType: 'pending' | 'live' | 'ended' | null): Promise<StatsAggregatedItem[]>;
|
|
10
|
+
getManyByChannelsAndCount(config: FindManyOptions<StatsAggregatedItem>, channel_ids: number[], itemType: 'normal' | 'live-item', liveItemType: 'pending' | 'live' | 'ended' | null): Promise<[StatsAggregatedItem[], number]>;
|
|
11
11
|
updateAggregatedStats(item_id: number, updateAllTime?: boolean): Promise<void>;
|
|
12
12
|
updateAggregatedStatsRolling(item_id: number, updateHistoricalOptions: UpdateHistoricalOptions): Promise<void>;
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statsAggregatedItem.d.ts","sourceRoot":"","sources":["../../../src/services/stats/statsAggregatedItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|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= require("./statsTrackEventItem");
|
|
|
15
15
|
const baseStatsAggregated_1 = require("./baseStatsAggregated");
|
|
16
16
|
const typeorm_1 = require("typeorm");
|
|
17
17
|
const feedFlagHelpers_1 = require("@orm/lib/feedFlagHelpers");
|
|
18
|
+
const index_1 = require("@orm/index");
|
|
18
19
|
class StatsAggregatedItemService extends baseStatsAggregated_1.BaseStatsAggregatedService {
|
|
19
20
|
constructor() {
|
|
20
21
|
super(statsAggregatedItem_1.StatsAggregatedItem);
|
|
@@ -23,29 +24,27 @@ class StatsAggregatedItemService extends baseStatsAggregated_1.BaseStatsAggregat
|
|
|
23
24
|
getIdFieldName() {
|
|
24
25
|
return 'item_id';
|
|
25
26
|
}
|
|
26
|
-
getMany(config,
|
|
27
|
+
getMany(config, mediumType, category_id, itemType, liveItemType) {
|
|
27
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
const live_item_status_id = (0, index_1.getLiveItemStatusEnumValue)(liveItemType);
|
|
28
30
|
return this.repositoryRead.find(Object.assign({ where: {
|
|
29
31
|
item: Object.assign(Object.assign({}, (0, feedFlagHelpers_1.getActiveFeedWhere)({
|
|
30
32
|
channel_ids: null,
|
|
31
|
-
|
|
33
|
+
mediumType,
|
|
32
34
|
category_id
|
|
33
|
-
})), { live_item: {
|
|
34
|
-
id: itemType === 'live-item' ? (0, typeorm_1.Not)((0, typeorm_1.IsNull)()) : (0, typeorm_1.IsNull)()
|
|
35
|
-
} })
|
|
35
|
+
})), { live_item: Object.assign({ id: itemType === 'live-item' ? (0, typeorm_1.Not)((0, typeorm_1.IsNull)()) : (0, typeorm_1.IsNull)() }, (live_item_status_id ? { live_item_status_id: (0, typeorm_1.Equal)(live_item_status_id) } : {})) })
|
|
36
36
|
} }, config));
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
|
-
getManyByChannelsAndCount(config, channel_ids, itemType) {
|
|
39
|
+
getManyByChannelsAndCount(config, channel_ids, itemType, liveItemType) {
|
|
40
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
const live_item_status_id = (0, index_1.getLiveItemStatusEnumValue)(liveItemType);
|
|
41
42
|
return this.repositoryRead.findAndCount(Object.assign({ where: {
|
|
42
43
|
item: Object.assign(Object.assign({}, (0, feedFlagHelpers_1.getActiveFeedWhere)({
|
|
43
44
|
channel_ids,
|
|
44
|
-
|
|
45
|
+
mediumType: null,
|
|
45
46
|
category_id: null
|
|
46
|
-
})), { live_item: {
|
|
47
|
-
id: itemType === 'live-item' ? (0, typeorm_1.Not)((0, typeorm_1.IsNull)()) : (0, typeorm_1.IsNull)()
|
|
48
|
-
} })
|
|
47
|
+
})), { live_item: Object.assign({ id: itemType === 'live-item' ? (0, typeorm_1.Not)((0, typeorm_1.IsNull)()) : (0, typeorm_1.IsNull)() }, (live_item_status_id ? { live_item_status_id: (0, typeorm_1.Equal)(live_item_status_id) } : {})) })
|
|
49
48
|
} }, config));
|
|
50
49
|
});
|
|
51
50
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { QueryParamsQueueMedium } from 'podverse-helpers';
|
|
2
2
|
import { FindManyOptions } from 'typeorm';
|
|
3
3
|
import { StatsAggregatedPlaylist } from '@orm/entities/stats/statsAggregatedPlaylist';
|
|
4
4
|
import { BaseStatsAggregatedService, UpdateHistoricalOptions } from './baseStatsAggregated';
|
|
@@ -8,8 +8,8 @@ export declare class StatsAggregatedPlaylistService extends BaseStatsAggregatedS
|
|
|
8
8
|
protected getIdFieldName(): string;
|
|
9
9
|
getMany(config: FindManyOptions<StatsAggregatedPlaylist>): Promise<StatsAggregatedPlaylist[]>;
|
|
10
10
|
getManyCount(config: FindManyOptions<StatsAggregatedPlaylist>): Promise<number>;
|
|
11
|
-
getManyPublic(config: FindManyOptions<StatsAggregatedPlaylist>,
|
|
12
|
-
getManyPrivate(config: FindManyOptions<StatsAggregatedPlaylist>, account_id: number,
|
|
11
|
+
getManyPublic(config: FindManyOptions<StatsAggregatedPlaylist>, queueMediumType: QueryParamsQueueMedium | null): Promise<StatsAggregatedPlaylist[]>;
|
|
12
|
+
getManyPrivate(config: FindManyOptions<StatsAggregatedPlaylist>, account_id: number, queueMediumType: QueryParamsQueueMedium | null): Promise<[StatsAggregatedPlaylist[], number]>;
|
|
13
13
|
getManyPrivateByPlaylists(playlist_ids: number[], config: FindManyOptions<StatsAggregatedPlaylist>): Promise<[StatsAggregatedPlaylist[], number]>;
|
|
14
14
|
updateAggregatedStats(playlist_id: number, updateAllTime?: boolean): Promise<void>;
|
|
15
15
|
updateAggregatedStatsRolling(playlist_id: number, updateHistoricalOptions: UpdateHistoricalOptions): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statsAggregatedPlaylist.d.ts","sourceRoot":"","sources":["../../../src/services/stats/statsAggregatedPlaylist.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"statsAggregatedPlaylist.d.ts","sourceRoot":"","sources":["../../../src/services/stats/statsAggregatedPlaylist.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,sBAAsB,EAAsB,MAAM,kBAAkB,CAAC;AACxG,OAAO,EAAS,eAAe,EAAM,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAEtF,OAAO,EAAE,0BAA0B,EAA+B,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEzH,qBAAa,8BAA+B,SAAQ,0BAA0B,CAAC,uBAAuB,EAAE,MAAM,CAAC;IAC7G,OAAO,CAAC,8BAA8B,CAAiC;;IAOvE,SAAS,CAAC,cAAc,IAAI,MAAM;IAI5B,OAAO,CAAC,MAAM,EAAE,eAAe,CAAC,uBAAuB,CAAC,GAAG,OAAO,CAAC,uBAAuB,EAAE,CAAC;IAI7F,YAAY,CAAC,MAAM,EAAE,eAAe,CAAC,uBAAuB,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;IAI/E,aAAa,CACjB,MAAM,EAAE,eAAe,CAAC,uBAAuB,CAAC,EAChD,eAAe,EAAE,sBAAsB,GAAG,IAAI,GAC7C,OAAO,CAAC,uBAAuB,EAAE,CAAC;IAqC/B,cAAc,CAClB,MAAM,EAAE,eAAe,CAAC,uBAAuB,CAAC,EAChD,UAAU,EAAE,MAAM,EAClB,eAAe,EAAE,sBAAsB,GAAG,IAAI,GAC7C,OAAO,CAAC,CAAC,uBAAuB,EAAE,EAAE,MAAM,CAAC,CAAC;IAqCzC,yBAAyB,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,eAAe,CAAC,uBAAuB,CAAC,GAAG,OAAO,CAAC,CAAC,uBAAuB,EAAE,EAAE,MAAM,CAAC,CAAC;IAYjJ,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,GAAE,OAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzF,4BAA4B,CAAC,WAAW,EAAE,MAAM,EAAE,uBAAuB,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;CAGzH"}
|
|
@@ -33,8 +33,9 @@ class StatsAggregatedPlaylistService extends baseStatsAggregated_1.BaseStatsAggr
|
|
|
33
33
|
return this.repositoryRead.count(config);
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
getManyPublic(config,
|
|
36
|
+
getManyPublic(config, queueMediumType) {
|
|
37
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
const medium_id = (0, podverse_helpers_1.getQueueMediumIdFromType)(queueMediumType);
|
|
38
39
|
return this.repositoryRead.find(Object.assign(Object.assign({}, config), { select: Object.assign(Object.assign({}, baseStatsAggregated_1.STATS_AGGREGATED_SELECT_ALL), { playlist: {
|
|
39
40
|
id_text: true,
|
|
40
41
|
title: true,
|
|
@@ -58,8 +59,9 @@ class StatsAggregatedPlaylistService extends baseStatsAggregated_1.BaseStatsAggr
|
|
|
58
59
|
] }));
|
|
59
60
|
});
|
|
60
61
|
}
|
|
61
|
-
getManyPrivate(config, account_id,
|
|
62
|
+
getManyPrivate(config, account_id, queueMediumType) {
|
|
62
63
|
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
const medium_id = (0, podverse_helpers_1.getQueueMediumIdFromType)(queueMediumType);
|
|
63
65
|
return this.repositoryRead.findAndCount(Object.assign(Object.assign({}, config), { select: Object.assign(Object.assign({}, baseStatsAggregated_1.STATS_AGGREGATED_SELECT_ALL), { playlist: {
|
|
64
66
|
id_text: true,
|
|
65
67
|
title: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "podverse-orm",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.6-alpha.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -15,13 +15,16 @@
|
|
|
15
15
|
},
|
|
16
16
|
"author": "",
|
|
17
17
|
"license": "AGPLv3",
|
|
18
|
+
"overrides": {
|
|
19
|
+
"fast-xml-parser": "^4.1.2"
|
|
20
|
+
},
|
|
18
21
|
"dependencies": {
|
|
19
22
|
"async-mutex": "^0.5.0",
|
|
20
23
|
"bcrypt": "^6.0.0",
|
|
21
24
|
"module-alias": "^2.2.3",
|
|
22
25
|
"nanoid": "^5.1.6",
|
|
23
26
|
"pg": "^8.16.3",
|
|
24
|
-
"podverse-helpers": "^5.1.
|
|
27
|
+
"podverse-helpers": "^5.1.6-alpha.0",
|
|
25
28
|
"typeorm": "^0.3.26",
|
|
26
29
|
"typeorm-naming-strategies": "^4.1.0"
|
|
27
30
|
},
|