diff --git a/src/entities/channel-section.ts b/src/entities/channel-section.ts index efe8418a0..20a8749bf 100644 --- a/src/entities/channel-section.ts +++ b/src/entities/channel-section.ts @@ -13,7 +13,7 @@ export class ChannelSection { /** * The parts to request for this entity. */ - public static part = 'snippet,contentDetails' + public static part = 'contentDetails,snippet' /** * The fields to request for this entity. diff --git a/src/entities/channel.ts b/src/entities/channel.ts index ba833f241..8e71d4551 100644 --- a/src/entities/channel.ts +++ b/src/entities/channel.ts @@ -13,7 +13,8 @@ export class Channel { /** * The parts to request for this entity. */ - public static part = 'snippet,contentDetails,statistics,status,brandingSettings,localizations' + public static part = + 'brandingSettings,contentDetails,localizations,snippet,statistics,status' /** * The fields to request for this entity. @@ -322,8 +323,8 @@ export class Channel { */ public async unsubscribe (subscriptionResolvable?: SubscriptionResolvable, myId?: string) { const subscription = subscriptionResolvable ? - await this.youtube._resolutionService.resolve(subscriptionResolvable, Subscription) : - await this.youtube._subscriptionService.getSubscriptionByChannels( + await this.youtube._services.resolution.resolve(subscriptionResolvable, Subscription) : + await this.youtube.getSubscriptionByChannels( myId ?? (await this.youtube.oauth.getMe()).id, this.id ) diff --git a/src/entities/index.ts b/src/entities/index.ts index b1a8636ae..a52f6b82f 100644 --- a/src/entities/index.ts +++ b/src/entities/index.ts @@ -4,6 +4,7 @@ */ export * from './video' +export * from './video-rating' export * from './channel' export * from './playlist' export * from './comment' diff --git a/src/entities/playlist.ts b/src/entities/playlist.ts index c781cd9cb..9a8b7700e 100644 --- a/src/entities/playlist.ts +++ b/src/entities/playlist.ts @@ -13,7 +13,7 @@ export class Playlist { /** * The parts to request for this entity. */ - public static part = 'snippet,contentDetails,player,status' + public static part = 'contentDetails,player,snippet,status' /** * The fields to request for this entity. @@ -199,7 +199,7 @@ export class Playlist { * @param note A note on the video. */ public async addVideo (videoResolvable: VideoResolvable, position?: number, note?: string) { - const videoId = await this.youtube._resolutionService.resolve(videoResolvable, Video) + const videoId = await this.youtube._services.resolution.resolve(videoResolvable, Video) const playlistItem = await this.youtube.oauth.playlists.addPlaylistItem( this, videoId, position, note) @@ -218,8 +218,8 @@ export class Playlist { * @param itemId The playlist item ID if you have it. */ public async updateVideo (videoResolvable: VideoResolvable, position?: number, note?: string, itemId?: string) { - const video = await this.youtube._resolutionService.resolve(videoResolvable, Video) - const playlistItemId = itemId ?? (await this.youtube._genericService.getPaginatedItems({ + const video = await this.youtube._services.resolution.resolve(videoResolvable, Video) + const playlistItemId = itemId ?? (await this.youtube._services.retrieval.getPaginatedItems({ type: PaginatedItemType.PlaylistItems, mine: false, id: this.id, @@ -238,16 +238,22 @@ export class Playlist { * @param videoResolvable The URL, ID, or (not recommended) search query of the video. */ public async removeVideo (videoResolvable: VideoResolvable) { - const video = await this.youtube._resolutionService.resolve(videoResolvable, Video) - const playlistItemId = (this.youtube._genericService.getPaginatedItems({ + const video = await this.youtube._services.resolution.resolve(videoResolvable, Video) + const matchingItems = (await this.youtube._services.retrieval.getPaginatedItems