Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: playlists #5

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

feat: playlists #5

wants to merge 2 commits into from

Conversation

Luna-devv
Copy link
Owner

works? seems like, idk

import { Lunify, PartialUser } from '../src/lib';

const refresh_token = '';

const api = new Lunify({
    clientId: '898e127e95f24f578fdbfec93ae203cd',
    clientSecret: '',
});

(async() => {
    const access = await api.oauth.refreshToken(refresh_token);
    const user = new PartialUser(api, access);

    await user.playlists.fetch(); // or just take the return value
    const playlist = user.playlists.cache.find((playlist) => playlist.name.includes('Frau'));
    console.log(playlist.name);

    await playlist.tracks.fetch();
    console.log(playlist.tracks.cache.size);
})();

@Luna-devv Luna-devv marked this pull request as draft August 11, 2024 15:53
@Luna-devv Luna-devv self-assigned this Aug 11, 2024
@Luna-devv Luna-devv added the enhancement New feature or request label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

1 participant