feat(protos): Add playlistTitle field to NextParams (#1040)

This commit is contained in:
absidue
2025-09-18 00:50:20 +02:00
committed by GitHub
parent e24060c31d
commit ee9c184eeb
3 changed files with 15 additions and 3 deletions

View File

@@ -234,6 +234,7 @@ export interface ShortsParam_Field1 {
export interface NextParams {
videoId: string[];
playlistTitle?: string | undefined;
}
export interface CommunityPostParams {
@@ -2082,7 +2083,7 @@ export const ShortsParam_Field1: MessageFns<ShortsParam_Field1> = {
};
function createBaseNextParams(): NextParams {
return { videoId: [] };
return { videoId: [], playlistTitle: undefined };
}
export const NextParams: MessageFns<NextParams> = {
@@ -2090,6 +2091,9 @@ export const NextParams: MessageFns<NextParams> = {
for (const v of message.videoId) {
writer.uint32(42).string(v!);
}
if (message.playlistTitle !== undefined) {
writer.uint32(50).string(message.playlistTitle);
}
return writer;
},
@@ -2107,6 +2111,13 @@ export const NextParams: MessageFns<NextParams> = {
message.videoId.push(reader.string());
continue;
case 6:
if (tag !== 50) {
break;
}
message.playlistTitle = reader.string();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;

View File

@@ -228,6 +228,7 @@ message ShortsParam {
message NextParams {
repeated string video_id = 5;
optional string playlist_title = 6;
}
message CommunityPostParams {

View File

@@ -48,7 +48,7 @@ export function encodeCommentActionParams(type: number, args: CommentActionParam
return encodeURIComponent(u8ToBase64(writer.finish()));
}
export function encodeNextParams(video_ids: string[]): string {
const writer = NextParams.encode({ videoId: video_ids });
export function encodeNextParams(video_ids: string[], playlist_title?: string): string {
const writer = NextParams.encode({ videoId: video_ids, playlistTitle: playlist_title });
return encodeURIComponent(u8ToBase64(writer.finish()).replace(/\+/g, '-').replace(/\//g, '_'));
}