diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index c0bada1..64f52a6 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -35,23 +35,23 @@ export default defineUserConfig({ }, { text: "Searching for songs", - link: "/guides/usage/searchSong.html" + link: "/guides/usage/searchSongs.html" }, { text: "Searching for videos", - link: "/guides/usage/searchVideo.html" + link: "/guides/usage/searchVideos.html" }, { text: "Searching for artists", - link: "/guides/usage/searchArtist.html" + link: "/guides/usage/searchArtists.html" }, { text: "Searching for albums", - link: "/guides/usage/searchAlbum.html" + link: "/guides/usage/searchAlbums.html" }, { text: "Searching for playlists", - link: "/guides/usage/searchPlaylist.html" + link: "/guides/usage/searchPlaylists.html" }, { text: "Getting a song", @@ -105,24 +105,24 @@ export default defineUserConfig({ link: "/references/ytmusic-methods/search.html" }, { - text: "searchSong", - link: "/references/ytmusic-methods/searchSong.html" + text: "searchSongs", + link: "/references/ytmusic-methods/searchSongs.html" }, { - text: "searchVideo", - link: "/references/ytmusic-methods/searchVideo.html" + text: "searchVideos", + link: "/references/ytmusic-methods/searchVideos.html" }, { - text: "searchArtist", - link: "/references/ytmusic-methods/searchArtist.html" + text: "searchArtists", + link: "/references/ytmusic-methods/searchArtists.html" }, { - text: "searchAlbum", - link: "/references/ytmusic-methods/searchAlbum.html" + text: "searchAlbums", + link: "/references/ytmusic-methods/searchAlbums.html" }, { - text: "searchPlaylist", - link: "/references/ytmusic-methods/searchPlaylist.html" + text: "searchPlaylists", + link: "/references/ytmusic-methods/searchPlaylists.html" }, { text: "getSong", diff --git a/docs/guides/usage/searchAlbum.md b/docs/guides/usage/searchAlbums.md similarity index 100% rename from docs/guides/usage/searchAlbum.md rename to docs/guides/usage/searchAlbums.md diff --git a/docs/guides/usage/searchArtist.md b/docs/guides/usage/searchArtists.md similarity index 100% rename from docs/guides/usage/searchArtist.md rename to docs/guides/usage/searchArtists.md diff --git a/docs/guides/usage/searchPlaylist.md b/docs/guides/usage/searchPlaylists.md similarity index 100% rename from docs/guides/usage/searchPlaylist.md rename to docs/guides/usage/searchPlaylists.md diff --git a/docs/guides/usage/searchSong.md b/docs/guides/usage/searchSongs.md similarity index 100% rename from docs/guides/usage/searchSong.md rename to docs/guides/usage/searchSongs.md diff --git a/docs/guides/usage/searchVideo.md b/docs/guides/usage/searchVideos.md similarity index 100% rename from docs/guides/usage/searchVideo.md rename to docs/guides/usage/searchVideos.md diff --git a/docs/references/interfaces/ArtistDetailed.md b/docs/references/interfaces/ArtistDetailed.md index 1cf782e..7effacb 100644 --- a/docs/references/interfaces/ArtistDetailed.md +++ b/docs/references/interfaces/ArtistDetailed.md @@ -24,4 +24,4 @@ interface ArtistDetailed { [SearchResult](../types/SearchResult.html) -[YTMusic#searchArtist](../../guides/usage/searchArtist.html) +[YTMusic#searchArtists](../../guides/usage/searchArtists.html) diff --git a/docs/references/interfaces/PlaylistFull.md b/docs/references/interfaces/PlaylistFull.md index 6f59e31..7111b5f 100644 --- a/docs/references/interfaces/PlaylistFull.md +++ b/docs/references/interfaces/PlaylistFull.md @@ -28,6 +28,6 @@ interface PlaylistFull { [SearchResult](../types/SearchResult.html) -[YTMusic#searchPlaylist](../../guides/usage/searchPlaylist.html) +[YTMusic#searchPlaylists](../../guides/usage/searchPlaylists.html) [YTMusic#getPlaylist](../../guides/usage/getPlaylist.html) diff --git a/docs/references/interfaces/VideoDetailed.md b/docs/references/interfaces/VideoDetailed.md index dcb056a..e7ef10b 100644 --- a/docs/references/interfaces/VideoDetailed.md +++ b/docs/references/interfaces/VideoDetailed.md @@ -30,6 +30,6 @@ interface VideoDetailed { [SearchResult](../types/SearchResult.html) -[YTMusic#searchVideo](../../guides/usage/searchVideo.html) +[YTMusic#searchVideos](../../guides/usage/searchVideos.html) [YTMusic#getPlaylistVideos](../../guides/usage/getPlaylistVideos.html) diff --git a/docs/references/ytmusic-methods/searchAlbum.md b/docs/references/ytmusic-methods/searchAlbums.md similarity index 100% rename from docs/references/ytmusic-methods/searchAlbum.md rename to docs/references/ytmusic-methods/searchAlbums.md diff --git a/docs/references/ytmusic-methods/searchArtist.md b/docs/references/ytmusic-methods/searchArtists.md similarity index 100% rename from docs/references/ytmusic-methods/searchArtist.md rename to docs/references/ytmusic-methods/searchArtists.md diff --git a/docs/references/ytmusic-methods/searchPlaylist.md b/docs/references/ytmusic-methods/searchPlaylists.md similarity index 100% rename from docs/references/ytmusic-methods/searchPlaylist.md rename to docs/references/ytmusic-methods/searchPlaylists.md diff --git a/docs/references/ytmusic-methods/searchSong.md b/docs/references/ytmusic-methods/searchSongs.md similarity index 100% rename from docs/references/ytmusic-methods/searchSong.md rename to docs/references/ytmusic-methods/searchSongs.md diff --git a/docs/references/ytmusic-methods/searchVideo.md b/docs/references/ytmusic-methods/searchVideos.md similarity index 100% rename from docs/references/ytmusic-methods/searchVideo.md rename to docs/references/ytmusic-methods/searchVideos.md diff --git a/src/YTMusic.ts b/src/YTMusic.ts index b49d52f..34c137a 100644 --- a/src/YTMusic.ts +++ b/src/YTMusic.ts @@ -232,7 +232,7 @@ export default class YTMusic { * * @param query Query string */ - public async searchSong(query: string): Promise { + public async searchSongs(query: string): Promise { const searchData = await this.constructRequest("search", { query, params: "Eg-KAQwIARAAGAAgACgAMABqChAEEAMQCRAFEAo%3D" @@ -248,7 +248,7 @@ export default class YTMusic { * * @param query Query string */ - public async searchVideo(query: string): Promise { + public async searchVideos(query: string): Promise { const searchData = await this.constructRequest("search", { query, params: "Eg-KAQwIABABGAAgACgAMABqChAEEAMQCRAFEAo%3D" @@ -264,7 +264,7 @@ export default class YTMusic { * * @param query Query string */ - public async searchArtist(query: string): Promise { + public async searchArtists(query: string): Promise { const searchData = await this.constructRequest("search", { query, params: "Eg-KAQwIABAAGAAgASgAMABqChAEEAMQCRAFEAo%3D" @@ -280,7 +280,7 @@ export default class YTMusic { * * @param query Query string */ - public async searchAlbum(query: string): Promise { + public async searchAlbums(query: string): Promise { const searchData = await this.constructRequest("search", { query, params: "Eg-KAQwIABAAGAEgACgAMABqChAEEAMQCRAFEAo%3D" @@ -296,7 +296,7 @@ export default class YTMusic { * * @param query Query string */ - public async searchPlaylist(query: string): Promise { + public async searchPlaylists(query: string): Promise { const searchData = await this.constructRequest("search", { query, params: "Eg-KAQwIABAAGAAgACgBMABqChAEEAMQCRAFEAo%3D" diff --git a/src/__tests__/traversing.spec.ts b/src/__tests__/traversing.spec.ts index 15af061..b65c96d 100644 --- a/src/__tests__/traversing.spec.ts +++ b/src/__tests__/traversing.spec.ts @@ -37,27 +37,27 @@ queries.forEach(query => { }) it("Search Songs", async () => { - const songs = await ytmusic.searchSong(query) + const songs = await ytmusic.searchSongs(query) expect(songs, LIST(SONG_DETAILED)) }) it("Search Videos", async () => { - const videos = await ytmusic.searchVideo(query) + const videos = await ytmusic.searchVideos(query) expect(videos, LIST(VIDEO_DETAILED)) }) it("Search Artists", async () => { - const artists = await ytmusic.searchArtist(query) + const artists = await ytmusic.searchArtists(query) expect(artists, LIST(ARTIST_DETAILED)) }) it("Search Albums", async () => { - const albums = await ytmusic.searchAlbum(query) + const albums = await ytmusic.searchAlbums(query) expect(albums, LIST(ALBUM_DETAILED)) }) it("Search Playlists", async () => { - const playlists = await ytmusic.searchPlaylist(query) + const playlists = await ytmusic.searchPlaylists(query) expect(playlists, LIST(PLAYLIST_FULL)) }) @@ -70,49 +70,49 @@ queries.forEach(query => { }) it("Get details of the first song result", async () => { - const songs = await ytmusic.searchSong(query) + const songs = await ytmusic.searchSongs(query) const song = await ytmusic.getSong(songs[0]!.videoId) expect(song, SONG_FULL) }) it("Get details of the first video result", async () => { - const videos = await ytmusic.searchVideo(query) + const videos = await ytmusic.searchVideos(query) const video = await ytmusic.getVideo(videos[0]!.videoId) expect(video, VIDEO_FULL) }) it("Get details of the first artist result", async () => { - const artists = await ytmusic.searchArtist(query) + const artists = await ytmusic.searchArtists(query) const artist = await ytmusic.getArtist(artists[0]!.artistId) expect(artist, ARTIST_FULL) }) it("Get the songs of the first artist result", async () => { - const artists = await ytmusic.searchArtist(query) + const artists = await ytmusic.searchArtists(query) const songs = await ytmusic.getArtistSongs(artists[0]!.artistId) expect(songs, LIST(SONG_DETAILED)) }) it("Get the albums of the first artist result", async () => { - const artists = await ytmusic.searchArtist(query) + const artists = await ytmusic.searchArtists(query) const albums = await ytmusic.getArtistAlbums(artists[0]!.artistId) expect(albums, LIST(ALBUM_DETAILED)) }) it("Get details of the first album result", async () => { - const albums = await ytmusic.searchAlbum(query) + const albums = await ytmusic.searchAlbums(query) const album = await ytmusic.getAlbum(albums[0]!.albumId) expect(album, ALBUM_FULL) }) it("Get details of the first playlist result", async () => { - const playlists = await ytmusic.searchPlaylist(query) + const playlists = await ytmusic.searchPlaylists(query) const playlist = await ytmusic.getPlaylist(playlists[0]!.playlistId) expect(playlist, PLAYLIST_FULL) }) it("Get the videos of the first playlist result", async () => { - const playlists = await ytmusic.searchPlaylist(query) + const playlists = await ytmusic.searchPlaylists(query) const videos = await ytmusic.getPlaylistVideos(playlists[0]!.playlistId) expect(videos, LIST(PLAYLIST_VIDEO)) })