Merge pull request #107 from AnonymusRaccoon/fix/worker

Fix/worker
This commit is contained in:
Zoe Roux
2022-03-06 14:17:14 +01:00
committed by GitHub
2 changed files with 8 additions and 6 deletions
+3 -3
View File
@@ -13,11 +13,11 @@
},
"params": [
{
"name": "channel",
"name": "channel_id",
"type": "string",
"description": {
"en": "Name of the channel to watch over",
"fr": "Le nom de la chaîne à regarder"
"en": "ID of the channel to watch over",
"fr": "L'ID de la chaîne à regarder"
}
}
],
+5 -3
View File
@@ -40,12 +40,12 @@ export class Youtube extends BaseService {
});
}
@action(PipelineType.OnYtUpload, ["channel"])
@action(PipelineType.OnYtUpload, ["channel_id"])
listenChannel(params: any): Observable<PipelineEnv> {
return Utils.longPulling(async (since) => {
const ret = await this._youtube.activities.list({
part: ["snippet"],
channelId: params.channel,
part: ["snippet", "contentDetails"],
channelId: params.channel_id,
maxResults: 25,
publishedAfter: since.toISOString(),
}, {});
@@ -134,10 +134,12 @@ export class Youtube extends BaseService {
@reaction(ReactionType.YtAddToPlaylist, ["videoId", "playlistId"])
async reactPlaylist(params: any): Promise<PipelineEnv> {
await this._youtube.playlistItems.insert({
part: ["snippet"],
requestBody: {
snippet: {
resourceId: {
videoId: params.videoId,
kind: "youtube#video"
},
playlistId: params.playlistId,
},